Skip to content

Commit 6e8d9eb

Browse files
wesmclaude
andcommitted
Simplify Windows build: use default toolchain like go-duckdb CI
Remove MSYS2/MinGW setup and use the default gcc on windows-latest with bash shell, matching go-duckdb's own CI approach. MinGW's ld/libstdc++ was incompatible with DuckDB's prebuilt static library. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c467c0a commit 6e8d9eb

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -142,47 +142,39 @@ jobs:
142142

143143
build-windows:
144144
runs-on: windows-latest
145+
defaults:
146+
run:
147+
shell: bash
145148
steps:
146149
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
147150

148151
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
149152
with:
150153
go-version-file: go.mod
151154

152-
- name: Set up MinGW
153-
id: msys2
154-
uses: msys2/setup-msys2@4f806de0a5a7294ffabaff804b38a9b435a73bda # v2.30.0
155-
with:
156-
msystem: MINGW64
157-
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-lld
158-
159155
- name: Build
160-
shell: pwsh
161156
env:
162157
GOOS: windows
163158
GOARCH: amd64
164159
CGO_ENABLED: '1'
165-
CC: ${{ steps.msys2.outputs.msys2-location }}\mingw64\bin\gcc.exe
166160
run: |
167-
$VERSION = "${{ github.ref_name }}".TrimStart("v")
161+
VERSION="${GITHUB_REF#refs/tags/v}"
168162
169-
New-Item -ItemType Directory -Force -Path dist | Out-Null
170-
$LDFLAGS = "-s -w -X github.com/wesm/msgvault/cmd/msgvault/cmd.Version=v${VERSION} -extldflags '-fuse-ld=lld'"
163+
mkdir -p dist
164+
LDFLAGS="-s -w -X github.com/wesm/msgvault/cmd/msgvault/cmd.Version=v${VERSION}"
171165
go build -tags fts5 -trimpath -ldflags="$LDFLAGS" -o dist/msgvault.exe ./cmd/msgvault
172-
if ($LASTEXITCODE -ne 0) { throw "Build failed" }
173166
174-
# Smoke test — check exit code explicitly, then verify version string
175-
Write-Host "--- Smoke test ---"
176-
& dist/msgvault.exe version 2>&1 | Tee-Object -Variable SMOKE_OUT | Out-Null
177-
if ($LASTEXITCODE -ne 0) { throw "FATAL: msgvault.exe version exited with code $LASTEXITCODE" }
178-
$SMOKE_OUT = $SMOKE_OUT | Out-String
179-
Write-Host $SMOKE_OUT
180-
if ($SMOKE_OUT -notmatch "v${VERSION}") { throw "FATAL: version output doesn't match tag" }
167+
# Smoke test
168+
echo "--- Smoke test ---"
169+
SMOKE_OUT=$(dist/msgvault.exe version 2>&1)
170+
echo "$SMOKE_OUT"
171+
echo "$SMOKE_OUT" | grep -q "v${VERSION}" || { echo "FATAL: version output doesn't match tag"; exit 1; }
181172
182173
# Package as zip
183-
$ARCHIVE = "msgvault_${VERSION}_windows_amd64.zip"
184-
Compress-Archive -Path dist/msgvault.exe -DestinationPath "dist/$ARCHIVE"
185-
Remove-Item dist/msgvault.exe
174+
ARCHIVE="msgvault_${VERSION}_windows_amd64.zip"
175+
cd dist
176+
powershell -Command "Compress-Archive -Path msgvault.exe -DestinationPath '$ARCHIVE'"
177+
rm msgvault.exe
186178
187179
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
188180
with:

0 commit comments

Comments
 (0)