From e188d930db5ad186153480b0fdc14ce7c935a7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Wed, 27 Jan 2021 07:34:25 +0100 Subject: [PATCH 1/3] [snap] refresh snap - move to packaging/ubuntu/snap similar to the others - use `snapcraftctl` to set the snap version - define the supported architectures - use command-chain to improve debugging --- .../ubuntu/snap/snapcraft.yaml | 16 ++++++++++++---- snap | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) rename snapcraft.yaml => packaging/ubuntu/snap/snapcraft.yaml (88%) create mode 120000 snap diff --git a/snapcraft.yaml b/packaging/ubuntu/snap/snapcraft.yaml similarity index 88% rename from snapcraft.yaml rename to packaging/ubuntu/snap/snapcraft.yaml index 40ed4496..4ffe133a 100644 --- a/snapcraft.yaml +++ b/packaging/ubuntu/snap/snapcraft.yaml @@ -1,5 +1,4 @@ name: nymea-app -version: developer-build summary: Control app for nymea description: | The nymea daemon is a plugin based IoT (Internet of Things) server. @@ -9,12 +8,19 @@ description: | scenes and behaviors for your environment. grade: stable -base: core18 +base: core20 confinement: strict +adopt-info: nymea-app + +architectures: +- build-on: amd64 +- build-on: arm64 +- build-on: armhf apps: nymea-app: - command: desktop-launch nymea-app + command-chain: [ bin/desktop-launch ] + command: usr/bin/nymea-app desktop: usr/share/applications/nymea-app.desktop plugs: - avahi-observe @@ -55,7 +61,6 @@ parts: plugin: qmake source: . after: [desktop-qt5] - project-files: [ nymea-app.pro ] build-packages: - execstack - qt5-default @@ -90,3 +95,6 @@ parts: - libavahi-common3 - qtvirtualkeyboard-plugin - qtwayland5 + override-build: | + snapcraftctl set-version $( git -C ${SNAPCRAFT_PART_SRC} describe --tags ) + snapcraftctl build diff --git a/snap b/snap new file mode 120000 index 00000000..c7c77b20 --- /dev/null +++ b/snap @@ -0,0 +1 @@ +packaging/ubuntu/snap \ No newline at end of file From 94acae8a3727ef16b97eeb391f7062930191fa54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Tue, 26 Jan 2021 20:19:07 +0100 Subject: [PATCH 2/3] [github] add Snap workflow --- .github/workflows/snap.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/snap.yml diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml new file mode 100644 index 00000000..b8ef43f8 --- /dev/null +++ b/.github/workflows/snap.yml @@ -0,0 +1,52 @@ +name: Snap + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + Snap: + runs-on: ubuntu-latest + + env: + SNAPCRAFT_BUILD_INFO: 1 + + timeout-minutes: 60 + steps: + - name: Install Snapcraft + uses: Saviq/action-snapcraft@add-channel + with: + channel: candidate + use_lxd: true + + - name: Check out code + uses: actions/checkout@v2 + with: + submodules: true + # Needed for version determination to work + fetch-depth: 0 + + - name: Build + run: | + # Build the parts. + sg lxd -c '/snap/bin/snapcraft build --use-lxd' + - name: Build and verify the snap + id: build-snap + env: + SNAP_ENFORCE_RESQUASHFS: 0 + run: | + # Actually build the snap. + sg lxd -c '/snap/bin/snapcraft --use-lxd' + sudo snap install review-tools + /snap/bin/review-tools.snap-review *.snap + echo "::set-output name=snap-file::$( ls *.snap )" + - name: Upload the snap + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build-snap.outputs.snap-file }} + path: ${{ steps.build-snap.outputs.snap-file }} + if-no-files-found: error From 6c6b5380b1ea8a696f755ee6087bea78a41a30d4 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 6 Mar 2021 15:08:52 +0100 Subject: [PATCH 3/3] Read version from version.txt instead of git --- packaging/ubuntu/snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/ubuntu/snap/snapcraft.yaml b/packaging/ubuntu/snap/snapcraft.yaml index 4ffe133a..50868b27 100644 --- a/packaging/ubuntu/snap/snapcraft.yaml +++ b/packaging/ubuntu/snap/snapcraft.yaml @@ -96,5 +96,5 @@ parts: - qtvirtualkeyboard-plugin - qtwayland5 override-build: | - snapcraftctl set-version $( git -C ${SNAPCRAFT_PART_SRC} describe --tags ) + snapcraftctl set-version $( head -n 1 ${SNAPCRAFT_PART_SRC}/version.txt ) snapcraftctl build