Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd1d591

Browse files
committed
ci: use npm trusted publishing
1 parent 1e9f7ec commit fd1d591

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
- run: corepack enable
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/*
23+
cache: pnpm
24+
registry-url: https://registry.npmjs.org
25+
26+
- name: 📦 Install dependencies
27+
run: pnpm i
28+
29+
- name: 🚀 Publish package
30+
run: pnpm publish --access public --no-git-checks

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
],
4040
"scripts": {
4141
"build": "unbuild",
42-
"release": "npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags",
42+
"prepack": "pnpm build",
43+
"release": "npm run lint && npm run test && changelogen --release && git push --follow-tags",
4344
"lint": "eslint",
4445
"lint:fix": "eslint --fix",
4546
"test": "vitest run --reporter=verbose --coverage",

0 commit comments

Comments
 (0)