-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.38 KB
/
release.yml
File metadata and controls
54 lines (43 loc) · 1.38 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
name: Release
on:
push:
tags:
- 'v*'
# CRITICAL: Required for npm Trusted Publishing (OIDC authentication)
permissions:
contents: write # Needed to create GitHub releases
id-token: write # Needed for npm provenance/trusted publishing
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
# NO registry-url - prevents .npmrc conflicts with OIDC
- name: Upgrade npm for Trusted Publishing
run: npm install -g npm@latest # Requires npm >= 11.5.1
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Type Check
run: npm run type-check
- name: Publish to npm with Provenance
run: npm publish --provenance --access public
# OIDC authentication via GitHub Actions - no tokens needed!
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
body: |
See [CHANGELOG.md](https://github.com/CrashBytes/react-version-compare/blob/main/CHANGELOG.md) for details.
draft: false
prerelease: false