1+ name : Linux Builds
12
2- name : Linux Build
33on :
44 push :
55 workflow_dispatch :
6+
67jobs :
78 build :
89 name : Linux Build
7576 .haxelib/
7677 export/release/linux/haxe/
7778 export/release/linux/obj/
79+
80+ # 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)
81+ debug_build :
82+ name : Linux Debug Build
83+ permissions : write-all
84+ runs-on : ubuntu-24.04
85+ needs : build # since its low priority, it'll run after, so actions will concentrate first on normal builds
86+ steps :
87+ - name : Pulling the new commit
88+ uses : actions/checkout@v4
89+ - name : Setting up Haxe
90+ uses : krdlab/setup-haxe@v2
91+ with :
92+ haxe-version : 4.3.7
93+ - name : Restore existing build cache for faster compilation
94+ uses : actions/cache@v4.2.3
95+ with :
96+ # not caching the bin folder to prevent asset duplication and stuff like that
97+ key : cache-build-linux-debug
98+ path : |
99+ .haxelib/
100+ export/debug/linux/haxe/
101+ export/debug/linux/obj/
102+ - run : |
103+ echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
104+ - name : Installing LibVLC
105+ run : |
106+ sudo apt-get install libvlc-dev libvlccore-dev
107+ - name : Installing/Updating libraries
108+ run : |
109+ haxe -cp commandline -D analyzer-optimize --run Main setup -s
110+ - name : Building the game
111+ run : |
112+ haxelib run lime build linux
113+ # - name: Tar files
114+ # run: tar -zcvf CodenameEngine.tar.gz -C export/debug/linux/bin .
115+ - name : Uploading artifact (entire build)
116+ uses : actions/upload-artifact@v4
117+ with :
118+ name : Codename Engine Debug
119+ path : export/debug/linux/bin/
120+ - name : Clearing already existing cache
121+ uses : actions/github-script@v6
122+ with :
123+ script : |
124+ const caches = await github.rest.actions.getActionsCacheList({
125+ owner: context.repo.owner,
126+ repo: context.repo.repo,
127+ })
128+ for (const cache of caches.data.actions_caches) {
129+ if (cache.key == "cache-build-linux-debug") {
130+ console.log('Clearing ' + cache.key + '...')
131+ await github.rest.actions.deleteActionsCacheById({
132+ owner: context.repo.owner,
133+ repo: context.repo.repo,
134+ cache_id: cache.id,
135+ })
136+ console.log("Cache cleared.")
137+ }
138+ }
139+ - name : Uploading new cache
140+ uses : actions/cache@v4.2.3
141+ with :
142+ # caching again since for some reason it doesnt work with the first post cache shit
143+ key : cache-build-linux-debug
144+ path : |
145+ .haxelib/
146+ export/debug/linux/haxe/
147+ export/debug/linux/obj/
0 commit comments