forked from openfl/lime
-
Notifications
You must be signed in to change notification settings - Fork 3
406 lines (345 loc) · 13.5 KB
/
main.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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
name: CI
on: [push, pull_request]
env:
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
jobs:
check-ndll-releases:
runs-on: ubuntu-18.04
outputs:
ndll_hash: ${{ steps.get_project_hash.outputs.hash }}
released: ${{ steps.check_release.outputs.released }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- id: get_project_hash
shell: bash
run: |
haxelib git filetree-indexer https://github.com/justin-espedal/haxe-filetree-indexer.git --quiet
cd project/tools
read -ra output <<<"$(haxe project-hash.hxml --interp)"
[[ ${output[1]} =~ ^[0-9a-z]{40}$ ]] && echo "::set-output name=hash::${output[1]}" || exit 1
- uses: actions/github-script@v3
id: check_release
env:
INPUT_NDLL_HASH: ${{ steps.get_project_hash.outputs.hash }}
with:
script: |
const ndllHash = core.getInput('ndll_hash', { required: true });
core.info('NDLL Hash: ' + ndllHash);
await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "ndll/"+ndllHash
}).then(data => {
core.setOutput('released', 'true');
}).catch((e) => {
if(e && e.status===404) {
core.setOutput('released', 'false');
} else {
core.setFailed('get release by tag error: ', e.message);
}
});
- name: Create Release
id: create_release
if: steps.check_release.outputs.released == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ format('ndll/{0}', steps.get_project_hash.outputs.hash) }}
release_name: ${{ format('ndll/{0}', steps.get_project_hash.outputs.hash) }}
draft: false
prerelease: true
android-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
- name: Install Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r15c
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime rebuild linux -64 -release -nocolor -verbose -nocffi
- name: Configure Android support
run: |
haxelib run lime config ANDROID_SDK $ANDROID_HOME
haxelib run lime config ANDROID_NDK_ROOT ${{ steps.setup-ndk.outputs.ndk-path }}
haxelib run lime config JAVA_HOME $JAVA_HOME
haxelib run lime config ANDROID_SETUP true
haxelib run lime config
- name: Rebuild Lime
run: |
haxelib run lime rebuild android -release -verbose -nocolor
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find Android -type f -name "*.so" | sed 's/\// /' | while read dir asset; do
zip -j $dir-$asset.zip $dir/$asset
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done
hashlink-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
strategy:
matrix:
os: [ubuntu-18.04, macos-11, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- name: Install system dependencies (Linux)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Rebuild Lime tools (Windows)
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
haxelib dev lime $Env:GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
- name: Rebuild Lime tools (macOS/Linux)
if: ${{ !startsWith(matrix.os, 'windows-') }}
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
- name: Rebuild Lime
shell: bash
run: |
hl_semver="1.12.0"
hl_version="68daa125ad115a1f1d1db65d38e6045858d55013"
hl_url_base="http://static.stencyl.com/downloads/runtimes/HaxeFoundation/hashlink"
case "$(uname -s)" in
CYGWIN*|MINGW32*|MSYS*|MINGW*) hl_platforms=("win32" "win64"); hl_extension="zip" ;;
Darwin) hl_platforms=("darwin"); hl_extension="tar.gz" ;;
*) hl_platforms=("linux-amd64"); hl_extension="tar.gz" ;;
esac
for hl_platform in ${hl_platforms[@]}; do
hl_artifact="hashlink-$hl_semver-$hl_platform.$hl_extension"
if [[ $hl_platform == win* ]]; then
hl_arch="${hl_platform#win}"
else
hl_arch="64"
fi
curl "$hl_url_base/$hl_version/$hl_artifact" -o "$hl_artifact"
case "$hl_extension" in
zip)
unzip "$hl_artifact" -d "hashlink-$hl_platform"
hl_path="$(pwd)/hashlink-$hl_platform/hashlink-${hl_version:0:7}-$hl_platform" ;;
tar.gz)
mkdir "hashlink-$hl_platform" && tar -xzf "$hl_artifact" -C "hashlink-$hl_platform"
hl_path="$(pwd)/hashlink-$hl_platform/hashlink-${hl_version:0:7}-$hl_platform" ;;
esac
haxelib run lime config HASHLINK_PATH "$hl_path" -nocolor -nocffi
haxelib run lime rebuild hl "-$hl_arch" -release -verbose -nocolor -nocffi
done
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find * -type f -name "*.hdll" | sed 's/\// /' | while read dir asset; do
case "$(uname -s)" in
CYGWIN*|MINGW32*|MSYS*|MINGW*) powershell Compress-Archive $dir/$asset $dir-$asset.zip ;;
*) zip -j $dir-$asset.zip $dir/$asset ;;
esac
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done
ios-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime rebuild macos -release -64 -nocolor -verbose -nocffi
- name: Rebuild Lime
run: |
haxelib run lime rebuild ios -release -verbose -nocolor
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find iPhone -type f -name "*.a" | sed 's/\// /' | while read dir asset; do
zip -j $dir-$asset.zip $dir/$asset
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done
linux-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
- name: Rebuild Lime
run: |
haxelib run lime rebuild linux -64 -release -verbose -nocolor
haxelib run lime rebuild linux -32 -release -verbose -nocolor
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find Linux* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do
zip -j $dir-$asset.zip $dir/$asset
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done
macos-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
- name: Rebuild Lime
run: |
haxelib run lime rebuild macos -release -verbose -nocolor
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find Mac* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do
zip -j $dir-$asset.zip $dir/$asset
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done
windows-ndll:
needs: check-ndll-releases
if: needs.check-ndll-releases.outputs.released == 'false'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.1
- name: Install Haxe dependencies
run: |
haxelib install hxcpp --quiet
haxelib install format --quiet
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=C:\.hxcpp" >> $GITHUB_ENV
- name: Rebuild Lime tools
run: |
haxelib dev lime $Env:GITHUB_WORKSPACE
haxelib run lime rebuild tools -nocolor -verbose -nocffi
- name: Rebuild Lime
run: |
haxelib run lime rebuild windows -32 -release -verbose -nocolor
haxelib run lime rebuild windows -64 -release -verbose -nocolor
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }}
shell: bash
run: |
cd ndll
find Windows* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do
powershell Compress-Archive $dir/$asset $dir-$asset.zip
hub release edit -a $dir-$asset.zip#$dir/$asset -m "" "ndll/${INPUT_NDLL_HASH}"
done