You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address review findings for release workflow correctness
## What
Moved tag creation into create_release job, removed update_major_tag job
and its input, added GoReleaser config validation via yq to enforce
release.disable: true, fixed -f to -F for boolean in publish_release,
made go-version-file configurable, made upload globs resilient with
nullglob, consolidated discussion validation into a single input check,
and pinned release_image checkout to the tagged commit.
## Why
The draft-first pattern changed when git tags are created, but downstream
jobs hadn't been updated to account for that. Multiple review agents
independently identified race conditions, a silent publish failure, and
fragile assumptions that needed fixing before this is mergeable.
## Notes
- Removing the `update-major-tag` input is a breaking change for callers
that explicitly set it — major tag is now always pushed in create_release
- The yq install adds a step to the GoReleaser job; mikefarah/yq action
is SHA-pinned but is a new third-party dependency
- GoReleaser config validation only checks `release.disable` not
`changelog.disable` — the latter is recommended but not enforced since
it won't cause conflicts
Signed-off-by: jmeridth <jmeridth@gmail.com>
echo "::error::GoReleaser config must have 'release: disable: true' to prevent conflicting with the draft release created by this workflow. See https://github.com/github-community-projects/ospo-reusable-workflows/blob/main/docs/release.md#goreleaser-configuration"
Copy file name to clipboardExpand all lines: docs/release.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,13 @@ Consolidated release workflow that creates a draft release, optionally builds ar
20
20
# The name of the configuration file to use
21
21
# from the release-drafter/release-drafter GitHub Action
22
22
release-config-name: release-drafter.yml
23
-
# Boolean flag whether to update major tag to latest full semver tag, default is true
24
-
update-major-tag: true
25
23
26
24
# --- Optional: GoReleaser build/upload ---
27
25
# Setting goreleaser-config-path enables the GoReleaser job
28
26
# Path to GoReleaser config file (e.g., .goreleaser.yaml)
29
27
goreleaser-config-path: .goreleaser.yaml
28
+
# Path to go.mod or go.work file for Go version detection, default is go.mod
29
+
go-version-file: go.mod
30
30
31
31
# --- Optional: Docker image build/push ---
32
32
# Setting image-name enables the image build/push job
@@ -78,12 +78,25 @@ jobs:
78
78
79
79
The workflow runs up to six jobs:
80
80
81
-
1. **create_release** - Always runs. Creates a draft release via release-drafter.
82
-
2. **update_major_tag** - Runs when `update-major-tag` is true. Force-updates the major version tag.
83
-
3. **release_goreleaser** - Runs when `goreleaser-config-path` is set. Builds Go binaries, uploads artifacts to the draft release, and optionally creates attestations.
84
-
4. **release_image** - Runs when `image-name` is set. Builds and pushes a multi-platform Docker image, and optionally creates attestations.
85
-
5. **release_discussion** - Runs when both `discussion-category-id` and `discussion-repository-id` secrets are set. Creates a GitHub Discussions announcement.
86
-
6. **publish_release** - Runs when `publish` is true and all preceding jobs succeed (or are skipped). Publishes the draft release.
81
+
1. **create_release** - Always runs. Creates a draft release via release-drafter, then creates and pushes the full and major version git tags.
82
+
2. **release_goreleaser** - Runs when `goreleaser-config-path` is set. Builds Go binaries, uploads artifacts to the draft release, and optionally creates attestations.
83
+
3. **release_image** - Runs when `image-name` is set. Builds and pushes a multi-platform Docker image, and optionally creates attestations.
84
+
4. **release_discussion** - Runs when both `discussion-category-id` and `discussion-repository-id` secrets are set. Creates a GitHub Discussions announcement.
85
+
5. **publish_release** - Runs when `publish` is true and all preceding jobs succeed (or are skipped). Publishes the draft release.
86
+
87
+
## GoReleaser Configuration
88
+
89
+
When using the `goreleaser-config-path` input, your GoReleaser config **must** disable release and changelog management since this workflow handles both via release-drafter:
90
+
91
+
```yaml
92
+
release:
93
+
disable: true
94
+
95
+
changelog:
96
+
disable: true
97
+
```
98
+
99
+
Without these settings, GoReleaser will attempt to create its own GitHub release, conflicting with the draft release created by release-drafter.
0 commit comments