-
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (50 loc) · 1.39 KB
/
release.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Publish
on:
workflow_dispatch:
inputs:
version:
type: choice
options:
- major
- minor
- patch
permissions:
actions: write
contents: write
jobs:
build:
environment: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
npm ci --ignore-scripts
- name: Build
run: |
npm run build
- name: Update version and docs
run: |
git reset --hard
git config --local --list
git checkout main
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
npm version ${{ inputs.version }}
npm run docs
git add . || true
git commit -m "Update package version and docs" || true
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" -f
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}