npm-publish-action v0.0.0-a665e32
npm-publish-action
This GitHub Action publishes to npm with the following conventions:
| branch | version | tag |
|---|---|---|
master | from package.json | latest |
release-<version> | <version>-rc.<sha> | next |
| all others | 0.0.0-<sha> | canary |
...where <sha> is the 7-character SHA of the head commit ref.
Status checks
Depending on the branch, a series of statuses will be created by this action in your checks: publish is the action's check, and publish {package-name} is a commit status created by the action that reports the version published and links to unpkg.com via "Details":

If you're on a release branch (release-<version>) and the <version> portion of the branch name doesn't match the version field in package.json, you'll get a pending status reminding you to update it:

Usage
Add an actions/setup-node step to your workflow. If you have one already, ensure that the
registry-urlinput is set (e.g. tohttps://registry.npmjs.org) so that this action can populate your.npmrcwith authentication info:- uses: actions/setup-node@master with: version: 12 registry-url: 'https://registry.npmjs.org'Add this action later in your workflow. I suggest that you place this action after any linting and/or testing actions to catch as many errors as possible before publishing.
- uses: shawnbot/npm-publish-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # NOTE: use the NODE_ prefix instead of NPM_ here! NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
That's it!
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago