-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.36 KB
/
release.yml
File metadata and controls
51 lines (42 loc) · 1.36 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
name: Release
on:
push:
branches: [main]
permissions:
contents: write # create tags + commits
issues: write # comment on issues
pull-requests: write # comment on PRs
id-token: write # npm provenance
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so semantic-release can walk commits
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.AUTO_PR_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true'
run: npx semantic-release
- name: Notify homebrew tap
run: |
VERSION=$(node -p "require('./package.json').version")
curl -s --fail -X POST \
-H "Authorization: token ${{ secrets.AUTO_PR_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/node9-ai/homebrew-node9/dispatches \
-d "$(jq -n --arg v "$VERSION" '{event_type:"new-release",client_payload:{version:$v}}')"