Repository navigation
Automate npm releases with trusted publishing - #1103
Merged
Merged
Conversation
- Add a release workflow that publishes to npm (with provenance via OIDC) when the version in package.json on main is not on the registry yet, then creates the vX.Y.Z GitHub release. - Point repository, bugs and homepage URLs at learn-tamil/script, which npm provenance verification requires. - Add CLAUDE.md describing how an agent cuts a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SUZwZNHq5MTwxkdGyJg6Sn
Merged
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.
Lets an agent (or anyone) release a new version by merging a version-bump PR, with no npm token stored anywhere.
Changes
.github/workflows/release.yml: runs on pushes tomainthat touchpackage.json(and manually viaworkflow_dispatch). If the version inpackage.jsonisn't on npm yet, it installs, runs the tests, publishes withnpm publish --provenance --access public(authenticated via npm trusted publishing / OIDC) and creates thevX.Y.ZGitHub release with generated notes. Otherwise it does nothing, so dependency bumps don't publish anything.package.json:repository,bugsandhomepagenow point atlearn-tamil/scriptinstead oflearn-tamil/tamil-script. npm rejects provenance whenrepository.urldoesn't match the publishing repo.CLAUDE.md: the release recipe for agents. Bump withnpm version <level> --no-git-tag-version, open aRelease X.Y.ZPR, merge when green, then verify the workflow run and the GitHub release.Required before the first release
On npmjs.com, open the
@learn-tamil/scriptsettings, go to Trusted Publisher, choose GitHub Actions, and enter organizationlearn-tamil, repositoryscript, workflowrelease.yml.Testing
actionlintand Prettier pass on the new files.pnpm test,pnpm eslintandtsc --noEmitpass.npm pack --dry-runbuildslib/throughprepackas expected.0.8.0is found and0.8.1is not. Merging this PR therefore runs the workflow, which skips because 0.8.0 is already published.🤖 Generated with Claude Code
https://claude.ai/code/session_01SUZwZNHq5MTwxkdGyJg6Sn
Generated by Claude Code