-
-
Notifications
You must be signed in to change notification settings - Fork 662
857 lines (744 loc) · 30 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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# DO NOT EDIT. Generated from /extra/github-actions
# TODO: support skip ci (https://github.community/t/github-actions-does-not-respect-skip-ci/17325/8)
name: CI
on: [push, pull_request]
jobs:
windows64-build:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows64
ARCH: 64
MINGW_ARCH: x86_64
CYG_ROOT: D:\cygwin
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: choco install nsis
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.09 -y
- name: choco install things
shell: pwsh
run: choco install --no-progress curl wget 7zip.portable -y
- name: Prepend Chocolatey path
shell: pwsh
run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
- name: Install Neko from S3
shell: pwsh
run: |
Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
$NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
echo "$NEKOPATH" >> $env:GITHUB_PATH
echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Setup ocaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 4
opam-local-packages: |
haxe.opam
- name: Install dependencies
shell: pwsh
env:
MBEDTLS_VERSION: 2.16.3
run: |
curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 `
https://github.com/Simn/mingw64-mbedtls/releases/download/${{ env.MBEDTLS_VERSION }}/mingw64-${{ env.MINGW_ARCH }}-mbedtls-${{ env.MBEDTLS_VERSION }}-1.tar.xz
${{ env.CYG_ROOT }}\bin\tar.exe -C ${{ env.CYG_ROOT }} -xvf libmbedtls.tar.xz
- name: Install OCaml libraries
shell: pwsh
run: |
Set-PSDebug -Trace 1
# see: https://github.com/aantron/luv/issues/162
$env:PATH="${env:CYG_ROOT}\bin;${env:CYG_ROOT}\usr\x86_64-w64-mingw32\bin;${env:PATH}"
opam install haxe --deps-only
opam list
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: pwsh
run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV
- name: Build Haxe
shell: pwsh
run: |
Set-PSDebug -Trace 1
# stop after any command returns an error
$PSNativeCommandUseErrorActionPreference = $true
$ErrorActionPreference = 'Stop'
opam exec -- make -s -f Makefile.win -j"$env:NUMBER_OF_PROCESSORS" haxe
opam exec -- make -s -f Makefile.win haxelib
opam exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco
cygcheck ./haxe.exe
cygcheck ./haxelib.exe
ls ./out
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: win${{env.ARCH}}Binaries
path: out
linux-build:
runs-on: ubuntu-20.04
env:
PLATFORM: linux64
OPAMYES: 1
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Cache opam
id: cache-opam
uses: actions/cache@v4
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}
- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/include/* /usr/local/include/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Install dependencies
run: |
set -ex
sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2
sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls
sudo apt-get update -qqy
sudo apt-get install -qqy ocaml-nox opam libpcre2-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build
- name: Install OCaml libraries
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
set -ex
opam init # --disable-sandboxing
opam update
opam switch create ${{ matrix.ocaml }}
opam pin add haxe . --no-action
opam install haxe --deps-only --assume-depexts
opam list
ocamlopt -v
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "ADD_REVISION=1" >> $GITHUB_ENV
- name: Build Haxe
run: |
set -ex
eval $(opam env)
opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
opam config exec -- make -s haxelib
make -s package_unix
ls -l out
ldd -v ./haxe
ldd -v ./haxelib
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Build xmldoc
if: matrix.ocaml == '4.08.1'
run: |
set -ex
make -s xmldoc
cat >extra/doc/info.json <<EOL
{
"commit": "$GITHUB_SHA",
"branch": "${{ steps.extract_branch.outputs.branch }}"
}
EOL
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: out
- name: Upload xmldoc artifact
uses: actions/upload-artifact@v4
if: matrix.ocaml == '4.08.1'
with:
name: xmldoc
path: extra/doc
linux-test:
needs: linux-build
runs-on: ubuntu-20.04
env:
PLATFORM: linux64
TEST: ${{matrix.target}}
HXCPP_COMPILE_CACHE: ~/hxcache
HAXE_STD_PATH: /usr/local/share/haxe/std
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
target: [macro, js, hl, cpp, jvm, php, python, lua, flash, neko]
include:
- target: hl
APT_PACKAGES: cmake ninja-build libturbojpeg-dev
- target: cpp
APT_PACKAGES: gcc-multilib g++-multilib
- target: lua
APT_PACKAGES: ncurses-dev
- target: flash
APT_PACKAGES: libglib2.0-0 libgtk2.0-0 libfreetype6 xvfb
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: linuxBinaries
- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/include/* /usr/local/include/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Setup Haxe
run: |
sudo apt install -qqy libmbedtls-dev
set -ex
tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
sudo mkdir -p /usr/local/bin/
sudo mkdir -p /usr/local/share/haxe/
sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
- name: Print Haxe version
run: haxe -version
- name: Setup haxelib
run: |
set -ex
mkdir ~/haxelib
haxelib setup ~/haxelib
- name: Install apt packages
if: matrix.APT_PACKAGES
run: |
set -ex
sudo apt update -qqy
sudo apt install -qqy ${{matrix.APT_PACKAGES}}
- name: Flash setup
if: matrix.target == 'flash'
run: export DISPLAY=:99.0
- name: Test
run: haxe RunCi.hxml
working-directory: ${{github.workspace}}/tests
test-docgen:
needs: linux-build
runs-on: ubuntu-20.04
env:
PLATFORM: linux64
HXCPP_COMPILE_CACHE: ~/hxcache
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: linuxBinaries
path: linuxBinaries
- name: Download xmldoc artifact
uses: actions/download-artifact@v4
with:
name: xmldoc
path: xmldoc
- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/include/* /usr/local/include/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Setup Haxe
run: |
sudo apt install -qqy libmbedtls-dev
set -ex
tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
sudo mkdir -p /usr/local/bin/
sudo mkdir -p /usr/local/share/haxe/
sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
- name: Print Haxe version
run: haxe -version
- name: Setup haxelib
run: |
set -ex
mkdir ~/haxelib
haxelib setup ~/haxelib
- name: Test documentation generation
run: |
set -ex
haxelib git dox https://github.com/HaxeFoundation/dox.git
haxelib git hxtemplo https://github.com/Simn/hxtemplo.git
haxelib git hxargs https://github.com/Simn/hxargs.git
haxelib git markdown https://github.com/dpeek/haxe-markdown.git
haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git
cd $(haxelib libpath hxcpp)/tools/hxcpp
haxe compile.hxml
cd -
haxe dox.hxml
mkdir resources
cp ../../src-json/* resources
cpp/Dox -i ../../xmldoc -ex microsoft -ex javax -theme $(haxelib libpath dox)/themes/default
working-directory: ${{github.workspace}}/tests/docgen
linux-arm64:
runs-on: ubuntu-20.04
permissions:
packages: write
env:
FORCE_COLOR: 1
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Earthly
run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.13/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: actions/checkout@main
with:
submodules: recursive
- name: Set CONTAINER_ vars
run: |
echo "CONTAINER_REG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV;
echo "CONTAINER_TAG=$(echo ${{ github.ref_name }} | sed -e 's/[^A-Za-z0-9\.]/-/g')" >> $GITHUB_ENV;
- name: Build devcontainer
run: earthly --platform=linux/arm64 +devcontainer --IMAGE_NAME="ghcr.io/${CONTAINER_REG}_devcontainer" --IMAGE_TAG="${CONTAINER_TAG}-arm64" --IMAGE_CACHE="ghcr.io/haxefoundation/haxe_devcontainer:development-arm64"
env:
EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
EARTHLY_USE_INLINE_CACHE: true
EARTHLY_SAVE_INLINE_CACHE: true
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "ADD_REVISION=1" >> $GITHUB_ENV
- name: Build
run: earthly --platform=linux/arm64 +build --ADD_REVISION="$ADD_REVISION" --SET_SAFE_DIRECTORY="true"
env:
EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
EARTHLY_REMOTE_CACHE: "ghcr.io/${{env.CONTAINER_REG}}_cache:build-${{env.CONTAINER_TAG}}-arm64"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linuxArm64Binaries
path: out/linux/arm64
mac-build:
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13]
runs-on: ${{ matrix.os }}
env:
PLATFORM: mac${{ matrix.os == 'macos-14' && '-arm64' || '' }}
OPAMYES: 1
MACOSX_DEPLOYMENT_TARGET: 10.13
OCAML_VERSION: 5.1.1
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Cache opam
id: cache-opam
uses: actions/cache@v4
with:
path: ~/.opam/
key: ${{ matrix.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-1
- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/include/* /usr/local/include/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Install dependencies
env:
# For compatibility with macOS 10.13
ZLIB_VERSION: 1.3.1
MBEDTLS_VERSION: 2.28.5
PCRE2_VERSION: 10.42
run: |
set -ex
brew update
brew bundle --file=tests/Brewfile --no-upgrade
curl -L https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz | tar xz
cd zlib-$ZLIB_VERSION
./configure
sudo make && sudo make install
cd ..
curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz
cd mbedtls-$MBEDTLS_VERSION
sudo make && sudo make install
cd ..
curl -L https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz | tar xz
cd pcre2-$PCRE2_VERSION
./configure --enable-unicode --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 --enable-unicode-properties --enable-pcre2grep-libz --enable-pcre2grep-libbz2 --enable-jit
sudo make && sudo make install
cd ..
- name: Install OCaml libraries
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
set -ex
opam init # --disable-sandboxing
opam update
opam switch create ${{env.OCAML_VERSION}}
eval $(opam env)
opam env
opam pin add haxe . --no-action
opam install haxe --deps-only --assume-depexts
opam list
ocamlopt -v
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "ADD_REVISION=1" >> $GITHUB_ENV
- name: Build Haxe
run: |
set -ex
eval $(opam env)
opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre2-8.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe
opam config exec -- make -s haxelib
make -s package_unix package_installer_mac
ls -l out
otool -L ./haxe
otool -L ./haxelib
- name: Upload artifact (x64)
if: runner.arch == 'X64'
uses: actions/upload-artifact@v4
with:
name: macX64Binaries
path: out
- name: Upload artifact (arm)
if: runner.arch == 'ARM64'
uses: actions/upload-artifact@v4
with:
name: macArmBinaries
path: out
windows64-test:
needs: windows64-build
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows64
TEST: ${{matrix.target}}
HXCPP_COMPILE_CACHE: ~/hxcache
ARCH: 64
strategy:
fail-fast: false
matrix:
# TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
target: [macro, js, hl, cpp, jvm, php, python, flash, neko]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: win${{env.ARCH}}Binaries
path: win${{env.ARCH}}Binaries
- name: Install Neko from S3
shell: pwsh
run: |
Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
$NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
echo "$NEKOPATH" >> $env:GITHUB_PATH
echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- uses: actions/setup-node@v4
with:
node-version: 18.17.1
# - name: Quick test
# shell: pwsh
# run: |
# $DOWNLOADDIR="./win$($env:ARCH)Binaries"
# new-item -Name $DOWNLOADDIR -ItemType directory
# Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
- name: Setup Haxe
shell: pwsh
run: |
$DOWNLOADDIR="./win$($env:ARCH)Binaries"
Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
Set-PSDebug -Trace 1
$HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
Write-Host "::add-path::$HAXEPATH"
Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
- name: Print Haxe version
shell: pwsh
run: haxe -version
- name: "Make Python 3 be available as python3 in the cmdline"
shell: pwsh
run: |
Set-PSDebug -Trace 1
$pypath = python -c "import sys; print(sys.executable)"
$py3path = $pypath.replace("python.exe","python3.exe")
cmd /c mklink $py3path $pypath
python3 -V
- name: Install hererocks
if: matrix.target == 'lua'
shell: cmd
run: |
pip install hererocks
hererocks lua53 -l5.3 -rlatest
call lua53/bin/activate
- name: Install wget
if: matrix.target == 'flash'
shell: cmd
run: |
choco install wget
wget --version
- name: Setup haxelib
shell: pwsh
run: |
mkdir "$env:HAXELIB_ROOT"
haxelib setup "$env:HAXELIB_ROOT"
- name: Test
shell: pwsh
run: haxe RunCi.hxml
working-directory: ${{github.workspace}}/tests
mac-build-universal:
needs: mac-build
runs-on: macos-latest
steps:
- name: Checkout the repository
uses: actions/checkout@main
- uses: actions/download-artifact@v4
with:
name: macX64Binaries
path: macX64Binaries
- uses: actions/download-artifact@v4
with:
name: macArmBinaries
path: macArmBinaries
- name: Make universal binary
run: |
set -ex
tar -xf macX64Binaries/*_bin.tar.gz -C macX64Binaries --strip-components=1
tar -xf macArmBinaries/*_bin.tar.gz -C macArmBinaries --strip-components=1
lipo -create -output haxe macX64Binaries/haxe macArmBinaries/haxe
lipo -create -output haxelib macX64Binaries/haxelib macArmBinaries/haxelib
make -s package_unix package_installer_mac PACKAGE_INSTALLER_MAC_ARCH=universal
ls -l out
otool -L ./haxe
otool -L ./haxelib
- name: Upload artifact (universal)
uses: actions/upload-artifact@v4
with:
name: macBinaries
path: out
mac-test:
needs: mac-build-universal
runs-on: macos-13
env:
PLATFORM: mac
TEST: ${{matrix.target}}
HXCPP_COMPILE_CACHE: ~/hxcache
HAXE_STD_PATH: /usr/local/share/haxe/std
strategy:
fail-fast: false
matrix:
target: [macro, js, hl, cpp, jvm, php, python, lua, flash, neko]
include:
- target: hl
BREW_PACKAGES: ninja
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: macBinaries
path: macBinaries
- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/include/* /usr/local/include/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1
- name: Setup Haxe
run: |
# mkdir ./macBinaries
# curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz
set -ex
tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
sudo mkdir -p /usr/local/bin/
sudo mkdir -p /usr/local/share/haxe/
sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
- name: Print Haxe version
run: haxe -version
- name: Setup haxelib
run: |
set -ex
mkdir ~/haxelib
haxelib setup ~/haxelib
- name: Install homebrew packages
if: matrix.BREW_PACKAGES
run: brew install ${{matrix.BREW_PACKAGES}}
- name: Test
run: |
# disable invalid Unicode filenames on APFS
echo "" > sys/compile-fs.hxml
haxe RunCi.hxml
working-directory: ${{github.workspace}}/tests
deploy:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64, mac-test, windows64-test]
runs-on: ubuntu-20.04
steps:
# this is only needed for to get `COMMIT_DATE`...
# maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
# would be faster
- name: Checkout the repository
uses: actions/checkout@main
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Install awscli
run: |
set -ex
sudo apt-get update -qqy
sudo apt-get install -qqy awscli
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Upload binaries
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
AWS_EC2_METADATA_DISABLED: true
run: |
set -ex
COMMIT_HASH_SHORT=${GITHUB_SHA:0:7}
COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"`
FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT}
aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz
aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/${FILE_NAME}.tar.gz
aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz
aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz
aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
- name: Update "latest"
if: github.ref == 'refs/heads/development'
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
AWS_EC2_METADATA_DISABLED: true
run: |
set -ex
aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz
aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/haxe_latest.tar.gz
aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz
aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
# Chocolatey packages have to be named with version number,
# so let's use web redirection to keep the original file name.
[[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
[[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
aws s3 cp ${HXBUILDS_S3ADDR}/haxe/windows64-choco/${FILE_NAME} ${HXBUILDS_S3ADDR}/haxe/windows64-choco/haxe_latest.nupkg --acl public-read --website-redirect "${HXBUILDS_S3PATH}/haxe/windows64-choco/${FILE_NAME}"
deploy_apidoc:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64, mac-test, windows64-test]
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
set -ex
sudo apt-get install -qqy libc6
- name: Download Haxe
uses: actions/download-artifact@v4
with:
name: linuxBinaries
path: linuxBinaries
- name: Setup Haxe
run: |
set -ex
tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
sudo mkdir -p /usr/local/bin/
sudo mkdir -p /usr/local/share/haxe/
sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
- name: Download xmldoc artifact
uses: actions/download-artifact@v4
with:
name: xmldoc
path: xmldoc
- name: Deploy to api.haxe.org
env:
GHP_EMAIL: [email protected]
GHP_USERNAME: Haxe CI Bot
GHP_REMOTE: ${{ secrets.GHP_REMOTE }}
run: |
set -ex
LOCAL="`pwd`/extra/api.haxe.org"
git clone "${GHP_REMOTE}" "${LOCAL}"
haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"