@@ -11,7 +11,8 @@ permissions:
1111
1212env :
1313 GITHUB_ACTIONS : true
14- NODE_VERSION : 20
14+ NODE_VERSION : 22
15+ PNPM_VERSION : 9
1516
1617jobs :
1718 test :
@@ -20,26 +21,28 @@ jobs:
2021 timeout-minutes : 5
2122
2223 steps :
23- - uses : actions/checkout@v3
24+ - uses : actions/checkout@v4
2425
25- - name : Use Node.js ${{ env.NODE_VERSION }}
26- uses : actions/setup-node@v3
26+ - name : Use pnpm ${{ env.PNPM_VERSION }}
27+ uses : pnpm/action-setup@v4
2728 with :
28- node-version : ${{ env.NODE_VERSION }}
29+ version : ${{ env.PNPM_VERSION }}
30+ run_install : false
2931
30- - name : Cache node_modules
31- uses : actions/cache@v3
32+ - name : Use Node.js ${{ env.NODE_VERSION }}
33+ uses : actions/setup-node@v4
3234 with :
33- path : node_modules
34- key : ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
35+ node-version : ${{ env.NODE_VERSION }}
36+ cache : pnpm
37+ cache-dependency-path : ' package.json'
3538
3639 - name : Install dependencies
37- run : npm run clean-install
40+ run : pnpm run clean-install
3841
3942 - name : Build alpine-typescript
40- run : npm run build-dist
43+ run : pnpm run build-dist
4144
42- - uses : actions/upload-artifact@v3
45+ - uses : actions/upload-artifact@v4
4346 with :
4447 name : test-build-output
4548 path : |
5457 timeout-minutes : 5
5558
5659 steps :
57- - uses : actions/checkout@v3
60+ - uses : actions/checkout@v4
5861 with :
5962 sparse-checkout : |
6063 examples/package
6568 mv ./examples/package/* ./
6669 rm -rf ./examples/package
6770
68- - uses : actions/download-artifact@v3
71+ - uses : actions/download-artifact@v4
6972 with :
7073 name : test-build-output
7174 path : ./alpine-typescript
@@ -74,22 +77,24 @@ jobs:
7477 run : |
7578 sed -i 's/file:..\/..\//file:alpine-typescript/g' package.json
7679
77- - name : Use Node.js ${{ env.NODE_VERSION }}
78- uses : actions/setup-node@v3
80+ - name : Use pnpm ${{ env.PNPM_VERSION }}
81+ uses : pnpm/action-setup@v4
7982 with :
80- node-version : ${{ env.NODE_VERSION }}
83+ version : ${{ env.PNPM_VERSION }}
84+ run_install : false
8185
82- - name : Cache node_modules
83- uses : actions/cache@v3
86+ - name : Use Node.js ${{ env.NODE_VERSION }}
87+ uses : actions/setup-node@v4
8488 with :
85- path : node_modules
86- key : ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
89+ node-version : ${{ env.NODE_VERSION }}
90+ cache : pnpm
91+ cache-dependency-path : ' package.json'
8792
8893 - name : Install dependencies
89- run : npm run clean-install
94+ run : pnpm run clean-install
9095
9196 - name : Build package example
92- run : npm run build-dist
97+ run : pnpm run build-dist
9398
9499 test-example-project :
95100 name : Run example project tests
98103 timeout-minutes : 5
99104
100105 steps :
101- - uses : actions/checkout@v3
106+ - uses : actions/checkout@v4
102107 with :
103108 sparse-checkout : |
104109 examples/project
@@ -109,7 +114,7 @@ jobs:
109114 mv ./examples/project/* ./
110115 rm -rf ./examples/project
111116
112- - uses : actions/download-artifact@v3
117+ - uses : actions/download-artifact@v4
113118 with :
114119 name : test-build-output
115120 path : ./alpine-typescript
@@ -118,22 +123,23 @@ jobs:
118123 run : |
119124 sed -i 's/file:..\/..\//file:alpine-typescript/g' package.json
120125
121- - name : Use Node.js ${{ env.NODE_VERSION }}
122- uses : actions/setup-node@v3
126+ - name : Use pnpm ${{ env.PNPM_VERSION }}
127+ uses : pnpm/action-setup@v4
123128 with :
124- node-version : ${{ env.NODE_VERSION }}
129+ version : ${{ env.PNPM_VERSION }}
130+ run_install : false
125131
126- - name : Cache node_modules
127- uses : actions/cache@v3
132+ - name : Use Node.js ${{ env.NODE_VERSION }}
133+ uses : actions/setup-node@v4
128134 with :
129- path : node_modules
130- key : ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
135+ node-version : ${{ env.NODE_VERSION }}
136+ cache : pnpm
131137
132138 - name : Install dependencies
133- run : npm run clean-install
139+ run : pnpm run clean && pnpm add ./alpine-typescript
134140
135141 - name : Build package example
136- run : npm run build-dist
142+ run : pnpm run build-dist
137143
138144 stage :
139145 name : Stage changes as pull request
@@ -144,7 +150,7 @@ jobs:
144150 if : github.event_name == 'push'
145151 steps :
146152 - run : ' echo "Staging dev changes"'
147- - uses : actions/checkout@v3
153+ - uses : actions/checkout@v4
148154 with :
149155 ref : dist
150156
@@ -153,31 +159,33 @@ jobs:
153159 git fetch origin dev:dev
154160 git reset --hard dev
155161
156- - name : Use Node.js ${{ env.NODE_VERSION }}
157- uses : actions/setup-node@v3
162+ - name : Use pnpm ${{ env.PNPM_VERSION }}
163+ uses : pnpm/action-setup@v4
158164 with :
159- node-version : ${{ env.NODE_VERSION }}
165+ version : ${{ env.PNPM_VERSION }}
166+ run_install : false
160167
161- - name : Cache node_modules
162- uses : actions/cache@v3
168+ - name : Use Node.js ${{ env.NODE_VERSION }}
169+ uses : actions/setup-node@v4
163170 with :
164- path : node_modules
165- key : ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
171+ node-version : ${{ env.NODE_VERSION }}
172+ cache : pnpm
173+ cache-dependency-path : ' package.json'
166174
167175 - name : Install dependencies
168- run : npm run clean-install
176+ run : pnpm run clean-install
169177
170178 - name : Build alpine-typescript
171- run : npm run build-dist
179+ run : pnpm run build-dist
172180
173181 - name : Add dist files
174182 run : |
175183 git rm -r --force ./src
176- git add --force ./dist
177- git add --force ./types
184+ git add --force ./dist/*.js
185+ git add --force ./types/*.d.ts
178186
179187 - name : Create Pull Request
180- uses : peter-evans/create-pull-request@v5
188+ uses : peter-evans/create-pull-request@v7
181189 with :
182190 token : ${{ secrets.STAGE_DEPLOY_KEY }}
183191 title : Merge dev changes to dist
0 commit comments