npm publishing setup
This document describes the one-time, maintainer-facing setup required to publish
@jeap/jeap-frontend-license-checker to the public npm registry. It covers what must be
configured outside the repository, on npmjs.com and in the GitHub repository settings.
The target state is the same as for the other jEAP npm packages: published publicly under the
npm @jeap organization, released by GitHub Actions using
npm Trusted Publishing (OIDC), with no long-lived npm token stored in CI.
One-time prerequisites (npmjs.com)
- The npm
jeaporganization must exist, and the publishing maintainer must be a member with rights to publish to the@jeapscope. It already hosts the other jEAP packages. - The package is scoped and published publicly. This is declared in
package.jsonvia"publishConfig": { "access": "public" }, and the workflow also passes--access public.
One-time prerequisites (GitHub)
- Create a repository environment named
release. The release job runs in it, which is what scopes the bootstrap secret to that job. - Configure the npm trusted publisher for this repository, the workflow file
build-and-release.ymland thereleaseenvironment.
Bootstrapping the first release
Trusted publishing can only be configured for a package that already exists on npm. Until then:
- Add a repository secret
NPM_TOKENin thereleaseenvironment, holding an automation token with publish rights for the@jeapscope. - Merge the first version to
main. The workflow's token publish step runs because the secret is present. - Configure the trusted publisher on npm as described above.
- Delete the
NPM_TOKENsecret. The workflow then automatically uses the OIDC publish step instead; no workflow edit is needed.
Requirements already satisfied by the workflow
permissions: id-token: writefor the OIDC token, andcontents: writeto push the record tag- runs on a GitHub-hosted runner
- upgrades npm before publishing, because trusted publishing needs npm >= 11.5.1 and Node.js >= 22.14.0