Skip to content

NPM Publish

NPM Publish #3

Workflow file for this run

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