File tree Expand file tree Collapse file tree 4 files changed +53
-35
lines changed Expand file tree Collapse file tree 4 files changed +53
-35
lines changed Original file line number Diff line number Diff line change @@ -61,21 +61,25 @@ jobs:
61
61
- name : Test
62
62
run : esy test
63
63
64
- - name : Get binary path
65
- id : print_binary_path
64
+ - name : (release only) Get artifact filenames
65
+ id : get_filenames
66
+ # if: github.event_name != 'pull_request'
67
+ run : node .github/workflows/get_filenames.js
68
+
69
+ - name : (release only) Get exe
70
+ # if: github.event_name != 'pull_request'
66
71
shell : bash
67
72
run : |
68
73
# from https://stackoverflow.com/a/24848739/617787
69
74
s=$(pwd); d=$(dirname $(esy x which Extract.exe));
70
75
while [ "${d#$s/}" == "${d}" ]
71
- do s=$(dirname $s);b="../${b}"; done;
76
+ do s=$(dirname $s);b="../${b}"; done;
72
77
ESY__BINARY_PATH=${b}${d#$s/}/Extract.exe
73
- echo "ESY__BINARY_PATH: $ESY__BINARY_PATH"
74
- echo "##[set-output name=path;]$ESY__BINARY_PATH"
78
+ mv "$ESY__BINARY_PATH" ${{ steps.get_filenames.outputs.exe_name }}
75
79
76
- - name : (only on release) Upload artifacts ${{ matrix.os }}
77
- if : github.event_name != 'pull_request'
80
+ - name : (release only ) Upload artifact ${{ matrix.os }}
81
+ # if: github.event_name != 'pull_request'
78
82
uses : actions/upload-artifact@v2
79
83
with :
80
- name : ${{ matrix.os }}
81
- path : ${{ steps.print_binary_path .outputs.path }}
84
+ name : ${{ steps.get_filenames.outputs.artifact_name }}
85
+ path : ${{ steps.get_filenames .outputs.exe_name }}
Original file line number Diff line number Diff line change
1
+ const fs = require ( "fs" ) ;
2
+ const os = require ( "os" ) ;
3
+
4
+ const packageJson = fs . readFileSync ( "package.json" ) ;
5
+ const { version } = JSON . parse ( packageJson ) ;
6
+
7
+ const exeName = getExeName ( ) ;
8
+ const platform = getPlatformName ( ) ;
9
+ const artifactName = `bs-react-intl-extractor-${ version } -${ platform } ` ;
10
+
11
+ // For passing output to subsequent GitHub actions
12
+ console . log ( `::set-output name=exe_name::${ exeName } ` ) ;
13
+ console . log ( `::set-output name=artifact_name::${ artifactName } ` ) ;
14
+
15
+ function getPlatformName ( ) {
16
+ const platform = os . platform ( ) ;
17
+
18
+ switch ( platform ) {
19
+ case "linux" :
20
+ return "linux" ;
21
+ case "darwin" :
22
+ return "macos" ;
23
+ case "win32" :
24
+ return "windows" ;
25
+ default :
26
+ throw new Error ( `Unexepected platform ${ platform } ` ) ;
27
+ }
28
+ }
29
+
30
+ function getExeName ( ) {
31
+ const platform = os . platform ( ) ;
32
+
33
+ switch ( platform ) {
34
+ case "win32" :
35
+ return "bs-react-intl-extractor.exe" ;
36
+ default :
37
+ return "bs-react-intl-extractor" ;
38
+ }
39
+ }
Original file line number Diff line number Diff line change 15
15
"scripts" : {
16
16
"test" : " esy x RunTests.exe" ,
17
17
"format" : " scripts/format.sh" ,
18
- "setVersion" : " node scripts/setVersion.js" ,
19
- "zip" : " esy build && node scripts/createZip.js"
18
+ "setVersion" : " node scripts/setVersion.js"
20
19
},
21
20
"dependencies" : {
22
21
"@esy-ocaml/reason" : " ^3.6.0" ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments