Update version and publish npm from GH
Setting up CI with GitHub Actions to update a node.js package version from GitHub release tag and publish it to npm
name: publish
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Set version from tag
run: npm --no-git-tag-version version ${GITHUB_REF#refs/*/}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}PreviousHow to skip steps or jobs in GitHub Actions for PRs from forksNextPush to protected branch from GitHub actions
Last updated