This action publishes npm packages when creating new releases. It publishes under custom tags if one is specified in the version (e.g.: v1.0.0-alpha.1)
.
The release tag must follow the semver standard.
This action must only be used on workflows triggered by releases.
The npm
command must be available.
- name: Publish Package
uses: novom/[email protected]
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Only needed if package is published on github packages
Name | Description | Default |
---|---|---|
working-directory |
The directory to publish | . |
Name | Description |
---|---|
version |
The version that was published |
tag |
The tag that was used to publish |
name: Publish Example
on:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.16'
- name: Publish Package
uses: novom/[email protected]
with:
working-directory: '<directory to publish>'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.publish.outputs.version }}
- run: echo ${{ steps.publish.outputs.tag }}
This software uses the MIT license.