-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.54 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (49 loc) · 1.54 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release
on:
release:
types: [published]
permissions:
contents: write
id-token: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org/'
always-auth: true
- name: Get release version from tag
id: get_version
run: |
VERSION="${GITHUB_REF#refs/tags/}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Set npm config
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- name: Update package.json version
run: |
npm version ${{ steps.get_version.outputs.version }} --no-git-tag-version
- name: Commit version bump
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add package.json package-lock.json
git commit -m "chore: release ${{ steps.get_version.outputs.version }}"
git push origin HEAD:main
- name: Install dependencies
run: npm ci
- name: Build package (ESM + UMD)
run: |
npm run build
npm run build:umd
- name: Publish with provenance and signature
run: npm publish --access public --provenance --sign
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}