-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (48 loc) · 1.56 KB
/
release.yaml
File metadata and controls
58 lines (48 loc) · 1.56 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
name: Release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
permissions:
contents: write
id-token: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
always-auth: true
- name: Install dependencies
run: npm ci
- name: Run all checks and build
run: npm run all
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Determine npm tag and release type
id: release-info
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" =~ -.*$ ]]; then
echo "npm_tag=next" >> $GITHUB_OUTPUT
echo "is_prerelease=true" >> $GITHUB_OUTPUT
else
echo "npm_tag=latest" >> $GITHUB_OUTPUT
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Publish to npm
run: npm publish --provenance --access public --tag ${{ steps.release-info.outputs.npm_tag }}
- name: Create GitHub Release
if: steps.release-info.outputs.is_prerelease == 'false'
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: ${{ steps.release-info.outputs.is_prerelease == 'true' }}