-
Notifications
You must be signed in to change notification settings - Fork 9
60 lines (56 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (56 loc) · 1.63 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
name: Release
on:
push:
branches: [main, dev]
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
test:
name: test (node 22)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm test
- run: pnpm build
release:
name: semantic-release
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org
# npm CLI >= 11.5.1 detects the GitHub Actions OIDC token via
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN and, when a matching Trusted
# Publisher is configured for the package on npmjs.com, exchanges it
# for a short-lived publish credential — no NPM_TOKEN needed. The Node
# 22 image ships npm 10.x, so pin a newer one here.
- run: npm install -g npm@latest
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Attach sigstore provenance to the published tarball.
NPM_CONFIG_PROVENANCE: "true"
run: npx semantic-release