Skip to content

Use npm trusted publishing for package releases - #190

Merged
mchatlas-hellosign merged 3 commits into
mainfrom
chore/npm-trusted-publishing
Sep 14, 2026
Merged

mchatlas-hellosign merged 3 commits into
mainfrom
chore/npm-trusted-publishing

Conversation

@mchatlas-hellosign

@mchatlas-hellosign mchatlas-hellosign commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the separate beta and production workflows with one production release workflow
  • run only for pushes to main that change package.json, with an additional event/ref guard on every job
  • preserve the existing Node 16 install, build, test, version validation, and package steps
  • publish the packed artifact from Node 24/npm 11.19.1 using npm trusted publishing and no npm token
  • create the GitHub Release and upload both bundles to the production CDN only after npm publishing succeeds
  • remove pull-request beta publishing and non-production CDN uploads

Workflow structure

  1. build validates and packages the release on Node 16, then uploads a one-day workflow artifact.
  2. publish downloads that artifact and publishes it through npm OIDC.
  3. release runs only after npm succeeds, creates the GitHub Release, and deploys the same build artifacts to the production CDN through the existing AWS OIDC role.

The workflow has no GitHub environment dependency. Publishing is gated in code by the main push trigger, the package.json path filter, and job-level event/ref conditions.

Validation

  • npm trusted publishing was proven end to end by staging 2.12.3-oidc-test.1.2 from this workflow with no npm token
  • the isolated Node 16 build passed all 8 test suites and 76 tests and produced the expected six-file package
  • Node 24 with npm 11.19.1 supports the required trusted-publishing commands
  • actionlint v1.7.12 passed on the consolidated workflow
  • the final workflow YAML parses successfully and git diff --check passes

Release follow-up

  • reject the staged 2.12.3-oidc-test.1.2 package after inspection
  • npm's trusted publisher must allow direct npm publish
  • npm, main, and the latest GitHub Release are 2.12.3; an orphaned v2.12.4 tag already exists outside main
  • after this pipeline PR merges, prepare a separate 2.12.4 version PR and replace the old tag immediately before merging that release

The workflow filename remains github-actions.yml, matching npm's trusted-publisher configuration.

@mchatlas-hellosign mchatlas-hellosign changed the title Add npm trusted publishing test workflow Use npm trusted publishing for package releases Sep 11, 2026
@mchatlas-hellosign
mchatlas-hellosign marked this pull request as ready for review September 14, 2026 10:46
@mchatlas-hellosign
mchatlas-hellosign merged commit 1494f62 into main Sep 14, 2026
1 check passed
@ericbecking

ericbecking commented Sep 14, 2026 via email

Copy link
Copy Markdown

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.

3 participants