Skip to content

Commit 7ce5992

Browse files
committed
Update GH Actions workflow
- replace codesandbox ci with pkg-pr-new action - add preview workflow
1 parent 14365f3 commit 7ce5992

4 files changed

Lines changed: 101 additions & 71 deletions

File tree

.codesandbox/ci.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
tags: ['v*']
7+
pull_request:
8+
branches: ['*']
9+
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
validate:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: pnpm/action-setup@v4
23+
with:
24+
version: 10
25+
run_install: false
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: pnpm
31+
32+
- run: pnpm install
33+
34+
- run: pnpm validate
35+
36+
- uses: SonarSource/sonarqube-scan-action@v7.0.0
37+
if: "!startsWith(github.ref, 'refs/tags/')"
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
41+
42+
publish:
43+
runs-on: ubuntu-latest
44+
if: startsWith(github.ref, 'refs/tags/v')
45+
needs: validate
46+
permissions:
47+
id-token: write
48+
contents: read
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: pnpm/action-setup@v4
53+
with:
54+
version: 10
55+
run_install: false
56+
57+
- uses: actions/setup-node@v4
58+
with:
59+
node-version: 22
60+
cache: pnpm
61+
registry-url: https://registry.npmjs.org
62+
63+
- run: npm install -g npm@11
64+
65+
- run: pnpm install
66+
67+
- run: pnpm build
68+
69+
- run: npm publish --provenance

.github/workflows/main.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/preview.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Preview
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
preview:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: pnpm/action-setup@v4
18+
with:
19+
version: 10
20+
run_install: false
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
cache: 'pnpm'
26+
27+
- run: pnpm install
28+
timeout-minutes: 3
29+
30+
- run: pnpm run build
31+
32+
- run: npx pkg-pr-new publish --template './demo'

0 commit comments

Comments
 (0)