File tree Expand file tree Collapse file tree 3 files changed +31
-28
lines changed Expand file tree Collapse file tree 3 files changed +31
-28
lines changed Original file line number Diff line number Diff line change @@ -290,17 +290,20 @@ jobs:
290
290
run : npm pack
291
291
working-directory : packages/std
292
292
293
- - name : Get package info
293
+ - name : Prepare package upload
294
294
# For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
295
- run : node .github/workflows/get_package_info .js ${{ github.event.pull_request.head.sha }}
295
+ run : node .github/workflows/prepare_package_upload .js ${{ github.event.pull_request.head.sha }}
296
296
297
297
- name : " Upload artifact: npm packages"
298
298
uses : actions/upload-artifact@v3
299
299
with :
300
300
name : npm-packages
301
301
path : |
302
- ${{ env.rescript_package }}
303
- ${{ env.stdlib_package }}
302
+ rescript-${{ env.rescript_version }}.tgz
303
+ rescript-std-${{ env.rescript_version }}.tgz
304
+
305
+ outputs :
306
+ rescript_version : ${{ env.rescript_version }}
304
307
305
308
installationTest :
306
309
needs : package
@@ -334,7 +337,7 @@ jobs:
334
337
path : packages/test
335
338
336
339
- name : Install ReScript package
337
- run : npm i rescript-11* .tgz
340
+ run : npm i rescript-${{ needs.package.outputs.rescript_version }} .tgz
338
341
shell : bash
339
342
working-directory : packages/test
340
343
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ const fs = require ( "fs" ) ;
2
+ const os = require ( "os" ) ;
3
+
4
+ const packageSpec = JSON . parse ( fs . readFileSync ( "./package.json" , "utf8" ) ) ;
5
+ const { version } = packageSpec ;
6
+
7
+ const commitHash = process . argv [ 2 ] || process . env . GITHUB_SHA ;
8
+ const commitHashShort = commitHash . substring ( 0 , 7 ) ;
9
+
10
+ fs . renameSync (
11
+ `rescript-${ version } .tgz` ,
12
+ `rescript-${ version } -${ commitHashShort } .tgz`
13
+ ) ;
14
+ fs . renameSync (
15
+ `packages/std/rescript-std-${ version } .tgz` ,
16
+ `rescript-std-${ version } -${ commitHashShort } .tgz`
17
+ ) ;
18
+
19
+ // Pass information to subsequent GitHub actions
20
+ fs . appendFileSync (
21
+ process . env . GITHUB_ENV ,
22
+ `rescript_version=${ version } -${ commitHashShort } ${ os . EOL } `
23
+ ) ;
You can’t perform that action at this time.
0 commit comments