Skip to content

Commit 21fcfc2

Browse files
authored
chore(ci): add pkg.pr.new (#6893)
* chore(ci): add pkg.pr.new * chore: test * fix(workflow): change runner from macos-14 to ubuntu-latest * fix(workflow): add cache-dependency-path for node setup * fix(workflow): update concurrency settings and event triggers for pkg.pr.new * chore(readme): add npm version and pkg.pr.new badges to README files
1 parent 3e23a24 commit 21fcfc2

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
lint:
1414
environment: test
1515

16-
runs-on: macos-14
16+
runs-on: ubuntu-latest
1717

1818
strategy:
1919
matrix:
@@ -38,7 +38,7 @@ jobs:
3838
test:
3939
environment: test
4040

41-
runs-on: macos-14
41+
runs-on: ubuntu-latest
4242

4343
strategy:
4444
matrix:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to pkg.pr.new
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
types: [labeled]
7+
8+
# Cancel all previous workflows on main.
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.label.name, 'preview'))
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- run: corepack enable
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
cache: "pnpm"
26+
cache-dependency-path: "package.json"
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Build
32+
run: pnpm build:package
33+
34+
- name: Publish preview
35+
run: pnpx pkg-pr-new publish --compact

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<p align="center"><b>Fairly Complete, Theme Customizable, Uses TypeScript, Fast</b></p>
88
<p align="center">Kinda Interesting</p>
99

10+
<p align="center">
11+
<a href="https://npmjs.com/package/naive-ui">
12+
<img src="https://img.shields.io/npm/v/naive-ui.svg" alt="npm">
13+
</a>
14+
<a href="https://pkg.pr.new/~/tusen-ai/naive-ui">
15+
<img src="https://pkg.pr.new/badge/tusen-ai/naive-ui" alt="pkg.pr.new">
16+
</a>
17+
</p>
18+
1019
<p align="center">English | <a href="README.zh-CN.md">中文</a></p>
1120

1221
## Documentation

README.zh-CN.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<p align="center"><b>比较完整,主题可调,使用 TypeScript,快</b></p>
88
<p align="center">有点意思</p>
99

10+
<p align="center">
11+
<a href="https://npmjs.com/package/naive-ui">
12+
<img src="https://img.shields.io/npm/v/naive-ui.svg" alt="npm">
13+
</a>
14+
<a href="https://pkg.pr.new/~/tusen-ai/naive-ui">
15+
<img src="https://pkg.pr.new/badge/tusen-ai/naive-ui" alt="pkg.pr.new">
16+
</a>
17+
</p>
18+
1019
<p align="center"><a href="README.md">English</a> | 中文</p>
1120

1221
## 文档

0 commit comments

Comments
 (0)