make: release workflow — notes, GH release, dry-run fixes#19
Merged
Conversation
Why:
- release-dry-run was broken on stdlib-only modules (cascade has no
go.sum) and from stat-cache staleness after `go mod tidy` bumps
mtime without changing content. `git status --porcelain` tolerates
both: handles missing paths cleanly and is status-aware.
- VERSION as a CLI argument was typo-prone and could mismatch the
embedded VERSION file. Reading from the file with `override` locks
the source of truth and prevents accidental override.
- After tagging, the maintainer had to manually create each GH release.
Auto-create via `gh release create --notes-file …` when a release
notes file is present.
- Releasing from a dirty tree embeds `-dirty` in the build metadata,
invalidating the tag's reproducibility. Refuse on dirty tree.
What:
- Bug fixes:
- release-dry-run: use `git status --porcelain` instead of
`git diff --quiet go.mod go.sum` (closes the stdlib-only failure
and the stat-cache flap)
- VERSION: `override` + `:=` from internal/project/VERSION
- New targets:
- `$(WORKBENCH)` — `mkdir -p ./workbench`
- `release-notes` — generates a placeholder at
$(WORKBENCH)/release-notes-$(VERSION).md (no overwrite if exists)
- Updated `release-dry-run`: reports presence/absence of the release
notes file with the corresponding "will be used" / "won't auto-
create GH release" guidance.
- Updated `release`:
- target-specific VERS = v$(VERSION); used everywhere a tag string
is needed
- VERSION-unknown guard
- working-tree-clean refusal (new, via `git status --porcelain`)
- tag-exists guard
- after tag push: `gh release create` if RELEASE_NOTES exists, else
a clear "skipping GH release" notice
- Help: lists `make release-notes` and the updated `make release`
description.
Note: workbench/ is gitignored, so the generated release notes file
lives only on the maintainer's machine + on the GH release page. The
dirty-tree check correctly ignores the gitignored draft.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the
make release*workflow with three bug fixes and one new feature, all surfaced while preparing the v0.1.3 release.make release-dry-runwas broken on cascade's stdlib-only module —git diff --quiet go.mod go.sumerrors withfatal: go.sum: no such pathbecause cascade has no third-party deps, and is also fooled by stat-cache staleness aftergo mod tidybumpsgo.mod's mtime without changing content. Switched togit status --porcelainwhich handles both.VERSIONas a CLI argument (make release VERSION=v0.1.0) was typo-prone and could mismatch the embeddedinternal/project/VERSIONfile. Now read from the file withoverride, so the source of truth is committed and CLI overrides are rejected.make releasenow refuses on a dirty working tree — otherwise the build metadata embedded in the tagged binary would carry a-dirtysuffix, invalidating the tag's reproducibility.make release-notestarget generates a placeholder at./workbench/release-notes-$(VERSION).md, andmake releasenow auto-creates a GitHub release with those notes viagh release create --notes-file …after tagging.Diff scope
1 file (Makefile), +87 / −27 across 2 commits:
8f268f7 Fixed formatting.— banner spacing + moved the release banner above the version-check block (previous work)ce08ed1 make: release workflow — notes, GH release, dry-run fixes— this PR's substantive workWhat's new in detail
Top-of-file vars (after
GIT_REMOTES)Plus
override VERSION := …at line 17.New targets
$(WORKBENCH)—mkdir -p ./workbenchrelease-notes: $(WORKBENCH)— generates a placeholder markdown file withOverview,Details, andChange Logsections, plus a GitHub compare link from the last tag to the current VERSION. Refuses to overwrite an existing file.Generated content for VERSION=0.1.3, last tag v0.1.2:
Updated
release-dry-runAfter the tidy check, reports release-notes status:
✓ Release notes found … will be used to auto-create a GitHub release during 'make release'⚠ No release notes at … 'make release' will only push the tag — no GitHub release will be created. Run 'make release-notes' to generate a placeholder if you want one.Updated
releaseIn order:
v$(VERSION)doesn't already exist (existing)release-dry-run(tidy + lint + test + release build)GIT_REMOTESgh release create $(VERS) --notes-file $(RELEASE_NOTES) --title "Release $(VERS)"if the notes file exists; clear "skipping" notice if not.Help text
Design note:
workbench/is gitignoredGenerated release notes live in
./workbench/, which is in.gitignore. That means:make releasecorrectly ignores generated notes.If you'd rather have them tracked, options are: (1) add
!workbench/release-notes-*.mdto.gitignore, or (2) move them todocs/release-notes/. Current implementation matches the existing "workbench is local scratch" convention and the audit prompt's "out of scope" note.Test plan
make helpshows the newrelease-notesentry and updatedreleasedescriptionmake release-dry-run(no notes file) — reports "⚠ No release notes" with themake release-noteshint; build + lint + test all greenmake release-notes— generates./workbench/release-notes-0.1.3.mdwith the expected formatmake release-notes(file exists) — refuses to overwrite, exits 0 with a warningmake release-dry-run(notes file exists) — reports "✓ Release notes found … will be used"make -n release— recipe parses cleanly through the newgh release createblock and the no-notes fallbackmake releaserefused withM Makefileafter the audit-doc commit)make release(deferred until a clean tree + the user is ready to tag v0.1.3)Followup
Once this lands, the v0.1.3 tag is unblocked. Suggested workflow:
🤖 Generated with Claude Code