NPM Publish #3
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: NPM Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
tests: | |
uses: ./.github/workflows/tests.yml | |
publish-npm: | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: npm install | |
- name: Update version | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
npm version ${{ inputs.version }} | |
- name: Publish package | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: npm publish | |
- name: Push changes | |
run: git push |