Skip to content

Commit bc40514

Browse files
committed
Simplify building the MSI installer
Now that there is a ZIP archive to download, to avoid the complexities of unzipping through Node.js we use hub to download the `.zip`, extract it, and eventually upload the `.msi` back to the release.
1 parent 7a1ae75 commit bc40514

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/releases.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v2
1414
- name: Set up Go 1.13
1515
uses: actions/setup-go@v1
1616
with:
1717
go-version: 1.13
1818
- name: Generate changelog
19-
run: script/changelog | tee CHANGELOG.md
19+
run: |
20+
git fetch --unshallow
21+
script/changelog | tee CHANGELOG.md
2022
- name: Run GoReleaser
2123
uses: goreleaser/goreleaser-action@v1
2224
with:
@@ -31,23 +33,32 @@ jobs:
3133
runs-on: windows-latest
3234
steps:
3335
- name: Checkout
34-
uses: actions/checkout@v1
35-
- name: Set up Go 1.13
36-
uses: actions/setup-go@v1
37-
with:
38-
go-version: 1.13
36+
uses: actions/checkout@v2
3937
- name: Download gh.exe
40-
uses: ./.github/actions/download-exe
4138
id: download_exe
39+
shell: bash
40+
run: |
41+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
42+
bin/hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip'
43+
printf "::set-output name=zip::%s\n" *.zip
44+
unzip -o *.zip && rm -v *.zip
4245
env:
4346
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4447
- name: Install go-msi
4548
run: choco install -y "go-msi"
49+
- name: Prepare PATH
50+
shell: bash
51+
run: |
52+
echo "::add-path::$WIX\\bin"
53+
echo "::add-path::C:\\Program Files\\go-msi"
4654
- name: Build MSI
4755
id: buildmsi
48-
uses: ./.github/actions/build-msi
49-
with:
50-
exe: ${{ steps.download_exe.outputs.exe }}
56+
shell: bash
57+
run: |
58+
mkdir -p build
59+
msi="$(basename "${{ steps.download_exe.outputs.zip }}" ".zip").msi"
60+
printf "::set-output name=msi::%s\n" "$msi"
61+
go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}"
5162
- name: Obtain signing cert
5263
id: obtain_cert
5364
env:
@@ -60,9 +71,8 @@ jobs:
6071
.\script\sign.ps1 -Certificate "${{ steps.obtain_cert.outputs.cert-file }}" `
6172
-Executable "${{ steps.buildmsi.outputs.msi }}"
6273
- name: Upload MSI
63-
uses: ./.github/actions/upload-msi
64-
with:
65-
msi-file: ${{ steps.buildmsi.outputs.msi }}
74+
shell: bash
75+
run: bin/hub release edit "${GITHUB_REF#refs/tags/}" -m "" -a "${{ steps.buildmsi.outputs.msi }}"
6676
env:
6777
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6878
releases:

0 commit comments

Comments
 (0)