Skip to content

Release on merge to main, publish to npm on each GitHub release - #6

Merged
asveloper merged 1 commit into
developfrom
chore/release-on-main
Nov 22, 2026
Merged

asveloper merged 1 commit into
developfrom
chore/release-on-main

Conversation

@asveloper

Copy link
Copy Markdown
Contributor

How releases work now:

  1. Bump the version in package.json and src/version.ts and add its CHANGELOG.md section (in the PR, as before).
  2. Merge develop into main. release.yml creates the GitHub release vX.Y.Z with that changelog section as notes. If the release already exists (no version bump), it does nothing.
  3. publish.yml publishes the same version to npm with trusted publishing. It runs when release.yml starts it, or when a release is published by hand on GitHub. It checks that the release tag matches package.json and skips a version that's already on npm.

So the GitHub release and the npm version always match.

  • release.yml starts publish.yml with workflow_dispatch, because a release created with the workflow token doesn't trigger other workflows.
  • publish.yml keeps its file name, so the npm trusted publisher entry (workflow publish.yml) still applies.
  • The tag-push trigger is gone; CONTRIBUTING.md describes the new steps.

The existing v0.2.1 tag has no release and isn't on npm; after this reaches main, release.yml creates the v0.2.1 release and publishes it.

How releases work now:

1. Bump the version in package.json and src/version.ts and add its CHANGELOG.md section (in the PR, as before).
2. Merge develop into main. release.yml creates the GitHub release vX.Y.Z with that changelog section as notes. If the release already exists (no version bump), it does nothing.
3. publish.yml publishes the same version to npm with trusted publishing. It runs when release.yml starts it, or when a release is published by hand on GitHub. It checks that the release tag matches package.json and skips a version that's already on npm.

So the GitHub release and the npm version always match.

- release.yml starts publish.yml with workflow_dispatch, because a release created with the workflow token doesn't trigger other workflows.
- publish.yml keeps its file name, so the npm trusted publisher entry (workflow publish.yml) still applies.
- The tag-push trigger is gone; CONTRIBUTING.md describes the new steps.

The existing v0.2.1 tag has no release and isn't on npm; after this reaches main, release.yml creates the v0.2.1 release and publishes it.
@asveloper
asveloper merged commit 35f1114 into develop Nov 22, 2026
5 checks passed
@asveloper
asveloper deleted the chore/release-on-main branch November 22, 2026 07:10
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