Skip to content

NPM publish CD workflow #54

NPM publish CD workflow

NPM publish CD workflow #54

Workflow file for this run

name: NPM publish CD workflow
on:
workflow_dispatch:
inputs:
updateType:
description: "Update type ('patch', 'major', or 'minor')"
required: true
jobs:
build:
if: "!startsWith(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/[email protected]
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm test
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "[email protected]"
- run: npm version ${{ github.event.inputs.updateType }} -m "[ci skip] %s"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push --follow-tags
env:
github-token: ${{ secrets.GITHUB_TOKEN }}