-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (46 loc) · 1.41 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (46 loc) · 1.41 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
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Test & Release
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: actions/setup-node@v4
with:
node-version: 22
- name: Install dev dependencies
run: npm ci
- name: Run tests
run: npm run test:gsdd
- name: Audit packed tarball surface
run: npm pack --dry-run --json
- name: Authenticate to npm via OIDC trusted publisher
run: |
OIDC_TOKEN=$(curl -fsSL \
-H "Authorization: Bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=npm" \
| jq -r '.value')
NPM_TOKEN=$(curl -fsSL \
-X POST "https://registry.npmjs.org/-/npm/v1/loginoauth" \
-H "Content-Type: application/json" \
-d "{\"oidcToken\": \"${OIDC_TOKEN}\"}" \
| jq -r '.token')
echo "::add-mask::${NPM_TOKEN}"
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
echo "NPM_TOKEN=${NPM_TOKEN}" >> "${GITHUB_ENV}"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
run: npx semantic-release