Skip to content

Commit c2b3355

Browse files
committed
ci: refactor GitHub Actions and add new workflows
1 parent c590c29 commit c2b3355

File tree

6 files changed

+153
-35
lines changed

6 files changed

+153
-35
lines changed

.github/workflows/core_release.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: create-uni release CI
22

33
on:
44
push:
@@ -8,19 +8,34 @@ on:
88
- 'packages/core/**'
99

1010
jobs:
11-
12-
Release_npm:
11+
release:
1312
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/checkout@v4
16-
- uses: pnpm/action-setup@v2
17-
- uses: actions/setup-node@v4
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Setup node
22+
uses: actions/setup-node@v4
1823
with:
19-
node-version: 18
20-
cache: pnpm
21-
registry-url: https://registry.npmjs.org
22-
- run: corepack enable
23-
- run: pnpm install
24-
- run: pnpm publish --access public --no-git-checks
24+
node-version: 20
25+
registry-url: https://registry.npmjs.com/
26+
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
- name: Install Dependencies
31+
run: pnpm i --frozen-lockfile
32+
33+
- name: PNPM build
34+
working-directory: packages/core
35+
run: pnpm run build
36+
37+
- name: Publish to NPM
38+
working-directory: packages/core
39+
run: pnpm -r publish --access public --no-git-checks
2540
env:
2641
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/core_test.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,6 @@ on:
1818
- .github/workflows/core_test.yml
1919

2020
jobs:
21-
lint:
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v4
25-
26-
- name: Install pnpm
27-
uses: pnpm/action-setup@v2
28-
29-
- name: Set node
30-
uses: actions/setup-node@v4
31-
with:
32-
node-version: 18.x
33-
cache: pnpm
34-
35-
- name: Setup
36-
run: npm i -g @antfu/ni
37-
38-
- name: Install
39-
run: nci
40-
41-
- name: Lint
42-
run: nr lint
43-
4421
build:
4522
runs-on: ${{ matrix.os }}
4623

.github/workflows/info_release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: create-uni/info release CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
paths:
8+
- 'packages/info/**'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Setup node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
registry-url: https://registry.npmjs.com/
26+
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
- name: Install Dependencies
31+
run: pnpm i --frozen-lockfile
32+
33+
- name: PNPM build
34+
working-directory: packages/info
35+
run: pnpm run build
36+
37+
- name: Publish to NPM
38+
working-directory: packages/info
39+
run: pnpm -r publish --access public --no-git-checks
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/info_test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: create-uni/info Test CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags-ignore:
8+
- 'v*'
9+
paths:
10+
- 'packages/info/**'
11+
- .github/workflows/info_test.yml
12+
13+
pull_request:
14+
branches:
15+
- main
16+
paths:
17+
- 'packages/info/**'
18+
- .github/workflows/info_test.yml
19+
20+
jobs:
21+
test:
22+
runs-on: ${{ matrix.os }}
23+
24+
strategy:
25+
matrix:
26+
node: [18.x, 20.x]
27+
os: [windows-latest, macos-latest]
28+
fail-fast: false
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Install pnpm
34+
uses: pnpm/action-setup@v2
35+
36+
- name: Set node ${{ matrix.node }}
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: ${{ matrix.node }}
40+
cache: pnpm
41+
42+
- name: Setup
43+
run: npm i -g @antfu/ni
44+
45+
- name: Install
46+
run: nci
47+
48+
- name: Build
49+
run: nr build:info
50+
51+
- name: Test
52+
run: node ./packages/info/dist/outfile.cjs all

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v2
15+
16+
- name: oxLint
17+
run: pnpm dlx oxlint@latest
18+
19+
- name: Set node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 18.x
23+
cache: pnpm
24+
25+
- name: Setup
26+
run: npm i -g @antfu/ni
27+
28+
- name: Install
29+
run: nci
30+
31+
- name: Lint
32+
run: nr lint

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"dev:gui": "turbo dev --filter=./packages/gui",
3030
"dev:info": "turbo dev --filter=./packages/info",
3131
"build:core": "cd ./packages/core && pnpm build",
32+
"build:info": "cd ./packages/info && pnpm build",
3233
"dev": "turbo run dev",
3334
"build": "turbo build",
3435
"lint": "eslint .",

0 commit comments

Comments
 (0)