Publishes a NodeJS package to an npm registry.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/publish-npm-package@v8
with:
npm-token: ${{ secrets.NPM_TOKEN }}
-
This action is designed for publication only - not for verification: you should call verify-npm-package for that instead.
-
Before the first publication, running with
dry-run
set to true during the verification phase is recommended. -
This action is automatically run by publish-rust-wasm.
-
Run enforce-branch-version, forwarding the
enforce-branch-version
input to itsmode
input. -
Invoke setup-nodejs-context to set up a NodeJS environment having
pnpm
and dependencies. -
Run
pnpm build
if such script has been declared in package.json. -
Run
publish-github-pages
with theoptional
flag enabled. -
If the
.npmrc
file does not exist, generate a new one - publishing to the official npm registry and using the NPM_TOKEN environment variable as the authentication token. The.npmrc
file will be displayed only if auto-generated. -
Run
pnpm publish
, with the value ofnpm-token
injected into the NPM_TOKEN environment variable - accessible, for example, from the.npmrc
configuration file.
-
The requirements for setup-nodejs-context.
-
npm-token
is mandatory - unlessdry-run
is enabled -
The requirements for publish-github-pages if
website-directory
references an existing directory. -
Before the first publication, running with
dry-run
set to true is recommended.
Name | Type | Description | Default value |
---|---|---|---|
dry-run |
boolean | Run a simulated publication via --dry-run |
false |
npm-token |
string | The secret token for publishing to the registry | |
website-directory |
string | Relative directory containing the project website | website |
enforce-branch-version |
inject ,check ,skip |
How the branch version should be enforced | inject |
project-directory |
string | The directory containing package.json |
. |