-
Notifications
You must be signed in to change notification settings - Fork 9
39 lines (31 loc) · 859 Bytes
/
Copy pathpublish.yml
File metadata and controls
39 lines (31 loc) · 859 Bytes
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
name: Publish to npm
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: npm install -g npm@latest
- run: npm install
- run: npm publish --provenance
- name: Extract changelog
run: |
VERSION=${GITHUB_REF#refs/tags/v}
awk -v ver="$VERSION" '
$0 ~ "^### \\[" ver "\\]" { found=1; next }
found && $0 ~ "^### \\[" && !index($0, ver) { exit }
found
' CHANGELOG.md > /tmp/release-notes.md
- uses: softprops/action-gh-release@v2
with:
body_path: /tmp/release-notes.md