Skip to content

NPM publish CD workflow #57

NPM publish CD workflow

NPM publish CD workflow #57

Workflow file for this run

name: NPM publish CD workflow
on:
workflow_dispatch:
inputs:
updateType:
description: 'Update type'
type: choice
options:
- major
- minor
- patch
required: true
jobs:
build:
if: "!startsWith(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
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 --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push --follow-tags
env:
github-token: ${{ secrets.GITHUB_TOKEN }}