Publishes a NodeJS package to an npm registry.
The action can be placed right after checking out the source code:
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/publish-npm-package@v6
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.
-
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. -
Run
pnpm publish
-
The requirements for setup-nodejs-context.
-
npm-token
is not mandatory whendry-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 |
project-directory |
string | The directory containing package.json |
. |