ci: auto-publish + tag + GH release workflow#11
Merged
Conversation
Triggers on push to main (after every PR merge) and on manual workflow_dispatch (with optional dry_run). For each packages/<name>/package.json, compares the declared version against the `<name>@<version>` git tag: - already tagged → skip - tag missing but the version exists on npm → backfill tag + GH release only (no publish) - tag and npm both missing → npm publish + git tag + GH release Release notes are extracted from the top section of CHANGELOG.md. GitHub release target is the workflow's HEAD commit. Required secret: NPM_TOKEN (Settings → Secrets and variables → Actions). GITHUB_TOKEN is provided by default and is used to push tags + create releases (permissions: contents: write). Doesn't loop: workflow pushes tags only, not commits to main. 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
Adds
.github/workflows/release.yml. Triggers on every push tomain(after PR merge) and on manualworkflow_dispatch. For eachpackages/<name>/package.json, compares declared version against the<name>@<version>git tag:<scoped>@<version>exists on npmnpm publish+ push tag + create GitHub releaseRelease notes auto-extracted from the top section of
CHANGELOG.md. Manual dispatch supportsdry_run=trueto preview without publishing.The workflow only pushes tags, not commits to
main, so it doesn't loop on itself.Required setup (one-time, after merge)
Add a repository secret
NPM_TOKEN:NPM_TOKENGITHUB_TOKENis auto-injected and is used to push tags + create releases (workflow declarespermissions: contents: write).Permissions / safety
permissions: contents: write— needed togit pushtags +gh release createid-token: write— kept for future npm provenance via OIDC; not used yet0 published.Backfilled tags (already pushed in this session, not part of this PR)
15 historical tags pushed directly to
origincovering 0.3.x and 0.4.x for all packages. So when this workflow first runs after merge, it will skip everything (all already tagged). It only kicks in on the next version bump.Test plan
bun run buildpasses locallydry_run=trueto verify "skip everything, nothing to publish" outputpackages/*/package.jsonversion): merge it and watch the workflow auto-publish + tag🤖 Generated with Claude Code