Skip to content

Commit 00f24c0

Browse files
committed
build: stamp updatecheck.buildChannel in single-channel pipelines (Spec 079 US2)
Dockerfile stamps buildChannel=docker; build-windows-installer.ps1 stamps buildChannel=windows-installer on both core and tray ldflags. The release.yml matrix builds intentionally stay unstamped (one binary feeds tarball + Homebrew + DMG, so any single value would be wrong for some consumers) — a comment at the ldflags site documents this. Makefile/ build.sh/build.ps1/pr-build.yml stay unstamped: dev builds use heuristics.
1 parent 6dbd93e commit 00f24c0

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ jobs:
392392
CGO_LDFLAGS: "-mmacosx-version-min=13.0"
393393
run: |
394394
VERSION=${GITHUB_REF#refs/tags/}
395+
# NOTE (Spec 079): the updatecheck.buildChannel install-channel marker is
396+
# intentionally NOT stamped here — this one matrix binary feeds the tarball,
397+
# Homebrew, and DMG artifacts, so any single channel value would be wrong for
398+
# some consumers. Those installs rely on runtime heuristics
399+
# (internal/updatecheck/channel.go); only single-channel pipelines stamp it
400+
# (Dockerfile -> docker, scripts/build-windows-installer.ps1 -> windows-installer).
395401
LDFLAGS="-s -w -X main.version=${VERSION} -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=${VERSION}"
396402
397403
# Determine clean binary name and build flags

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARG COMMIT=unknown
1919
ARG BUILD_DATE=unknown
2020
RUN CGO_ENABLED=0 go build \
2121
-tags server \
22-
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${BUILD_DATE} -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=${VERSION} -s -w" \
22+
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${BUILD_DATE} -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=${VERSION} -X github.com/smart-mcp-proxy/mcpproxy-go/internal/updatecheck.buildChannel=docker -s -w" \
2323
-o /mcpproxy ./cmd/mcpproxy
2424

2525
# Runtime stage

scripts/build-windows-installer.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Write-Host " Building mcpproxy.exe..." -ForegroundColor White
4848
$env:CGO_ENABLED = "0"
4949
$CoreBinary = Join-Path $BinDir "mcpproxy.exe"
5050
$CoreCmd = Join-Path $RepoRoot "cmd/mcpproxy"
51-
go build -buildvcs=false -ldflags "-s -w -X main.version=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=$Version" -o $CoreBinary $CoreCmd
51+
go build -buildvcs=false -ldflags "-s -w -X main.version=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/updatecheck.buildChannel=windows-installer" -o $CoreBinary $CoreCmd
5252

5353
if ($LASTEXITCODE -ne 0) {
5454
Write-Host " Failed to build mcpproxy.exe" -ForegroundColor Red
@@ -61,7 +61,7 @@ Write-Host " Building mcpproxy-tray.exe..." -ForegroundColor White
6161
$env:CGO_ENABLED = "1"
6262
$TrayBinary = Join-Path $BinDir "mcpproxy-tray.exe"
6363
$TrayCmd = Join-Path $RepoRoot "cmd/mcpproxy-tray"
64-
go build -buildvcs=false -ldflags "-s -w -X main.version=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=$Version -H windowsgui" -o $TrayBinary $TrayCmd
64+
go build -buildvcs=false -ldflags "-s -w -X main.version=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/httpapi.buildVersion=$Version -X github.com/smart-mcp-proxy/mcpproxy-go/internal/updatecheck.buildChannel=windows-installer -H windowsgui" -o $TrayBinary $TrayCmd
6565

6666
if ($LASTEXITCODE -ne 0) {
6767
Write-Host " Failed to build mcpproxy-tray.exe" -ForegroundColor Red

0 commit comments

Comments
 (0)