NPM Publish #18
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 Upgrade" | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install | |
run: npm install | |
- name: Test | |
run : npm run test | |
- name: Version | |
run: npm version ${{ inputs.version }} --no-git-tag-version | |
- name: Build | |
run: npm run build | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Commit | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git commit -am "published ${{ inputs.version }} update" | |
git push |