Skip to content

Commit 9bd1013

Browse files
committed
chore: replace release.yml with npm-release.yml and semantic-release.yml for improved release process
1 parent 552b1c4 commit 9bd1013

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

.github/workflows/npm-release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release to npm
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: latest
21+
run_install: false
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
registry-url: "https://registry.npmjs.org"
28+
cache: "pnpm"
29+
30+
- name: Install dependencies
31+
run: pnpm install --no-frozen-lockfile
32+
33+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
34+
run: pnpm audit signatures
35+
36+
- name: Run lint
37+
run: pnpm lint
38+
39+
- name: Run tests
40+
run: pnpm test
41+
42+
- name: Build package
43+
run: pnpm build
44+
45+
- name: Authenticate npm
46+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ${{ github.workspace }}/.npmrc
47+
48+
- name: Publish package on NPM
49+
run: npm publish --access public
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN}}

.github/workflows/release.yml renamed to .github/workflows/semantic-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Semantic Release
22

33
on:
44
repository_dispatch:
@@ -55,7 +55,7 @@ jobs:
5555
- name: Authenticate npm
5656
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ${{ github.workspace }}/.npmrc
5757

58-
- name: Release
58+
- name: Semantic Release
5959
env:
6060
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
6161
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)