The Release alpha workflow is manually triggered. It releases an alpha version
already committed to main; it does not change versions or commit files.
It checks and packs with pnpm, publishes the verified tarball to npm using latest,
then creates a Git tag and GitHub prerelease at the workflow's commit.
Push .github/workflows/release.yml to main before configuring npm.
In the npm settings for @monarcode/session-kit, add a GitHub Actions trusted
publisher with these values:
| Field | Value |
|---|---|
| Organization or user | monarcode |
| Repository | session-kit |
| Workflow filename | release.yml |
| Environment | Leave blank |
| Allowed action | Enable Allow npm publish |
The workflow uses direct publishing. npm's newer default allowing staged publishing alone is insufficient. No npm token secret is required. See npm's trusted publishing documentation. The workflow runs on GitHub-hosted runners with Node.js 24 and npm >=11.5.1. For this public repository/package, trusted publishing also generates provenance.
- Make the intended package changes. Set
package.jsonto a new alpha version, such as0.1.0-alpha.1, and add its## 0.1.0-alpha.1section toCHANGELOG.md. - Run
pnpm run check, then commit and push those changes tomain. - Open GitHub Actions → Release alpha → Run workflow. Choose
mainand enter the exact package version, without avprefix. - Verify the run succeeds, npm exposes the version through
latest, and the matching GitHub prerelease exists.
The workflow rejects a different branch, invalid or mismatched versions, missing
release notes, an existing npm version, and an existing Git tag. It does not
support stable releases yet. The published 0.1.0-alpha.0 cannot be republished.
The build job has read-only repository permissions. Only the publishing job receives OIDC and release-write permissions. Its tarball and release notes come from the same run's artifact, retained for 14 days. Publishing uses npm only for the OIDC-authenticated upload; installation, tests, and packing use pnpm.
If npm publishing fails, resolve the reported problem before rerunning. Check whether npm already contains the version before attempting another publication.
If npm succeeds but GitHub release creation fails, do not bump the version or
republish. Download the session-kit-release artifact from that run and create
the missing GitHub prerelease with its release-notes.md, using the original
run's full commit SHA:
gh release create v0.1.0-alpha.1 \
--repo monarcode/session-kit \
--target FULL_COMMIT_SHA_FROM_THE_RUN \
--title v0.1.0-alpha.1 \
--prerelease --latest=false \
--notes-file /absolute/path/to/release-notes.mdUse the affected version in that command. If the tag or release already exists, inspect it and complete the missing step rather than creating it again.