Skip to content

Commit 206bee3

Browse files
authored
ci(prerelease): build Windows installers on windows-latest (#586)
The prerelease Windows matrix entries used os: ubuntu-latest, but the 'Install Inno Setup' / 'Create Windows installer' steps require a real Windows runner (Chocolatey + ISCC.exe). On Ubuntu, 'choco' does not exist, so the v0.37.0-rc.1 prerelease build (run 26926147427) failed: choco: The term 'choco' is not recognized as a name of a cmdlet... ##[error]Process completed with exit code 1. Switch the two Windows matrix entries to windows-latest with cgo: "1", matching the proven release.yml configuration. Because the shared build steps now run on a Windows host (default shell pwsh), add shell: bash to the bash-syntax steps ('Copy frontend dist', 'Build binary and create archives') and use PowerShell Compress-Archive for the Windows .zip (the 'zip' command is unavailable in Git-bash on windows-latest) — all mirroring release.yml. macOS/Linux build behavior is unchanged.
1 parent 74030f3 commit 206bee3

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ jobs:
3333
cgo: "0"
3434
name: mcpproxy-linux-arm64
3535
archive_format: tar.gz
36-
- os: ubuntu-latest
36+
- os: windows-latest
3737
goos: windows
3838
goarch: amd64
39-
cgo: "0"
39+
cgo: "1"
4040
name: mcpproxy-windows-amd64.exe
4141
archive_format: zip
42-
- os: ubuntu-latest
42+
- os: windows-latest
4343
goos: windows
4444
goarch: arm64
45-
cgo: "0"
45+
cgo: "1"
4646
name: mcpproxy-windows-arm64.exe
4747
archive_format: zip
4848
- os: macos-15
@@ -97,6 +97,7 @@ jobs:
9797
run: cd frontend && npm run build
9898

9999
- name: Copy frontend dist to embed location
100+
shell: bash
100101
run: |
101102
rm -rf web/frontend
102103
mkdir -p web/frontend
@@ -182,6 +183,7 @@ jobs:
182183
183184
184185
- name: Build binary and create archives
186+
shell: bash
185187
env:
186188
CGO_ENABLED: ${{ matrix.cgo }}
187189
GOOS: ${{ matrix.goos }}
@@ -406,7 +408,12 @@ jobs:
406408
407409
if [ "${{ matrix.archive_format }}" = "zip" ]; then
408410
# Create only versioned archive (no latest for prereleases)
409-
zip "${ARCHIVE_BASE}.zip" ${CLEAN_BINARY}
411+
if [ "${{ matrix.goos }}" = "windows" ]; then
412+
# Use PowerShell Compress-Archive on Windows since zip command isn't available
413+
powershell -Command "Compress-Archive -Path '${CLEAN_BINARY}' -DestinationPath '${ARCHIVE_BASE}.zip'"
414+
else
415+
zip "${ARCHIVE_BASE}.zip" ${CLEAN_BINARY}
416+
fi
410417
else
411418
# Create only versioned archive (no latest for prereleases)
412419
tar -czf "${ARCHIVE_BASE}.tar.gz" ${CLEAN_BINARY}

0 commit comments

Comments
 (0)