github action for simple npm and github packages publish
Click the Use this Template and provide the new repo details for your action
using publisher is easy, all you do is add the relevant publish step in your action, or set it up as a standalone action.
an example step would be:
- uses: tool3/publisher@v1
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.GP_TOKEN }}
scope: "@tool3"whether you provide a scope input or not, publisher will check if your package.json file has a scope, and will use that as the publish scope.
github_tokenrequired
Github access tokennpm_tokenrequired
npm private tokenscope
user scope for package
example of an automated release workflow.
this workflow will:
- bump patch version (or minor\major if provided in commit msg. see
bump) - publish to
npm - publish to
gpr
name: release
on:
push:
branches:
- release
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: tool3/bump@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
unrelated: true
publisher:
needs: tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: tool3/publisher@v1
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
scope: "@tool3"