Skip to content

ci: automate releases with release-please, OIDC publish and PR-title lint#5

Merged
merencia merged 1 commit into
masterfrom
ci/release-automation
Jun 22, 2026
Merged

ci: automate releases with release-please, OIDC publish and PR-title lint#5
merencia merged 1 commit into
masterfrom
ci/release-automation

Conversation

@merencia

Copy link
Copy Markdown
Member

Brings the node-cron release automation to this repo, adapted to its specifics.

What's added

  • release-please (release-please.yml): on push to master, maintains a rolling release PR (version + CHANGELOG.md) from Conventional Commits. Merging it tags vX.Y.Z, creates the GitHub Release, then calls the publish workflow.
  • OIDC publish (publish.yml, replaces release.yml): trusted publishing with provenance, no NPM_TOKEN. Runs both manually (workflow_dispatch, with dist-tag choice) and automatically via workflow_call from release-please.
  • PR-title lint (pr-title-lint.yml): enforces Conventional Commit PR titles (since PRs are squash-merged).
  • include-component-in-tag: false so tags are vX.Y.Z (not cron-translate-vX.Y.Z).

Adapted to this repo (vs node-cron)

  • Targets master (the default branch here), not main.
  • Publish runs npm ci + typecheck + test:coverage and --access public, matching the old release.yml.

Bootstrap: the 1.0.0 → 2.0.0 situation

npm has 1.0.0, but master holds 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:

  • Manifest baseline = 1.0.0 (the published version).
  • release-as: 2.0.0 forces the first release PR to cut 2.0.0.

Important

Two manual steps are required:

  1. Configure npm trusted publishing for cron-translate on npmjs.com, workflow file publish.yml — otherwise the OIDC publish fails. (This replaces the NPM_TOKEN secret, which can be deleted afterwards.)
  2. Remove release-as: 2.0.0 from release-please-config.json once 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.yml when run as a reusable workflow (it matches on the job's workflow ref). If rejected, fall back to on: release + a PAT/App token. Manual dispatch is unaffected.

…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.
@merencia merencia merged commit 299aeee into master Jun 22, 2026
3 checks passed
@merencia merencia deleted the ci/release-automation branch June 22, 2026 20:02
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