Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.53 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.53 KB

publish-node-package

GitHub action to publish a NodeJS package to NPM and GitHub Packages.

Usage

See action.yml. Make sure you've stored a NPM classic token (an "Automation" token) as a secret in your repository. You can generate one at https://www.npmjs.com/settings/your-username/tokens.

Example Workflow

name: Publish my node package

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest

    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Publish
        uses: colinparsonsme/publish-node-package@v1
        with:
          # you can store your NPM token with any name in your repository secrets
          # assuming it's stored as NPM_TOKEN here
          npm-token: ${{ secrets.NPM_TOKEN }} # optional
          # your github token is always accessed by ${{ secrets.GITHUB_TOKEN}}
          # since it's autogenerated by GitHub on each job
          github-token: ${{ secrets.GITHUB_TOKEN }} # optional; must be used with scope
          scope: '@my-username-or-organization' # optional; must be used with github-token

License

See the License.

Contributing

See the Contributing Guidelines.

Contributor Code of Conduct

See the Code of Conduct.

Contact

If you're interested in getting in touch outside of this project, check out colinparsons.com.