Skip to content

Commit cc62e9b

Browse files
committed
tweak workflow
1 parent b411bab commit cc62e9b

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

.github/workflows/build-msi.yaml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build MSI
22

3-
on: [push]
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
# since this is being triggered manually on branch but we should use our regular git tags when we're back on the normal flow
7+
msi_version:
8+
description: "MSI package version (e.g., 1.0.0)"
9+
required: true
410

511
jobs:
612
build-msi:
@@ -10,6 +16,21 @@ jobs:
1016
- name: Checkout code
1117
uses: actions/checkout@v3
1218

19+
- name: Install GitHub CLI
20+
run: |
21+
choco install gh --yes
22+
23+
# Step 3: Only needed while we provide manual versions
24+
- name: Check for existing version
25+
shell: bash
26+
run: |
27+
if gh release view | grep "agent-${{ github.event.inputs.msi_version }}.msi"; then
28+
echo "Error: An artifact with version '${{ github.event.inputs.msi_version }}' already exists. Please increment the version."
29+
exit 1
30+
fi
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
1334
- name: Set up Go
1435
uses: actions/setup-go@v4
1536
with:
@@ -18,17 +39,23 @@ jobs:
1839
- name: Install Make
1940
run: choco install make --yes
2041

21-
- name: Install WiX 5.0
42+
- name: Install WiX CLI
2243
run: dotnet tool install --global wix
2344

45+
- name: Install WiX Extensions
46+
run: |
47+
wix extension add -g WixToolset.Firewall.wixext/5.0.2
48+
wix extension add -g WixToolset.Util.wixext/5.0.2
49+
2450
- name: Build Go binary
2551
run: make windows
2652

2753
- name: Build MSI
28-
run: wix build agent.wxs -define GoBinDir="${{ github.workspace }}" -define MSIProductVersion="0.0.3" -ext WixToolset.Util.wixext -ext WixToolset.Firewall.wixext -o agent.msi
29-
54+
run: |
55+
wix build agent.wxs -define GoBinDir="${{ github.workspace }}\bin" -define MSIProductVersion="${{ github.event.inputs.msi_version }}" -ext WixToolset.Util.wixext -ext WixToolset.Firewall.wixext -o agent-${{ github.event.inputs.msi_version }}.msi
56+
3057
- name: Upload MSI artifact
3158
uses: actions/upload-artifact@v3
3259
with:
33-
name: agent.msi
34-
path: agent.msi
60+
name: agent-${{ github.event.inputs.msi_version }}.msi
61+
path: agent-${{ github.event.inputs.msi_version }}.msi

agent.msi

-13.5 MB
Binary file not shown.

agent.wixpdb

-17.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)