From 1c6a855bc77814b8104e7bc2bbd3aa4dbc4fabd0 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Wed, 4 Dec 2019 23:56:21 -0600 Subject: [PATCH 1/5] Move build script to own file --- .github/workflows/release.yml | 10 ++-------- scripts/build | 10 ++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100755 scripts/build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43ad3488..875f2187 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,5 @@ jobs: # 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: sh diff --git a/scripts/build b/scripts/build new file mode 100755 index 00000000..cedf3062 --- /dev/null +++ b/scripts/build @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +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 From b22724557d0a300b390683d525d74461972eb4dc Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Thu, 5 Dec 2019 00:05:33 -0600 Subject: [PATCH 2/5] Use bash instead of sh --- .github/workflows/release.yml | 2 +- scripts/build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 875f2187..aa91407f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,4 +28,4 @@ jobs: # Build - name: Build on ${{ matrix.os }} run: ./scripts/build "${{ matrix.os }}" - shell: sh + shell: bash diff --git a/scripts/build b/scripts/build index cedf3062..a920ad26 100755 --- a/scripts/build +++ b/scripts/build @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -e From 99c12d1810ea56e54c2f3c3edb761f9aecbf47d9 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Thu, 5 Dec 2019 00:06:08 -0600 Subject: [PATCH 3/5] Add GH_TOKEN variable for upload The upload step of elecron-builder needs a GH token to use. --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa91407f..fffc851f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,3 +29,5 @@ jobs: - name: Build on ${{ matrix.os }} run: ./scripts/build "${{ matrix.os }}" shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b3c2a1d432bad4f5de922749820bc2a0b854a5a9 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Thu, 5 Dec 2019 01:33:29 -0600 Subject: [PATCH 4/5] Temporary fix for electron-builder --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fffc851f..2ed513b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,17 @@ 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: ./scripts/build "${{ matrix.os }}" From 127bb2f6e66ff22b5e30806ffb8267f6c36e7ec0 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Thu, 5 Dec 2019 01:54:45 -0600 Subject: [PATCH 5/5] Only build on tag push --- .github/workflows/release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ed513b1..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: