From 2beb2e4560f7ae406354d777b43201d040c44af0 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 10 Aug 2021 16:08:23 +0200 Subject: build: add Ferdi snap package (#1767) - add snap as build target for linux - update GH actions to auto-publish snap (based on branch and package.json version) --- .github/workflows/ferdi-builds.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index 46ae40fc0..d9627c816 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml @@ -190,6 +190,7 @@ jobs: echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV + echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch uses: actions/checkout@v2 if: ${{ github.event_name == 'schedule' || env.MANUAL_REBUILD_ON_NIGHTLY == 'true' }} @@ -252,18 +253,40 @@ jobs: shell: bash - name: Build Ferdi with publish for 'nightly' branch if: ${{ env.GIT_BRANCH_NAME == 'nightly' }} - run: npm run build -- --publish always -c.publish.provider=github -c.publish.owner=${{ github.repository_owner }} -c.publish.repo=nightlies - shell: bash env: GH_TOKEN: ${{ secrets.FERDI_PUBLISH_TOKEN }} CSC_IDENTITY_AUTO_DISCOVERY: false + SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }} + run: | + sudo snap install snapcraft --classic + echo "$SNAPCRAFT_LOGIN" | snapcraft login --with - + npm run build -- --publish always -c.publish.provider=github -c.publish.owner=${{ github.repository_owner }} -c.publish.repo=nightlies + snapcraft logout + shell: bash - name: Build Ferdi with publish for 'release' branch - if: ${{ env.GIT_BRANCH_NAME == 'release' }} - run: npm run build -- --publish always -c.publish.provider=github -c.publish.owner=${{ github.repository_owner }} -c.publish.repo=ferdi + if: ${{ env.GIT_BRANCH_NAME == 'release' && contains(env.PACKAGE_VERSION, 'beta') }} + env: + GH_TOKEN: ${{ secrets.FERDI_PUBLISH_TOKEN }} + CSC_IDENTITY_AUTO_DISCOVERY: false + SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }} + run: | + sudo snap install snapcraft --classic + echo "$SNAPCRAFT_LOGIN" | snapcraft login --with - + npm run build -- --publish always -c.publish.provider=github -c.publish.owner=${{ github.repository_owner }} -c.publish.repo=ferdi -c.snap.publish.channels=beta + snapcraft logout shell: bash + - name: Build Ferdi with publish for 'release' branch + if: ${{ env.GIT_BRANCH_NAME == 'release' && !contains(env.PACKAGE_VERSION, 'beta') }} env: GH_TOKEN: ${{ secrets.FERDI_PUBLISH_TOKEN }} CSC_IDENTITY_AUTO_DISCOVERY: false + SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }} + run: | + sudo snap install snapcraft --classic + echo "$SNAPCRAFT_LOGIN" | snapcraft login --with - + npm run build -- --publish always -c.publish.provider=github -c.publish.owner=${{ github.repository_owner }} -c.publish.repo=ferdi -c.snap.publish.channels=stable + snapcraft logout + shell: bash build_windows: name: 'windows ${{ github.event.inputs.message }}' -- cgit v1.2.3-54-g00ecf