-
-
Notifications
You must be signed in to change notification settings - Fork 162
93 lines (87 loc) · 2.32 KB
/
build.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: build
on:
pull_request:
paths:
- 'src/**'
- 'test/**'
- 'test-error/**'
- 'test-esm/**'
- 'package.json'
- '.github/workflows/build.yml'
jobs:
Build-and-Upload-to-pkg-pr-new-and-artifactory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- name: remove `private=true` from package.json
run: |
jq 'del(.private)' package.json > package.json.tmp
mv package.json.tmp package.json
- name: upload to pkg.pr.now
run: npx pkg-pr-new publish --compact
- name: Upload tgz for Artifactory
uses: actions/upload-artifact@v4
with:
name: build-result
path: |
*.tgz
src
lib
NodeJS:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, lts/*]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- run: npm run test
Bun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- run: npm run test:bun
action-timeline:
needs:
- Build-and-Upload-to-pkg-pr-new-and-artifactory
- NodeJS
- Bun
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: Kesin11/actions-timeline@v2