Repository navigation
Commit c9ffd94
authored
🤖 fix: render GoReleaser channel templates when GORELEASER_CHANNEL is unset (#138)
## What broke
The v0.1.1 release build
([run](https://github.com/coder/coder-k8s/actions/runs/36110595919))
failed before publishing anything:
```
template: failed to apply "{{ eq .Env.GORELEASER_CHANNEL \"main\" }}": map has no entry for key "GORELEASER_CHANNEL"
```
`release.yaml` never sets `GORELEASER_CHANNEL`, and GoReleaser rejects a
template that reads a missing `.Env` key. The changelog template already
used `index .Env`; the `release.disable` and both `dockers_v2` `disable`
templates did not. No binaries, archives or images were published for
v0.1.1.
## Fix
- `.goreleaser.yaml`: read the channel with `index .Env
"GORELEASER_CHANNEL"` in all three templates.
- `.github/workflows/release.yaml`: set `GORELEASER_CHANNEL: release`
explicitly.
- `hack/main_publish_test.go`: `TestReleaseAndImageChannels` renders the
release and both `dockers_v2` disable templates with `missingkey=error`
for the `main`, empty, `release` and unset channels, and checks which
pipes run on each (release and the release image off only on `main`; the
`:main` image on only on `main`).
## Validation
- The new test fails on the v0.1.1 config with the same `map has no
entry` error, and passes on this PR.
- `make verify-vendor`, `make build`, `make lint`, `make test` and
actionlint pass.
- A local `goreleaser release --clean --skip=announce,publish` cannot
reproduce the failure: the release and image pipes it fails in are
skipped when publishing is skipped. The unit test is the gate for those
templates. The real check is the next release run.

Terminal recording (vhs capture; timing approximate):
https://github.com/user-attachments/assets/8c3c135a-cf06-4b60-b457-3610cc7daffa
## After this lands
Cut v0.1.2 from `main`. The v0.1.1 tag stays: its source already
contains #136, but it has no release artifacts.
---
_Generated with [`xum`](https://github.com/coder/xum) • Model:
`anthropic:claude-opus-5-5` • Thinking: `medium` • Cost: `$1754.57`_1 parent 78a2eca commit c9ffd94
3 files changed
Lines changed: 65 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
54 | 115 | | |
55 | 116 | | |
56 | 117 | | |
| |||
0 commit comments