1+ name : Mac OS Builds
12
2- name : Mac OS Build
33on :
44 push :
55 workflow_dispatch :
6+
67jobs :
78 build :
89 name : Mac OS Build
910 permissions : write-all
10- runs-on : macos-13
11+ runs-on : macos-14
1112 steps :
1213 - name : Pulling the new commit
13- uses : actions/checkout@v2
14+ uses : actions/checkout@v4
1415 - name : Setting up Haxe
1516 uses : krdlab/setup-haxe@v2
1617 with :
1718 haxe-version : 4.3.7
1819 - name : Restore existing build cache for faster compilation
19- uses : actions/cache@v3
20+ uses : actions/cache@v4.2.3
2021 with :
2122 # not caching the bin folder to prevent asset duplication and stuff like that
2223 key : cache-build-mac
2324 path : |
2425 .haxelib/
2526 export/release/macos/haxe/
2627 export/release/macos/obj/
27- restore-keys : |
28- cache-build-mac
28+ - run : |
29+ echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
2930 - name : Installing/Updating libraries
3031 run : |
3132 haxe -cp commandline -D analyzer-optimize --run Main setup -s
3233 - name : Building the game
3334 run : |
34- haxelib run lime build mac
35+ arch -x86_64 haxelib run lime build mac
3536 - name : Tar files
3637 run : tar -zcvf CodenameEngine.tar.gz -C export/release/macos/bin .
3738 - name : Uploading artifact (executable)
@@ -64,13 +65,77 @@ jobs:
6465 }
6566 }
6667 - name : Uploading new cache
67- uses : actions/cache@v3
68+ uses : actions/cache@v4.2.3
6869 with :
6970 # caching again since for some reason it doesnt work with the first post cache shit
7071 key : cache-build-mac
7172 path : |
7273 .haxelib/
7374 export/release/macos/haxe/
7475 export/release/macos/obj/
75- restore-keys : |
76- cache-build-mac
76+
77+ # didnt compile debug in the same job or github would have said that job wasn't completed until debug was done too (debug uploads are not essential)
78+ debug_build :
79+ name : Mac OS Debug Build
80+ permissions : write-all
81+ runs-on : macos-14
82+ needs : build # since its low priority, it'll run after, so actions will concentrate first on normal builds
83+ steps :
84+ - name : Pulling the new commit
85+ uses : actions/checkout@v4
86+ - name : Setting up Haxe
87+ uses : krdlab/setup-haxe@v2
88+ with :
89+ haxe-version : 4.3.7
90+ - name : Restore existing build cache for faster compilation
91+ uses : actions/cache@v4.2.3
92+ with :
93+ # not caching the bin folder to prevent asset duplication and stuff like that
94+ key : cache-build-mac-debug
95+ path : |
96+ .haxelib/
97+ export/debug/macos/haxe/
98+ export/debug/macos/obj/
99+ - run : |
100+ echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
101+ - name : Installing/Updating libraries
102+ run : |
103+ haxe -cp commandline -D analyzer-optimize --run Main setup -s
104+ - name : Building the game
105+ run : |
106+ arch -x86_64 haxelib run lime build mac -debug
107+ - name : Tar files
108+ run : tar -zcvf CodenameEngine.tar.gz -C export/debug/macos/bin .
109+ - name : Uploading artifact (entire build)
110+ uses : actions/upload-artifact@v4
111+ with :
112+ name : Codename Engine Debug
113+ path : CodenameEngine.tar.gz
114+ - name : Clearing already existing cache
115+ uses : actions/github-script@v6
116+ with :
117+ script : |
118+ const caches = await github.rest.actions.getActionsCacheList({
119+ owner: context.repo.owner,
120+ repo: context.repo.repo,
121+ })
122+ for (const cache of caches.data.actions_caches) {
123+ if (cache.key == "cache-build-mac-debug") {
124+ console.log('Clearing ' + cache.key + '...')
125+ await github.rest.actions.deleteActionsCacheById({
126+ owner: context.repo.owner,
127+ repo: context.repo.repo,
128+ cache_id: cache.id,
129+ })
130+ console.log("Cache cleared.")
131+ }
132+ }
133+ - name : Uploading new cache
134+ uses : actions/cache@v4.2.3
135+ with :
136+ # caching again since for some reason it doesnt work with the first post cache shit
137+ key : cache-build-mac-debug
138+ path : |
139+ .haxelib/
140+ export/debug/macos/haxe/
141+ export/debug/macos/obj/
0 commit comments