Skip to content

feat: release automatically on merge to main - #6

Merged
SafeEval merged 1 commit into
mainfrom
agent/auto-release
Jul 30, 2026
Merged

feat: release automatically on merge to main#6
SafeEval merged 1 commit into
mainfrom
agent/auto-release

Conversation

@SafeEval

Copy link
Copy Markdown
Member

No more hand-pushing tags. Merging a feat/fix/perf to main now derives the version, tags it, moves the vN alias, and publishes.

Why this repo needed more than commitlint's version

commitlint only 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 v1 came to sit on a commit whose action.yml couldn't be parsed. Automating it removes the force-push from human hands entirely: the workflow does it with GITHUB_TOKEN.

Merged commit Bump
feat!: / BREAKING CHANGE major
feat: minor
fix: / perf: patch
docs: / ci: / chore: none

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.yml before publishing. A tag is public the instant it's pushed, and v1.0.0 shipped an action.yml that 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:

  • CI's self-test no longer probes module reachability or passes a token, and runs on fork PRs
  • README's permissions section leads with the public go install path (which gets checksum-database verification) instead of the token fallback
  • The org-setup section — org secrets, cross-repo access — is replaced with "paste the workflow, it works"

I verified the public path directly: go install github.com/DivergentCodes/commitlint@v1.1.2 with no token and no GOPRIVATE succeeds and reports v1.1.2.

Verification

  • next-version.sh ported from commitlint, re-tested here: fix: → patch, feat: → minor, feat!: → major, docs:/ci: → no release
  • Major-alias derivation checked including double digits: v1.0.3v1, v2.0.0v2, v10.4.7v10, v1.10.0v1
  • All three YAML files parse; actionlint clean; every run block passes bash -n
  • Pin guard still passes

After merge

This is a feat:, so merging cuts v1.1.0 and moves v1 to it automatically — the first end-to-end proof of the pipeline.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML

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
@SafeEval
SafeEval marked this pull request as ready for review July 30, 2026 20:38
@SafeEval
SafeEval merged commit 202ec09 into main Jul 30, 2026
2 checks passed
@SafeEval
SafeEval deleted the agent/auto-release branch July 30, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant