@@ -16,16 +16,53 @@ concurrency:
1616jobs :
1717 deps :
1818 name : Install dependencies
19- uses : ./.github/workflows/base.yml
20- with :
21- command : pnpm install --frozen-lockfile --prefer-offline
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ' 22.x'
26+ - uses : actions/cache@v4
27+ with :
28+ path : dist/
29+ key : ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }}
30+ restore-keys : |
31+ ${{ runner.os }}-build-
32+ - run : pnpm install --frozen-lockfile --prefer-offline
2233
2334 build :
2435 name : Build & check exports
25- needs : [deps]
26- uses : ./.github/workflows/base.yml
27- with :
28- command : npm run build && npm run check-exports
36+ runs-on : ubuntu-latest
37+ steps :
38+ - uses : actions/checkout@v4
39+
40+ - name : Setup Node.js
41+ uses : actions/setup-node@v4
42+ with :
43+ node-version : ' 22.x'
44+
45+ - name : Setup pnpm
46+ uses : pnpm/action-setup@v4
47+
48+ - name : Cache node_modules
49+ uses : actions/cache/restore@v4
50+ with :
51+ fail-on-cache-miss : true
52+ path : node_modules/
53+ key : ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
54+
55+ - name : Cache build
56+ uses : actions/cache/save@v4
57+ with :
58+ path : dist/
59+ key : ${{ runner.os }}-build-${{ github.sha }}
60+
61+ - name : Build
62+ run : npm run build
63+
64+ - name : Check exports
65+ run : npm run check-exports
2966
3067 test :
3168 name : Test
@@ -61,22 +98,40 @@ jobs:
6198 needs : [build, test, lint]
6299 steps :
63100 - uses : actions/checkout@v4
101+
64102 - name : Setup Node.js
65103 uses : actions/setup-node@v4
66104 with :
67105 node-version : ' 22.x'
68- - uses : actions/cache@v4
106+
107+ - name : Cache build
108+ uses : actions/cache/restore@v4
69109 with :
110+ fail-on-cache-miss : true
70111 path : dist/
71- key : ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }}
72- restore-keys : |
73- ${{ runner.os }}-build-
112+ key : ${{ runner.os }}-build-${{ github.sha }}
113+
74114 - run : npm pkg delete scripts
115+
75116 - run : npm pkg delete packageManager
117+
118+ # - run: npm publish --provenance --access public
119+ # env:
120+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
121+
122+ artifact :
123+ name : Artifact
124+ runs-on : ubuntu-latest
125+ needs : [build, test, lint]
126+ steps :
127+ - name : Cache build
128+ uses : actions/cache/restore@v4
129+ with :
130+ fail-on-cache-miss : true
131+ path : dist/
132+ key : ${{ runner.os }}-build-${{ github.sha }}
133+
76134 - uses : actions/upload-artifact@v4
77135 with :
78136 name : build
79137 path : dist/
80- # - run: npm publish --provenance --access public
81- # env:
82- # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
0 commit comments