-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (39 loc) · 1.09 KB
/
publish.yml
File metadata and controls
41 lines (39 loc) · 1.09 KB
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
40
41
name: Publish to npm
on:
workflow_dispatch:
inputs:
version:
description: 'Version bump type or "doconly" to skip publish'
required: true
type: choice
options:
- patch
- minor
- major
- doconly
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm@latest
- run: npm ci
- run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- run: npm version ${{ inputs.version }}
if: inputs.version != 'doconly'
- run: npm run build
if: inputs.version != 'doconly'
- run: npm publish ./dist --provenance --access=public
if: inputs.version != 'doconly'
- run: git push origin master --tags
if: inputs.version != 'doconly'