feat: release automatically on merge to main - #6
Merged
Conversation
Tagging this repo was manual, and unlike commitlint it also needs the major-version alias moved on every release, since consumers pin `@v1`. That meant a force-push by hand each time, which is how v1 came to sit on a commit whose action.yml could not even be parsed. Port next-version.sh from commitlint and add a release workflow that derives the version from the merged commit, tags it, moves the `vN` alias, and publishes. Manual `v*` tag pushes still work for re-cuts, and a duplicate tag is a no-op rather than a failed run. The release job parses action.yml before advertising the release. A tag is public the moment it is pushed, and v1.0.0 shipped an action.yml that could not load, so the check guards the failure that actually happened. Both repositories are public now, so drop the private-module scaffolding: the CI self-test no longer probes module reachability or passes a token, and it runs on fork PRs. Rewrite the README's permissions and cross-repo sections to lead with the public path instead of the token fallback. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML
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.
No more hand-pushing tags. Merging a
feat/fix/perftomainnow derives the version, tags it, moves thevNalias, and publishes.Why this repo needed more than commitlint's version
commitlintonly pushes an immutable tag. An action repo also has to move the major-version alias — consumers pin@v1, so it must follow every release or it rots at whatever commit it was last moved to by hand.That manual step is exactly how
v1came to sit on a commit whoseaction.ymlcouldn't be parsed. Automating it removes the force-push from human hands entirely: the workflow does it withGITHUB_TOKEN.feat!:/BREAKING CHANGEfeat:fix:/perf:docs:/ci:/chore:…Manual
v*tag pushes still work for re-cuts; a duplicate tag is a no-op, not a failed run.Guard against the failure that actually happened
The release job parses
action.ymlbefore publishing. A tag is public the instant it's pushed, andv1.0.0shipped anaction.ymlthat could not load — so this checks the specific thing that went wrong, rather than a hypothetical.Public-repo cleanup
Both repos are public now, so the private-module scaffolding is gone:
go installpath (which gets checksum-database verification) instead of the token fallbackI verified the public path directly:
go install github.com/DivergentCodes/commitlint@v1.1.2with no token and noGOPRIVATEsucceeds and reportsv1.1.2.Verification
next-version.shported from commitlint, re-tested here:fix:→ patch,feat:→ minor,feat!:→ major,docs:/ci:→ no releasev1.0.3→v1,v2.0.0→v2,v10.4.7→v10,v1.10.0→v1actionlintclean; everyrunblock passesbash -nAfter merge
This is a
feat:, so merging cuts v1.1.0 and movesv1to it automatically — the first end-to-end proof of the pipeline.🤖 Generated with Claude Code
https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML