1- name : MacOS Build (ARM64)
1+ name : MacOS Build
22on :
33 push :
44 branches : [ main ]
88 workflow_dispatch :
99
1010 workflow_call :
11- inputs :
12- buildFlags :
13- required : false
14- type : string
11+ inputs :
12+ buildFlags :
13+ required : false
14+ type : string
1515
1616jobs :
1717 build :
18- name : MacOS Build (ARM64 )
18+ name : MacOS Build (${{ matrix.arch.name }} )
1919 permissions : write-all
2020 runs-on : macos-latest
2121
22+ strategy :
23+ matrix :
24+ arch :
25+ - name : ARM64
26+ cacheKey : cache-build-macosarm
27+ compileFlag : -D HXCPP_ARM64
28+ - name : Intel
29+ cacheKey : cache-build-macosintel
30+ compileFlag : -D HXCPP_M64
31+
2232 steps :
2333 - name : Checkout
2434 uses : actions/checkout@main
35+ with :
36+ fetch-depth : 0
2537
2638 - name : Setup Haxe
27- uses : krdlab/setup-haxe@v2
39+ uses : krdlab/setup-haxe@master
2840 with :
2941 haxe-version : 4.3.7
3042
3143 - name : Restore action cache
32- id : cache-build-macosarm-restore
3344 uses : actions/cache/restore@main
3445 with :
35- key : cache-build-macosarm
46+ key : ${{ matrix.arch.cacheKey }}
3647 path : |
3748 .haxelib/
3849 export/release/macos/haxe/
@@ -44,15 +55,15 @@ jobs:
4455 haxelib run hxpkg install --force
4556
4657 - name : Compile
47- run : arch -x86_64 haxelib run lime build macos -64 -D HXCPP_ARM64
58+ run : arch -x86_64 haxelib run lime build macos -64 ${{ matrix.arch.compileFlag }}
4859
4960 - name : Tar files
5061 run : tar -zcvf AlterEngine.tar.gz -C export/release/macos/bin .
5162
5263 - name : Uploading artifact
5364 uses : actions/upload-artifact@main
5465 with :
55- name : Alter Engine
66+ name : Alter Engine (${{ matrix.arch.name }})
5667 path : AlterEngine.tar.gz
5768 if-no-files-found : error
5869
6778 })
6879 if (typeof caches.data.actions_caches != null && caches.data.actions_caches.length > 0) {
6980 for (const cache of caches.data.actions_caches) {
70- if (cache.key == "cache-build-macosarm ") {
81+ if (cache.key == "${{ matrix.arch.cacheKey }} ") {
7182 console.log('Clearing ' + cache.key + '...')
7283 await github.rest.actions.deleteActionsCacheById({
7384 owner: context.repo.owner,
8394 }
8495
8596 - name : Uploading new cache
86- id : cache-build-macosarm-save
8797 uses : actions/cache/save@main
8898 with :
89- key : cache-build-macosarm
99+ key : ${{ matrix.arch.cacheKey }}
90100 path : |
91101 .haxelib/
92102 export/release/macos/haxe/
0 commit comments