Skip to content

Latest commit

 

History

History
65 lines (38 loc) · 2.33 KB

File metadata and controls

65 lines (38 loc) · 2.33 KB

publish-npm-package

Publishes a NodeJS package to an npm registry.

Example

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 }}

Remarks

  • 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.

How it works

  1. Invoke setup-nodejs-context to set up a NodeJS environment having pnpm and dependencies.

  2. Run pnpm build if such script has been declared in package.json.

  3. Run publish-github-pages with the optional flag enabled.

  4. Run pnpm publish

Requirements

  • The requirements for setup-nodejs-context.

  • npm-token is not mandatory when dry-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.

Inputs 📥

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 .

Further references