Skip to content

Commit 64386f2

Browse files
committed
ci: de-conflict stable/prerelease workflows for RC builds (MCP-1012)
release.yml triggers on tags v* which also matches RC tags (v*-rc.*), firing BOTH the stable and prerelease workflows for one RC tag. Guard the stable jobs that lacked the prerelease filter so release.yml no-ops on any tag containing a '-' (prerelease) component, matching the idiom already used by update-homebrew/publish-linux-repos: - generate-notes - build - sign-windows - release (had no if: at all — added one) - deploy-docs - trigger-marketing-update provenance/mcp-registry cascade-skip via needs: release; build-docker is if: false. Stable github.repository guards preserved. Also bring prerelease.yml to platform parity so an RC is a complete downloadable build: Windows now builds natively on windows-latest with cgo=1 (was cross-compiled on ubuntu, where choco/Inno Setup can't run), builds the Windows tray binary, includes the tray in archives, and uses PowerShell Compress-Archive on Windows. SignPath signing of Windows installers remains stable-only (RCs ship unsigned, as documented).
1 parent 06e23d4 commit 64386f2

2 files changed

Lines changed: 48 additions & 18 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 40 additions & 12 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,10 +97,14 @@ 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
102-
mkdir -p web/frontend
103-
cp -r frontend/dist web/frontend/
103+
mkdir -p web/frontend/dist
104+
cp -r frontend/dist/. web/frontend/dist/
105+
# Recreate the tracked .gitkeep so //go:embed all:frontend/dist
106+
# always has something to embed (matches the Makefile frontend-build target).
107+
touch web/frontend/dist/.gitkeep
104108
105109
- name: Import Code-Signing Certificates (macOS)
106110
if: matrix.goos == 'darwin'
@@ -182,6 +186,7 @@ jobs:
182186
183187
184188
- name: Build binary and create archives
189+
shell: bash
185190
env:
186191
CGO_ENABLED: ${{ matrix.cgo }}
187192
GOOS: ${{ matrix.goos }}
@@ -215,10 +220,15 @@ jobs:
215220
# Create clean core binary for archive
216221
go build -ldflags "${LDFLAGS}" -o ${CLEAN_BINARY} ./cmd/mcpproxy
217222
218-
# Build tray binary for macOS
219-
if [ "${{ matrix.goos }}" = "darwin" ]; then
220-
echo "Building mcpproxy-tray for macOS..."
221-
go build -ldflags "${LDFLAGS}" -o mcpproxy-tray ./cmd/mcpproxy-tray
223+
# Build tray binary for platforms with GUI support (macOS and Windows)
224+
if [ "${{ matrix.goos }}" = "darwin" ] || [ "${{ matrix.goos }}" = "windows" ]; then
225+
echo "Building mcpproxy-tray for ${{ matrix.goos }}..."
226+
if [ "${{ matrix.goos }}" = "windows" ]; then
227+
TRAY_BINARY="mcpproxy-tray.exe"
228+
else
229+
TRAY_BINARY="mcpproxy-tray"
230+
fi
231+
go build -ldflags "${LDFLAGS}" -o ${TRAY_BINARY} ./cmd/mcpproxy-tray
222232
fi
223233
224234
# Build Swift tray app (macOS only — replaces Go tray in .app bundle for DMG/PKG)
@@ -404,12 +414,30 @@ jobs:
404414
# Create archive with version info - DO NOT create "latest" archives for prereleases
405415
ARCHIVE_BASE="mcpproxy-${VERSION#v}-${{ matrix.goos }}-${{ matrix.goarch }}"
406416
417+
# Determine files to include in archive
418+
FILES_TO_ARCHIVE="${CLEAN_BINARY}"
419+
420+
# Add tray binary if it exists (Windows and macOS)
421+
if [ "${{ matrix.goos }}" = "windows" ] && [ -f "mcpproxy-tray.exe" ]; then
422+
FILES_TO_ARCHIVE="${FILES_TO_ARCHIVE} mcpproxy-tray.exe"
423+
echo "Including mcpproxy-tray.exe in archive"
424+
elif [ "${{ matrix.goos }}" = "darwin" ] && [ -f "mcpproxy-tray" ]; then
425+
FILES_TO_ARCHIVE="${FILES_TO_ARCHIVE} mcpproxy-tray"
426+
echo "Including mcpproxy-tray in archive"
427+
fi
428+
407429
if [ "${{ matrix.archive_format }}" = "zip" ]; then
408430
# Create only versioned archive (no latest for prereleases)
409-
zip "${ARCHIVE_BASE}.zip" ${CLEAN_BINARY}
431+
# Use PowerShell Compress-Archive on Windows since zip command isn't available
432+
if [ "${{ matrix.goos }}" = "windows" ]; then
433+
PS_FILES=$(echo ${FILES_TO_ARCHIVE} | sed 's/ /,/g')
434+
powershell -Command "Compress-Archive -Path ${PS_FILES} -DestinationPath '${ARCHIVE_BASE}.zip'"
435+
else
436+
zip "${ARCHIVE_BASE}.zip" ${FILES_TO_ARCHIVE}
437+
fi
410438
else
411439
# Create only versioned archive (no latest for prereleases)
412-
tar -czf "${ARCHIVE_BASE}.tar.gz" ${CLEAN_BINARY}
440+
tar -czf "${ARCHIVE_BASE}.tar.gz" ${FILES_TO_ARCHIVE}
413441
fi
414442
415443
- name: Build Linux .deb and .rpm packages

.github/workflows/release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Generate AI-powered release notes using Claude API
1717
generate-notes:
1818
runs-on: ubuntu-latest
19-
if: startsWith(github.ref, 'refs/tags/v')
19+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
2020
outputs:
2121
notes: ${{ steps.generate.outputs.notes }}
2222
notes_file: ${{ steps.generate.outputs.notes_file }}
@@ -187,8 +187,8 @@ jobs:
187187

188188
build:
189189
environment: production
190-
# Only run on version tags
191-
if: startsWith(github.ref, 'refs/tags/v')
190+
# Only run on stable version tags (skip prerelease tags like v*-rc.* / v*-next.*)
191+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
192192
strategy:
193193
fail-fast: false
194194
matrix:
@@ -961,7 +961,7 @@ jobs:
961961
needs: build
962962
runs-on: ubuntu-latest
963963
environment: production
964-
if: startsWith(github.ref, 'refs/tags/v')
964+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
965965
strategy:
966966
matrix:
967967
arch: [amd64, arm64]
@@ -1057,6 +1057,8 @@ jobs:
10571057
needs: [build, sign-windows, generate-notes] # add build-docker when server MVP is ready
10581058
runs-on: ubuntu-latest
10591059
environment: production
1060+
# Stable channel only: skip prerelease tags (handled by prerelease.yml)
1061+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
10601062
outputs:
10611063
# base64-encoded checksums.txt — consumed by the SLSA provenance job (WP-C3)
10621064
hashes: ${{ steps.checksums.outputs.hashes }}
@@ -1598,7 +1600,7 @@ jobs:
15981600
deploy-docs:
15991601
needs: release
16001602
runs-on: ubuntu-latest
1601-
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'smart-mcp-proxy/mcpproxy-go'
1603+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') && github.repository == 'smart-mcp-proxy/mcpproxy-go'
16021604
# Non-blocking: docs failure doesn't block release
16031605
continue-on-error: true
16041606

@@ -1643,7 +1645,7 @@ jobs:
16431645
trigger-marketing-update:
16441646
needs: release
16451647
runs-on: ubuntu-latest
1646-
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'smart-mcp-proxy/mcpproxy-go'
1648+
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') && github.repository == 'smart-mcp-proxy/mcpproxy-go'
16471649
# Non-blocking: marketing update failure doesn't block release
16481650
continue-on-error: true
16491651

0 commit comments

Comments
 (0)