Skip to content

Commit 8b449e5

Browse files
committed
debug builds in actions
yes i know they use different caches, but codename crew is a public organization so it doesnt have size limits, besides there were cons and pros in compiling both in the same jobs, so it doesnt matter much resolves #797
1 parent e6f1fed commit 8b449e5

File tree

5 files changed

+207
-5
lines changed

5 files changed

+207
-5
lines changed

.github/workflows/linux.yml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
name: Linux Builds
12

2-
name: Linux Build
33
on:
44
push:
55
workflow_dispatch:
6+
67
jobs:
78
build:
89
name: Linux Build
@@ -75,3 +76,72 @@ jobs:
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/

.github/workflows/macos.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
name: Mac OS Builds
12

2-
name: Mac OS Build
33
on:
44
push:
55
workflow_dispatch:
6+
67
jobs:
78
build:
89
name: Mac OS Build
@@ -72,3 +73,69 @@ jobs:
7273
.haxelib/
7374
export/release/macos/haxe/
7475
export/release/macos/obj/
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
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/

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
name: Release ${{ github.event.inputs.tag_name }}
185185
draft: true
186186
prerelease: ${{ github.event.inputs.prerelease }}
187-
body: ${{ steps.build_body.outputs.body }}
187+
body: ${{ steps.build_body.outputs.body }}
188188
generate_release_notes: true
189189
files: |
190190
renamed/Codename Engine-Windows.zip

.github/workflows/windows.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
name: Windows Builds
12

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

project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<!-- _________________________________ Engine Settings _______________________________ -->
5151

5252
<!-- Comment this out to disable updates !-->
53-
<define name="UPDATE_CHECKING" unless="web || hl || neko"/>
53+
<define name="UPDATE_CHECKING" unless="web || hl || neko || debug"/>
5454

5555
<!-- Comment this out to disable Discord RPC !-->
5656
<section if="cpp">

0 commit comments

Comments
 (0)