-
Notifications
You must be signed in to change notification settings - Fork 55
39 lines (38 loc) · 1.11 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 }}