publish-npm #306
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: publish-npm | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version" | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out project | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "18" | |
registry-url: https://registry.npmjs.org/ | |
- name: install | |
run: npm install --ignore-scripts | |
- name: "Run linting" | |
run: npm run lint | |
- name: "Run tests" | |
run: npm run vtest | |
- name: "Bump the version" | |
run: npm version ${{inputs.version}} --no-git-tag-version | |
- name: "Publish the packages" | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Get new version | |
id: new-version | |
uses: martinbeentjes/npm-get-version-action@main | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: version ${{ steps.new-version.outputs.current-version}} | |
commit_user_name: gathercontent-server | |
commit_user_email: [email protected] | |
commit_author: GatherContent Servers <gathercontent-servers> # defaults to author of the commit that triggered the run | |
tagging_message: "v${{ steps.new-version.outputs.current-version }}" | |
push_options: "--force" |