Skip to content

ci: trigger npm publish automatically after a release - #29

Merged
jinzcdev merged 1 commit into
mainfrom
ci/auto-publish-on-release
Nov 5, 2026
Merged

jinzcdev merged 1 commit into
mainfrom
ci/auto-publish-on-release

Conversation

@jinzcdev

@jinzcdev jinzcdev commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • After create-tag creates the GitHub Release, dispatch npm-publish.yml for the new tag
  • Add actions: write to the create-tag job so GITHUB_TOKEN can dispatch workflows
  • Retry the dispatch up to 5 times in case the new tag is not yet resolvable
  • Run the tag/package version check whenever npm-publish runs on a v* tag (release event or dispatch)

Why

Release events created with GITHUB_TOKEN do not trigger other workflows, which is why every release so far required a manual publish. workflow_dispatch is an explicit exception: it always creates a run, even when authenticated with GITHUB_TOKEN. No PAT or additional npm trusted publisher is needed.

Resulting flow

  1. Run Prepare Release → release PR is opened
  2. Merge the release/vX.Y.Z PR
  3. create-tag creates the tag + GitHub Release and dispatches npm-publish.yml on that tag
  4. npm-publish authenticates via OIDC and publishes with provenance

The next release will validate the end-to-end flow.

🤖 Generated with Claude Code

Release events created by GITHUB_TOKEN do not start other workflows, so
the create-tag job now dispatches npm-publish.yml explicitly. Unlike
other events, workflow_dispatch always creates a run even when triggered
with GITHUB_TOKEN, so no PAT is needed.

Also run the version/tag check when npm-publish is dispatched on a tag.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@jinzcdev
jinzcdev merged commit 05bac95 into main Nov 5, 2026
1 check passed
@jinzcdev
jinzcdev deleted the ci/auto-publish-on-release branch November 5, 2026 08:14
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