This project uses npm trusted publishing with GitHub Actions and OpenID Connect (OIDC). Each release receives a short-lived credential from npm, so no long-lived npm publish token is stored in GitHub.
- Sign in to npmjs.com with an owner of
ngx-typed-writer. - Open the package, then Settings > Trusted Publisher.
- Choose GitHub Actions and enter:
- Organization or user:
SkyZeroZx - Repository:
ngx-typed-writer - Workflow filename:
release.yml - Environment: leave empty
- Allowed action:
npm publish
- Organization or user:
- Save the trusted publisher.
The workflow filename is case-sensitive and must be only release.yml, not .github/workflows/release.yml.
The npm CLI setup command requires npm 11.15 or newer, npm write access, and account-level 2FA:
npm install --global npm@11
npm login
npm trust github ngx-typed-writer \
--repo SkyZeroZx/ngx-typed-writer \
--file release.yml \
--allow-publish- Merge or push Conventional Commits to
main:fix:creates a patch release.feat:creates a minor release.BREAKING CHANGE:creates a major release.
- Open GitHub > Actions > RELEASE > Run workflow.
- Enable
dry_runfor a preview, or leave it disabled to publish.
The workflow installs dependencies, runs lint/build, calculates the version with semantic-release, updates package versions and CHANGELOG.md, publishes dist/libs/ngx-typed-writer to npm, creates the Git tag, and pushes the release commit.
After the first successful OIDC release:
- Delete the
NPM_TOKENrepository secret from GitHub; the workflow no longer reads it. - In npm package settings, set publishing access to Require two-factor authentication and disallow tokens.
Trusted publishing automatically adds npm provenance to the published package.
ENEEDAUTH: verify owner, repository, andrelease.ymlexactly match npm's trusted-publisher settings.- OIDC failures: confirm the workflow has
id-token: writeand uses a GitHub-hosted runner. - Git push failures: allow GitHub Actions write access to
main, or adjust the branch protection rule for the release workflow.
Official references: