Node.js Package Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js Package Release | |
on: | |
workflow_dispatch: | |
inputs: | |
semver: | |
description: "The semantic version to bump (patch, minor, major)" | |
required: true | |
default: "patch" | |
nodeVersion: | |
description: "The Node.js version to use" | |
required: true | |
default: "16.x" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ github.event.inputs.nodeVersion }} | |
registry-url: "https://registry.npmjs.org" | |
- name: Bump version and push tag | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
npm version ${{ github.event.inputs.semver }} | |
git push && git push --tags | |
env: | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |