ci: add npm release workflow triggered by version tags - #24
Merged
Conversation
Releases now trigger on `v*` tags and publish to npm via trusted publishing (OIDC), so no npm token is stored in repo secrets. ### Features - The tag is the trigger but is not trusted: the job refuses to publish unless the tag, package.json, and a non-empty CHANGELOG.md section all name the same version. - The tarball is packed once, then validated with attw and publint and published as that exact file, so the validated bytes are the shipped bytes. - Both mutating steps (npm publish, GitHub Release creation) are idempotent, so a run that dies between publishing and creating the GitHub Release can be re-run rather than stranding the tag. - Prereleases are routed to the `next` dist-tag instead of `latest`. - npm is pinned to 11.18.0 rather than `@latest` because the job holds an OIDC publish identity. - `POLYDOC_REQUIRE_PANDOC` makes the Pandoc-backed tests fail rather than skip, so a release cannot ship on a run where they quietly skipped. Refs #7
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
v*tags and publish to npm via trusted publishing (OIDC), so no npm token is stored in repo secrets.package.json, and a non-emptyCHANGELOG.mdsection all name the same version.Changes
CI
v*tags, that publishes to npm via OIDC trusted publishing.nextdist-tag instead oflatest.@latestbecause the job holds an OIDC publish identity.POLYDOC_REQUIRE_PANDOCmakes the Pandoc-backed tests fail rather than skip, so a release cannot ship on a run where they quietly skipped.Refs #7
Test plan
v*tag and confirm the workflow publishes to npm and creates a GitHub Releaseagentic-tooling/polydoc-core/release.ymlis verified by a successful OIDC exchange