ci: automate releases with release-please, OIDC publish and PR-title lint#5
Merged
Conversation
…lint Mirror the node-cron release setup, adapted to this repo: - release-please maintains a release PR (version + CHANGELOG) from Conventional Commits on master; merging it tags vX.Y.Z, creates the GitHub Release and calls the publish workflow. - publish.yml replaces release.yml: OIDC trusted publishing (no NPM_TOKEN), triggered both manually (workflow_dispatch) and automatically by release-please (workflow_call). - pr-title-lint enforces Conventional Commit PR titles (squash-merge). - include-component-in-tag=false so tags are vX.Y.Z. - Bootstrap: manifest baseline is 1.0.0 (the published version); release-as 2.0.0 forces the first release to cut the unpublished rewrite as 2.0.0.
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.
Brings the node-cron release automation to this repo, adapted to its specifics.
What's added
release-please.yml): on push tomaster, maintains a rolling release PR (version +CHANGELOG.md) from Conventional Commits. Merging it tagsvX.Y.Z, creates the GitHub Release, then calls the publish workflow.publish.yml, replacesrelease.yml): trusted publishing with provenance, noNPM_TOKEN. Runs both manually (workflow_dispatch, with dist-tag choice) and automatically viaworkflow_callfrom release-please.pr-title-lint.yml): enforces Conventional Commit PR titles (since PRs are squash-merged).include-component-in-tag: falseso tags arevX.Y.Z(notcron-translate-vX.Y.Z).Adapted to this repo (vs node-cron)
master(the default branch here), notmain.npm ci+typecheck+test:coverageand--access public, matching the oldrelease.yml.Bootstrap: the 1.0.0 → 2.0.0 situation
npm has 1.0.0, but
masterholds an unpublished 2.0.0 rewrite, and there are no git tags. The commits are not Conventional, so release-please cannot infer the version. So:1.0.0(the published version).release-as: 2.0.0forces the first release PR to cut 2.0.0.Important
Two manual steps are required:
cron-translateon npmjs.com, workflow filepublish.yml— otherwise the OIDC publish fails. (This replaces theNPM_TOKENsecret, which can be deleted afterwards.)release-as: 2.0.0fromrelease-please-config.jsononce 2.0.0 is released, or every later release PR will keep proposing 2.0.0.Verify on first auto-publish
npm trusted publishing must accept
publish.ymlwhen run as a reusable workflow (it matches on the job's workflow ref). If rejected, fall back toon: release+ a PAT/App token. Manual dispatch is unaffected.