@@ -12,16 +12,55 @@ concurrency:
12
12
cancel-in-progress : true
13
13
14
14
jobs :
15
- test :
15
+ # Build statically linked Linux binaries in an Alpine-based Docker container
16
+ # See https://ocamlpro.com/blog/2021_09_02_generating_static_and_portable_executables_with_ocaml
17
+ # for more info.
18
+ # The container already comes with all required tools pre-installed
19
+ # (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
20
+ build-linux :
21
+ strategy :
22
+ fail-fast : false
23
+ matrix :
24
+ os : [
25
+ ubuntu-latest, # x64
26
+ buildjet-2vcpu-ubuntu-2204-arm # ARM
27
+ ]
28
+ include :
29
+ - os : ubuntu-latest
30
+ artifact-folder : linux
31
+ - os : buildjet-2vcpu-ubuntu-2204-arm
32
+ artifact-folder : linuxarm64
33
+
34
+ runs-on : ${{matrix.os}}
35
+
36
+ steps :
37
+ - name : Checkout
38
+ uses : actions/checkout@v4
39
+
40
+ - name : Build
41
+ uses : docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.19-ocaml-5.1.1-01
42
+ with :
43
+ args : opam exec -- make
44
+
45
+ - name : Compress files
46
+ run : |
47
+ mkdir ${{matrix.artifact-folder}}
48
+ mv rescript-editor-analysis.exe rescript-tools.exe ${{matrix.artifact-folder}}
49
+ tar -cvf binary.tar ${{matrix.artifact-folder}}
50
+
51
+ - name : " Upload artifacts"
52
+ uses : actions/upload-artifact@v4
53
+ with :
54
+ name : ${{matrix.artifact-folder}}
55
+ path : binary.tar
56
+
57
+ build :
16
58
strategy :
17
59
fail-fast : false
18
60
matrix :
19
- # Stay on the oldest Ubuntu version that's still supported by Github Actions
20
- # to avoid glibc incompatibilities as far as possible.
21
61
os : [
22
62
macos-13, # x64
23
63
macos-14, # ARM
24
- ubuntu-20.04,
25
64
windows-latest,
26
65
]
27
66
# syntax explanation:
31
70
artifact-folder : darwin
32
71
- os : macos-14
33
72
artifact-folder : darwinarm64
34
- - os : ubuntu-20.04
35
- artifact-folder : linux
36
73
- os : windows-latest
37
74
artifact-folder : win32
38
75
@@ -110,7 +147,9 @@ jobs:
110
147
path : binary.tar
111
148
112
149
package :
113
- needs : test
150
+ needs :
151
+ - build
152
+ - build-linux
114
153
runs-on : ubuntu-20.04
115
154
116
155
steps :
@@ -125,31 +164,39 @@ jobs:
125
164
- run : npm ci
126
165
- run : npm run compile
127
166
128
- - name : Download MacOS binary
167
+ - name : Download MacOS binaries
129
168
uses : actions/download-artifact@v4
130
169
with :
131
170
name : macos-13
132
171
path : binaries
133
172
- run : tar -xvf binary.tar
134
173
working-directory : binaries
135
174
136
- - name : Download MacOS ARM binary
175
+ - name : Download MacOS ARM binaries
137
176
uses : actions/download-artifact@v4
138
177
with :
139
178
name : macos-14
140
179
path : binaries
141
180
- run : tar -xvf binary.tar
142
181
working-directory : binaries
143
182
144
- - name : Download Linux binary
183
+ - name : Download Linux binaries
184
+ uses : actions/download-artifact@v4
185
+ with :
186
+ name : linux
187
+ path : binaries
188
+ - run : tar -xvf binary.tar
189
+ working-directory : binaries
190
+
191
+ - name : Download Linux ARM binaries
145
192
uses : actions/download-artifact@v4
146
193
with :
147
- name : ubuntu-20.04
194
+ name : linuxarm64
148
195
path : binaries
149
196
- run : tar -xvf binary.tar
150
197
working-directory : binaries
151
198
152
- - name : Download Windows binary
199
+ - name : Download Windows binaries
153
200
uses : actions/download-artifact@v4
154
201
with :
155
202
name : windows-latest
0 commit comments