-
Notifications
You must be signed in to change notification settings - Fork 22
56 lines (51 loc) · 1.74 KB
/
release.yml
File metadata and controls
56 lines (51 loc) · 1.74 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
name: Release NPM
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
- run: npm install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# create GitHub release
- name: Extract release notes
id: extract_release_notes
run: |
# Extract version from tag (remove 'v' prefix)
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Extract changelog section for this version with better handling
if grep -q "## \[$VERSION\]" CHANGELOG.md; then
awk "/^## \[$VERSION\]/ {flag=1; next} /^## \[/ && flag {exit} flag && /\S/ {print}" CHANGELOG.md > release_notes.md
echo "Release notes extracted for version $VERSION:"
cat release_notes.md
else
echo "No changelog entry found for version $VERSION" > release_notes.md
echo "Warning: No changelog entry found for version $VERSION"
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.extract_release_notes.outputs.version }}
body_path: release_notes.md
draft: false
prerelease: false
files: |
dist/amqp-websocket-client.mjs
dist/amqp-websocket-client.mjs.map