Repository navigation
ci: add manual release workflow with npm trusted publishing - #29
Merged
Merged
Conversation
Releases needed several manual steps on a maintainer machine: tagging, creating the GitHub release from the CHANGELOG, and publishing the Studio packages with the pinned pnpm so workspace dependencies resolve. The Release workflow runs from main with a version input. It reuses the Quality workflow, creates the annotated tag and the GitHub release from the CHANGELOG section, then packs the Studio packages with pnpm 10.11.0 and publishes them through npm Trusted Publishing with provenance. Every step is idempotent, target limits the run to github or npm, and dry_run previews without creating anything. Quality now also runs as a reusable workflow, with a concurrency group that keeps release runs separate from push runs.
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.
Adds a Release workflow so a release no longer depends on a maintainer machine. Today that means tagging by hand, creating the GitHub release, and publishing the Studio packages with the right pnpm version so
workspace:*resolves.How it works
Run it from Actions → Release → Run workflow on
main(or through the API). Inputs:version: for example3.4.0.CHANGELOG.mdmust have a## [3.4.0]section.target:all(default),github(tag + release only), ornpm(publish an already tagged version).dry_run: defaults totrue. It previews the notes and runsnpm publish --dry-run, without creating or publishing anything.Jobs:
main, validates the version format, and checks that the CHANGELOG section exists.quality.yml: Go build, vet, race tests and fuzz smoke; Studio lint, typecheck, tests, Stryker dry-run, build and audit. If anything fails, nothing is released.vX.Y.Zon the commit being released and the GitHub release. The notes are the CHANGELOG section plus the compare link.pnpm pack. Packing rewritesworkspace:*to the real version, and the job fails if anyworkspace:dependency remains. It then publishes withnpm publish --provenance,editor-corefirst.Every step is idempotent. An existing tag or release is kept, and package versions already on npm are skipped, so a failed run can simply be re-run.
npm Trusted Publishing (no stored token)
The npm job uses OIDC (
id-token: write) instead of anNPM_TOKENsecret. One-time setup per package on npmjs.com: open the package's Settings → Trusted Publisher → GitHub Actions and enter:rendisstateprorelease.ymlDo this for
@rendis/statepro-studio-reactand@rendis/statepro-studio-web-component.Other changes
quality.ymlcan now be called as a reusable workflow (workflow_call). Its concurrency group now includesgithub.workflow, so a push tomaincannot cancel the checks of a release run, or the other way round.CONTRIBUTING.mdgets a Releasing section that describes this process.Validation
actionlintreports no issues on both workflows.3.4.0match the published v3.4.0 release, apart from blank lines.pnpm packwith pnpm 10.11.0 prints the tarball path and rewrites the Web Component's dependency to"@rendis/statepro-studio-react": "0.2.0".npm publish --dry-runaccepts both tarballs.workflow_dispatchneeds the file on the default branch. The first real run should betarget: npmfor3.4.0, starting withdry_run: true.