ci: add Release Please workflow for automated releases#59
Open
alukach wants to merge 2 commits into
Open
Conversation
Introduce Release Please to manage version bumps, CHANGELOG generation, git tags, and GitHub releases based on Conventional Commits landing on main. When the Release PR merges, a second job publishes to npm with provenance. Required follow-up before the first Release PR can merge: add an NPM_TOKEN repo secret (granular access token with "Bypass 2FA on publish" enabled, scoped to @developmentseed/stac-react). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch from token-based npm auth to OIDC-based trusted publishing. The publish job exchanges its GitHub OIDC token for short-lived npm credentials, removing the need for a long-lived NPM_TOKEN secret (with 2FA-bypass) and making provenance automatic. Requires npm >= 11.5.1; Node 22 ships with npm 10.x, so add a step to install the latest npm before publishing. Also requires configuring the trusted publisher on npmjs.com to point at this workflow file and repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Introduce Release Please to automate the release pipeline. Going forward, releases will be driven entirely by Conventional Commits landing on
main:fix:/feat:/ etc. commits land onmain, Release Please maintains a Release PR that bumps the version inpackage.jsonand updatesCHANGELOG.md.publish) runs only when a release was created, building the package and publishing to npm via trusted publishing with automatic provenance.Changes
.github/workflows/release.yml— new workflow, runs on push tomain. Two jobs:release-please— manages the Release PR and creates the GH release/tag.publish— gated onrelease_created; authenticates to npm via OIDC (no long-lived token), then runsnpm publish --access public --provenance.release-please-config.json—release-type: node,prerelease: true(we're still in the1.0.0-alpha.xlane). Conventional commit sections shown in the CHANGELOG are explicit (feat,fix,perf,refactor,deps); chore/docs/ci/test/build/style are hidden by default..release-please-manifest.json— tracks the last released version. Initialized to1.0.0-alpha.3(latest on npm).npm trusted publisher — configured ✅
The trusted publisher for
@developmentseed/stac-reacthas been set up on npmjs.com pointing at this repository and workflow file:developmentseedstac-reactrelease.ymlNo npm token or repo secret is required. Trusted publishing also satisfies the package's publish-2FA policy without a "bypass 2FA" flag.
Notes / caveats
.release-please-manifest.jsonis set to1.0.0-alpha.3to match the published npm version. PR chore: scope npm publish to dist/ and rebuild before publish #58 (chore/safer-npm-publish) carries the matchingpackage.jsonbump from1.0.0-alpha.2→1.0.0-alpha.3. If this PR lands first,package.jsonwill lag the manifest until chore: scope npm publish to dist/ and rebuild before publish #58 merges — release-please tolerates this and will reconcile in the next Release PR.v1.0.0-alpha.3release currently points to a commit on thechore/safer-npm-publishbranch (not onmain). After chore: scope npm publish to dist/ and rebuild before publish #58 squash-merges, the tag will be orphaned. Either force-update the tag to the resulting main commit or leave it — release-please reads from the manifest, not git tags, so this doesn't affect the workflow.mainfollow Conventional Commits. The repo is already mostly there. We may want to add a commitlint check or PR title check as a follow-up.prerelease: truekeeps version bumps in thealphalane. To cut a stable1.0.0, we'd remove theprereleaseflag (or use a manualrelease-asoverride).Test plan
mainpush after merge, confirm a Release PR is opened with a CHANGELOG and version bump