Skip to content

ci: release automatically when the package.json version changes on main - #461

Merged
gjbkz merged 1 commit into
mainfrom
ci/c27-automatic-version-release
Oct 11, 2026
Merged

gjbkz merged 1 commit into
mainfrom
ci/c27-automatic-version-release

Conversation

@gjbkz

@gjbkz gjbkz commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Changes

Automate releases when the version in package.json changes on main and its corresponding tag does not exist. The workflow starts on pushes to main that change package.json, or through workflow_dispatch. If the v<version> tag already exists, subsequent release steps are skipped.

When the tag is missing, the workflow builds the package and skips npm submission if the same version is already published. Otherwise, it submits the package using npm stage publish, which requires a maintainer's approval on npmjs.com. The GitHub Release is created before that approval, so its creation and the package becoming available on npm occur at different times.

After the Release job succeeds, PublishJsr runs unless an existing tag caused the release to be skipped. The workflow implements the supplied YAML exactly, including these job conditions. Release notes are extracted from the matching ## v<version> section of CHANGELOG.md.

The workflow filename remains release.yml, with no environment configured. Node 26.x, npm 11.21.0, Trusted Publishing, and --provenance are preserved.

Validation

  • npx --yes @action-validator/cli .github/workflows/release.yml passed, with only a warning that glob validation for paths is not supported.
  • The only changed file is .github/workflows/release.yml.
  • No releases, tags, or npm/JSR publications were created during implementation.
  • GitHub Actions CI passed: lint, build, Node, Bun, Deno, and the JSR publishing dry run.

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (81cadbd) to head (8c48975).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #461   +/-   ##
=======================================
  Coverage   98.46%   98.46%           
=======================================
  Files          52       52           
  Lines        3057     3057           
  Branches      327      327           
=======================================
  Hits         3010     3010           
  Misses         46       46           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gjbkz gjbkz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 8c48975. No blocking issues.

  • .github/workflows/release.yml matches the agreed design byte for byte. It keeps Node 26.x and npm stage publish --provenance. PublishJsr runs only when the Release job published, through needs.Release.outputs.released.
  • The file name stays release.yml and there is no environment, matching the Trusted Publisher registration.
  • Merging this PR does not trigger a release: the PR doesn't touch package.json, and v4.0.2 already exists.
  • No docs/tasks/ files. All CI checks are green.

Known limitation, not blocking: if npm stage publish succeeds but gh release create fails, a re-run tries to stage the same version again, and PublishJsr is skipped because that job failed. Create the Release and run npx jsr publish by hand in that case.


Generated by Claude Code

@gjbkz
gjbkz marked this pull request as ready for review October 11, 2026 22:56
@gjbkz
gjbkz merged commit 15c296e into main Oct 11, 2026
8 checks passed
@gjbkz
gjbkz deleted the ci/c27-automatic-version-release branch October 11, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant