Skip to content

Commit 493adcb

Browse files
committed
ci(release): run templ generate before go build
The internal/web/templates/*_templ.go files are gitignored, so every clean checkout starts without them. ci.yml already installs the templ CLI and runs `templ generate` via its `pre-build-cmd`, but release.yml only runs `bun run build:assets` (conditional on package.json, which this Go-only repo does not ship). That left the release binary builds compiling against the gitignored gap and failing with `internal/web/templates/palette_helpers.go:9:26: undefined: PinnedEntry` (and the other v2 view-model types declared inside .templ sources). Add the install + generate commands to release.yml's pre-build-command so release binaries compile, and record the drift in template.yaml alongside the existing ci.yml entry. Fixes the failing v1.3.0 release binary matrix; next tag will produce artifacts + the container image. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent fa34dac commit 493adcb

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/template.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,14 @@ intentional-drift:
2525
any unrelated PR. Also adds scripts/vendor.lock to dependencies so vendor
2626
refreshes (Pico, htmx, Alpine CSP build pinned via scripts/vendor.sh)
2727
route to the dependencies label."
28+
- path: .github/workflows/release.yml
29+
reason: "Templ code must be generated before `go build`. The
30+
`internal/web/templates/*_templ.go` files are gitignored, so a clean
31+
release checkout has none of them and compilation fails with
32+
`undefined: PinnedEntry` etc. The go-app template's
33+
`pre-build-command` only runs `bun run build:assets` when
34+
package.json is present; this repo is Go-only (no package.json —
35+
see the labeler drift entry above). Adds
36+
`go install github.com/a-h/templ/cmd/templ@latest && templ generate`
37+
to the pre-build-command so release binaries compile, mirroring
38+
ci.yml's existing `pre-build-cmd`."

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ jobs:
100100
bun install --frozen-lockfile
101101
bun run build:assets
102102
fi
103+
# Generate Templ-backed Go code. The *_templ.go files are
104+
# gitignored (internal/web/templates/.gitignore) so a clean
105+
# checkout has none of them — go build would fail to resolve
106+
# types declared inside .templ sources. Mirrors ci.yml's
107+
# `pre-build-cmd`.
108+
go install github.com/a-h/templ/cmd/templ@latest
109+
templ generate
103110
104111
container:
105112
name: Build container image

0 commit comments

Comments
 (0)