43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: npm-bump
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
newversion:
|
|
description: 'npm version {major,minor,patch}'
|
|
required: true
|
|
|
|
env:
|
|
NODE_VERSION: 'lts/*'
|
|
FORCE_COLOR: 2
|
|
|
|
concurrency: # prevent concurrent releases
|
|
group: npm-bump
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
version_and_release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# fetch full history so things like auto-changelog work properly
|
|
fetch-depth: 0
|
|
- name: Use Node.js ${{ env.NODE_VERSION }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- run: npm i
|
|
- run: git status # getting odd dirty repo errors during version debug info
|
|
- run: git diff
|
|
- name: npm version && npm publish
|
|
uses: bcomnes/npm-bump@v2.2.1
|
|
with:
|
|
git_email: bcomnes@gmail.com
|
|
git_username: ${{ github.actor }}
|
|
newversion: ${{ github.event.inputs.newversion }}
|
|
github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use.
|
|
npm_token: ${{ secrets.NPM_TOKEN }} # user set secret token generated at npm
|