Skip to content

publish node package action

Actions
Publish a NodeJS package to NPM Repository or GitHub Packages
v3.0.0
Latest
Star (4)

Tags

 (1)

publish-node-package-action

release marketplace license

Publish a NodeJS package to NPM Repository or GitHub Packages

Publish to NPM Repository

PreRequirements

jobs:
    publish-npm:
        runs-on: ubuntu-latest
        permissions:
            contents: read
            id-token: write # Give permission to mint an ID-token
        steps:
            - uses: actions/checkout@v4
            - run: npm ci
            - run: npm run build
            - uses: FrontEndDev-org/publish-node-package-action@v2
              with:
                  target: npm
                  token: ${{ secrets.NPM_TOKEN }}

Publish to GitHub Packages

PreRequirements

  • Requires GitHub Packages write access
  • No need to publish token

Notes

  • GitHub Packages name may change after release, in two cases:
    1. For example, the original name my-pkg will be changed to @owner/my-kg, where owner is the name of the owner name of the current repository
    2. For example, the original name @my-scope/my-pkg will be changed to @owner/my-scope__my-kg, where owner is the owner name of the current repository
  • The name attribute in package.json in the repository will not be modified
jobs:
    publish-github:
        runs-on: ubuntu-latest
        permissions:
            packages: write
        steps:
            - uses: actions/checkout@v4
            - run: npm ci
            - run: npm run build
            - uses: FrontEndDev-org/publish-node-package-action@v2
              with:
                  target: github
                  token: ${{ github.token }}

Inputs

Name Required Default Description
token true None Target authorization token
target false npm Packages target, optionally npm OR github
tag false latest The version label to release, default is latest
dryRun false false Pretend to publish, but don't actually upload to the registry.
includePrivate false false publish private packages as well.
disableProvenance false false Disable provenance for npm publish.
syncNpmmirror false false Sync to npmmirror.com.
syncTimeout false 30 Sync timeout in seconds, default is 30s.

Outputs

Nothing!

publish node package action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Publish a NodeJS package to NPM Repository or GitHub Packages
v3.0.0
Latest

Tags

 (1)

publish node package action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.