diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43ad3488..a589ed00 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,12 +2,8 @@ name: Release Builder on: push: - branches: - - master tags: - v** - release: - types: [published, created, edited, prereleased] jobs: build: @@ -25,13 +21,20 @@ jobs: node-version: 12.x - run: npm install + # Patch + # TODO: Remove this patch once once electron-builder v22.x is out + # BODY: The GITHUB_TOKEN is of the form 'v1.xxx...', but + # BODY: electron-builder versions older than v22.x don't support that + # BODY: format. Once vue-cli-plugin-electron-builder switches to using + # BODY: electron-builder v22.x or later, this patch can be removed. + # BODY: For reference, see electron-userland/electron-builder#4176 + - name: Temporarily fix electron-builder + run: sed -i 's/\^\[\\w/\^\[.\\w/g' node_modules/builder-util/out/util.js + shell: bash + # Build - name: Build on ${{ matrix.os }} - run: | - if [ "${{ matrix.os }}" == 'windows-latest' ]; then - npm run electron:build -- -w # -p always - elif [ "${{ matrix.os }}" == 'macos-latest' ]; then - npm run electron:build -- -m # -p always - elif [ "${{ matrix.os }}" == 'ubuntu-latest' ]; then - npm run electron:build -- -l # -p always - fi + run: ./scripts/build "${{ matrix.os }}" + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/build b/scripts/build new file mode 100755 index 00000000..a920ad26 --- /dev/null +++ b/scripts/build @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +if [ "$1" == 'windows-latest' ]; then target="-w" +elif [ "$1" == 'macos-latest' ]; then target="-m" +elif [ "$1" == 'ubuntu-latest' ]; then target="-l" +fi + +npm run electron:build -- $target -p always