-
-
Notifications
You must be signed in to change notification settings - Fork 34
316 lines (259 loc) · 11.7 KB
/
build-dlangui.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
name: DlangUI builds
on: push
env:
BUILD_TYPE: Release
jobs:
build-x86_64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 :dlangui-frontend
- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-dlangui-linux-x86_64"
- name: Put debug symbols in a separate file
run: eu-strip --strip-debug -f "${{github.workspace}}/bin/sideloader-dlangui-linux-x86_64.dbg" "${{github.workspace}}/bin/sideloader-dlangui-linux-x86_64"
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-linux-x86_64
path: |
${{github.workspace}}/bin/sideloader-dlangui-linux-x86_64
${{github.workspace}}/bin/sideloader-dlangui-linux-x86_64.dbg
build-i686:
# Does not work yet
if: false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils gcc-i686-linux-gnu libc6-dev
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 --arch i686-linux-gnu :dlangui-frontend
- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-dlangui-linux-i686"
- name: Put debug symbols in a separate file
run: eu-strip --strip-debug -f "${{github.workspace}}/bin/sideloader-dlangui-linux-i686.dbg" "${{github.workspace}}/bin/sideloader-dlangui-linux-i686"
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-linux-i686
path: |
${{github.workspace}}/bin/sideloader-dlangui-linux-i686
${{github.workspace}}/bin/sideloader-dlangui-linux-i686.dbg
build-aarch64:
# Does not work yet
if: false
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Set-up aarch64 cross-compilation
run: |
mkdir -p $HOME/.ldc/
cat << EOF | tee $HOME/.ldc/ldc2.conf
"aarch64-.*-linux-gnu":
{
switches = [
"-defaultlib=phobos2-ldc,druntime-ldc",
"-gcc=aarch64-linux-gnu-gcc",
];
post-switches = [
"-I$HOME/ldc2-1.32.2-linux-aarch64/import",
];
lib-dirs = [
"$HOME/ldc2-1.32.2-linux-aarch64/lib",
];
};
EOF
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.32.2/ldc2-1.32.2-linux-aarch64.tar.xz
tar -xf ./ldc2-1.32.2-linux-aarch64.tar.xz -C $HOME
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y elfutils gcc-aarch64-linux-gnu
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 --arch aarch64-linux-gnu :dlangui-frontend
- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-dlangui-linux-aarch64"
- name: Put debug symbols in a separate file
run: eu-strip --strip-debug -f "${{github.workspace}}/bin/sideloader-dlangui-linux-aarch64.dbg" "${{github.workspace}}/bin/sideloader-dlangui-linux-aarch64"
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-linux-aarch64
path: |
${{github.workspace}}/bin/sideloader-dlangui-linux-aarch64
${{github.workspace}}/bin/sideloader-dlangui-linux-aarch64.dbg
build-macos-x86_64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Set-up macOS cross-compilation
run: |
mkdir -p $HOME/.ldc/
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
cat << EOF | tee $HOME/.ldc/ldc2.conf
"x86_64-apple-darwin":
{
// default switches injected before all explicit command-line switches
switches = [
"-gcc=clang",
"-linker=lld",
"-Xcc=-target",
"-Xcc=x86_64-apple-darwin",
"-Xcc=-isysroot",
"-Xcc=$HOME/MacOSX11.0.sdk",
"-defaultlib=phobos2-ldc,druntime-ldc",
];
// default switches appended after all explicit command-line switches
post-switches = [
"-I$HOME/ldc2-$LDC_VERSION-osx-x86_64/import",
];
// default directories to be searched for libraries when linking
lib-dirs = [
"$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
];
};
EOF
mkdir $HOME/ldc-macos
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-x86_64.tar.xz
tar -xf ./ldc2-$LDC_VERSION-osx-x86_64.tar.xz -C $HOME
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 --arch x86_64-apple-darwin :dlangui-frontend
- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-dlangui-macOS-x86_64" # TODO make an app bundle
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-macOS-x86_64
path: |
${{github.workspace}}/bin/sideloader-dlangui-macOS-x86_64
build-macos-arm64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Set-up macOS cross-compilation
run: |
mkdir -p $HOME/.ldc/
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
cat << EOF | tee $HOME/.ldc/ldc2.conf
"arm64-apple-macos":
{
// default switches injected before all explicit command-line switches
switches = [
"-gcc=clang",
"-linker=lld",
"-Xcc=-target",
"-Xcc=arm64-apple-macos",
"-Xcc=-isysroot",
"-Xcc=$HOME/MacOSX11.0.sdk",
"-defaultlib=phobos2-ldc,druntime-ldc",
];
// default switches appended after all explicit command-line switches
post-switches = [
"-I$HOME/ldc2-$LDC_VERSION-osx-arm64/import",
];
// default directories to be searched for libraries when linking
lib-dirs = [
"$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
];
};
EOF
mkdir $HOME/ldc-macos
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-arm64.tar.xz
tar -xf ./ldc2-$LDC_VERSION-osx-arm64.tar.xz -C $HOME
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 --arch arm64-apple-macos :dlangui-frontend
- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-dlangui-macOS-arm64" # TODO make an app bundle
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-macOS-arm64
path: |
${{github.workspace}}/bin/sideloader-dlangui-macOS-arm64
build-windows-x86_64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld 7zip
- name: Set-up Windows cross-compilation
run: |
mkdir -p $HOME/.ldc/
cat << EOF | tee $HOME/.ldc/ldc2.conf
"x86_64-.*-windows-msvc":
{
// default switches injected before all explicit command-line switches
switches = [
"-defaultlib=phobos2-ldc,druntime-ldc",
];
// default switches appended after all explicit command-line switches
post-switches = [
"-I$HOME/ldc2-1.33.0-windows-x64/import",
];
// default directories to be searched for libraries when linking
lib-dirs = [
"$HOME/ldc2-1.33.0-windows-x64/lib",
];
};
EOF
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-windows-x64.7z
7z x ./ldc2-1.33.0-windows-x64.7z -o$HOME
- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
- name: Build
run: dub build -b release-debug --compiler=ldc2 --arch x86_64-windows-msvc :dlangui-frontend
- name: Rename
run: |
mv "${{github.workspace}}/bin/sideloader.exe" "${{github.workspace}}/bin/sideloader-dlangui-windows-x86_64.exe"
mv "${{github.workspace}}/bin/sideloader.pdb" "${{github.workspace}}/bin/sideloader-dlangui-windows-x86_64.pdb"
- uses: actions/upload-artifact@v3
with:
name: sideloader-dlangui-windows-x86_64
path: |
${{github.workspace}}/bin/sideloader-dlangui-windows-x86_64.exe
${{github.workspace}}/bin/sideloader-dlangui-windows-x86_64.pdb