An action that wraps the npm-publish command.
Also optionally calling the npm-version command before hand to allow for manual version publishing (see the version
input parameter).
Here is an example usage that publishes the version 2.3.12
once checked out:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: registry-url-here
- uses: matt-usurp/npm-publish@v2
with:
version: '2.3.12'
tag: 'next'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
This essentially runs the following commands:
npm version 1.0.0 --force --allow-same-version --no-git-tag-version
npm publish --access public --tag next
Note We use
--no-git-tag-version
because this action is not intended to have side effects.
You can configure the action with the following input parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
version |
string |
false |
[current] |
A valid semantic version to use when publishing |
tag |
string |
false |
latest |
The npm-dist-tag to be used when publishing |
access |
string |
false |
public |
The npm-access to be used when publishing |
dry-run |
boolean |
false |
false |
If the publish command should be dry ran |
directory |
string |
false |
cwd |
The directory to execute commands from |
silent |
boolean |
false |
false |
Should command output be silenced |
Note The
boolean
type represents a value that is boolean truthy when evaluated. For atrue
value, use the string"true"
or1
, all other values will representfalse
.
This action has no outputs.