-
-
Notifications
You must be signed in to change notification settings - Fork 150
71 lines (54 loc) · 2.06 KB
/
check-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Manual Check Publish
on:
workflow_dispatch: # 使得该工作流可以通过 GitHub UI 手动触发
jobs:
test-jslib-js:
name: Test jslib with JS projects
runs-on: ubuntu-latest # 在 Ubuntu 上运行
strategy:
matrix:
node-version: [18, 20, 22] # 测试不同的 Node.js 版本
steps:
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }} # 使用不同的 Node.js 版本
- name: Create new JS project
run: echo js-project | npx @js-lib/cli new --npmname js-project --umdname js-project --username yanhaijing --type js --lang en --manager npm
- name: Run lint in JS project
working-directory: ./js-project
run: npm run lint
- name: Run tests in JS project
working-directory: ./js-project
run: npm run test
- name: Build JS project
working-directory: ./js-project
run: npm run build
- name: Update JS project
working-directory: ./js-project
run: jslib update
test-jslib-ts:
name: Test jslib with TS projects
runs-on: ubuntu-latest # 在 Ubuntu 上运行
strategy:
matrix:
node-version: [18, 20, 22] # 测试不同的 Node.js 版本
steps:
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }} # 使用不同的 Node.js 版本
- name: Create new TS project
run: echo ts-project | npx @js-lib/cli new --npmname ts-project --umdname ts-project --username yanhaijing --type ts --lang en --manager npm
- name: Run lint in JS project
working-directory: ./ts-project
run: npm run lint
- name: Run tests in JS project
working-directory: ./ts-project
run: npm run test
- name: Build JS project
working-directory: ./ts-project
run: npm run build
- name: Update JS project
working-directory: ./ts-project
run: jslib update