From 1033c7783d626ce5a05c3aeffd0004b1fc9bc532 Mon Sep 17 00:00:00 2001 From: Mythic Date: Thu, 15 Feb 2024 11:00:59 +0200 Subject: [PATCH] Add release CI workflow --- .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..66ca3643a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release + +on: + release: + types: [created] + +jobs: + build: + name: Build for ${{ matrix.platform }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - kind: linux + os: ubuntu-latest + platform: linux + - kind: windows + os: windows-latest + platform: win + - kind: mac + os: macos-11 + platform: osx + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + # The talk on the street says this might be a good version for building. + node-version: 14.20.1 + cache: yarn + + - name: Install Yarn dependencies + run: yarn install --frozen-lockfile + + - if: matrix.platform == 'linux' + name: Install bsdtar # Required by electron-builder when targeting pacman. + run: | + sudo apt-get update -y + sudo apt-get install -y libarchive-tools + + - name: Build project + id: build + uses: StarUbiquitous/command-output@v1.0.1 + with: + run: yarn build-${{ matrix.platform }} --publish=never + + - if: steps.build.outputs.stderr != '' + name: Log stderr + continue-on-error: true + run: echo '${{ steps.build.outputs.stderr }}' + + # Creating Electron executables can in some cases fail with exit code 0. + # Check the output of build step for obvious signs of failure. + - if: contains(steps.build.outputs.stderr, '[FAIL]') + name: Check STDERR for trouble + uses: actions/github-script@v6 + with: + script: core.setFailed('It seems the build process failed silently. See previous step for more info.') + + - name: Add build results to release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: >- + gh release upload --clobber ${{ github.ref_name }} dist/electron/Packaged/*