From abd4ccaeb9d07b05800c1e9735f37d3f800fbef5 Mon Sep 17 00:00:00 2001 From: Jeffery Lofoneh Asamani Date: Wed, 9 Sep 2026 09:13:23 +0000 Subject: [PATCH] ci: build the windows targets goreleaser already ships MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .goreleaser.yaml releases linux, darwin and windows on amd64 and arm64, but the CI build matrix and scripts/gate.sh both stopped at linux and darwin. A Windows-breaking change was therefore only discoverable at tag time, by the release job — the same "green somewhere else hid a break" failure mode gate.sh exists to prevent. Cross-compiling costs one more job. Also ignore /pgbot.exe: `go build ./cmd/pgbot` in the repo root emits pgbot.exe on Windows, which /pgbot does not match, so every Windows contributor starts with a dirty tree — and gate.sh refuses to gate a dirty tree. --- .github/workflows/ci.yml | 4 +++- .gitignore | 1 + CONTRIBUTING.md | 5 +++-- scripts/gate.sh | 5 +++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 891e539..36aa5bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,8 +150,10 @@ jobs: name: build ${{ matrix.goos }}/${{ matrix.goarch }} runs-on: ubuntu-latest strategy: + # Every target .goreleaser.yaml ships — a release must not be the first + # thing that compiles a platform. matrix: - goos: [linux, darwin] + goos: [linux, darwin, windows] goarch: [amd64, arm64] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.gitignore b/.gitignore index 48f084e..66ff4b0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.db-shm pgrun_metrcis2.mp4 /pgbot +/pgbot.exe # npm packaging build output (assembled by npm/build.mjs) npm/staging/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6088e0f..bec03b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,8 +12,9 @@ scripts/gate.sh # the real gate — builds HEAD, not your working ``` `scripts/gate.sh` refuses a dirty tree, then builds and tests the committed HEAD -in an isolated clone across four arches. Run it before pushing — a green -working-tree `go test` can hide a partial commit that doesn't compile. +in an isolated clone across every released target (linux, darwin and windows × +amd64, arm64). Run it before pushing — a green working-tree `go test` can hide a +partial commit that doesn't compile. Integration tests run against a real database when `PGBOT_TEST_DSN` (a superuser DSN unlocks the doc-verify guard via `PGBOT_TEST_SUPERUSER_DSN`) is set: diff --git a/scripts/gate.sh b/scripts/gate.sh index 67244d0..ae94d16 100755 --- a/scripts/gate.sh +++ b/scripts/gate.sh @@ -36,13 +36,14 @@ command -v golangci-lint >/dev/null || { } golangci-lint run ./... CGO_ENABLED=0 go test ./... -for goos in linux darwin; do +# Every target .goreleaser.yaml ships, windows included. +for goos in linux darwin windows; do for goarch in amd64 arm64; do CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build -o /dev/null ./cmd/pgbot done done popd >/dev/null -echo "✓ HEAD builds, vets, and tests clean (4 arches)" +echo "✓ HEAD builds, vets, and tests clean (6 targets)" # (3) "Green" must mean CI, not just local — surface the latest main conclusion. if command -v gh >/dev/null 2>&1; then