-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.58 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (54 loc) · 1.58 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
61
62
63
64
65
66
name: Production Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: 'npm'
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Releasing version: $VERSION"
- name: Install dependencies
run: npm ci --no-audit
- name: Build
run: npm run build
- name: Verify build output
run: |
if [[ ! -d "dist" ]]; then
echo "Build failed: dist directory not found"
exit 1
fi
echo "Build verification passed"
- name: Update package version
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest --no-audit
- name: Publish to npm
run: npm publish --access public
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}