Skip to content

ci: publish to npm on main when package.json version changes - #4

Merged
venespana merged 1 commit into
mainfrom
ci/publish-on-main-merge
Sep 24, 2026
Merged

venespana merged 1 commit into
mainfrom
ci/publish-on-main-merge

Conversation

@venespana

Copy link
Copy Markdown
Owner

Fixes #3

Summary

  • Release workflow now triggers on every push to main (plus manual workflow_dispatch) instead of a published GitHub Release.
  • The version to publish comes only from package.json; the workflow checks the registry and publishes just when that version is new. No-bump merges skip install/build/test entirely.
  • File name, OIDC trusted-publishing permissions, and the release.yml Trusted Publisher binding stay untouched.

Changes

File Change
.github/workflows/release.yml New trigger, registry version check, conditional publish, removed tag-to-version step

Verification

  • YAML parses (yaml.safe_load)
  • pnpm test passes, pnpm lint passes, pnpm build passes (same steps the job runs)
  • First run on main publishes 0.2.0 (expected on merge — version is already bumped in package.json)

Replace the manual GitHub-release-driven publish with a push-to-main
trigger. The workflow resolves the version from package.json, checks the
registry, and publishes only when that version is new, so merges without
a version bump are cheap no-ops. Version-from-tag step is removed:
package.json is now the single source of truth for releases.
@venespana venespana added the type:chore Maintenance/tooling PR label Sep 24, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@venespana
venespana merged commit 917bf07 into main Sep 24, 2026
1 check passed
@venespana
venespana deleted the ci/publish-on-main-merge branch September 24, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:chore Maintenance/tooling PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish to npm automatically on merge to main, driven by package.json

2 participants