From 8b449e590fa6acce232506a6597cf3f0c7cb904f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Tue, 23 Dec 2025 01:42:55 +0100 Subject: [PATCH] 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 --- .github/workflows/linux.yml | 72 ++++++++++++++++++++++++++++++++++- .github/workflows/macos.yml | 69 ++++++++++++++++++++++++++++++++- .github/workflows/release.yml | 2 +- .github/workflows/windows.yml | 67 +++++++++++++++++++++++++++++++- project.xml | 2 +- 5 files changed, 207 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index aeedd097..3ba034e7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,8 +1,9 @@ +name: Linux Builds -name: Linux Build on: push: workflow_dispatch: + jobs: build: name: Linux Build @@ -75,3 +76,72 @@ jobs: .haxelib/ export/release/linux/haxe/ export/release/linux/obj/ + +# 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) + debug_build: + name: Linux Debug Build + permissions: write-all + runs-on: ubuntu-24.04 + needs: build # since its low priority, it'll run after, so actions will concentrate first on normal builds + steps: + - name: Pulling the new commit + uses: actions/checkout@v4 + - name: Setting up Haxe + uses: krdlab/setup-haxe@v2 + with: + haxe-version: 4.3.7 + - name: Restore existing build cache for faster compilation + uses: actions/cache@v4.2.3 + with: + # not caching the bin folder to prevent asset duplication and stuff like that + key: cache-build-linux-debug + path: | + .haxelib/ + export/debug/linux/haxe/ + export/debug/linux/obj/ + - run: | + echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV + - name: Installing LibVLC + run: | + sudo apt-get install libvlc-dev libvlccore-dev + - name: Installing/Updating libraries + run: | + haxe -cp commandline -D analyzer-optimize --run Main setup -s + - name: Building the game + run: | + haxelib run lime build linux + # - name: Tar files + # run: tar -zcvf CodenameEngine.tar.gz -C export/debug/linux/bin . + - name: Uploading artifact (entire build) + uses: actions/upload-artifact@v4 + with: + name: Codename Engine Debug + path: export/debug/linux/bin/ + - name: Clearing already existing cache + uses: actions/github-script@v6 + with: + script: | + const caches = await github.rest.actions.getActionsCacheList({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + for (const cache of caches.data.actions_caches) { + if (cache.key == "cache-build-linux-debug") { + console.log('Clearing ' + cache.key + '...') + await github.rest.actions.deleteActionsCacheById({ + owner: context.repo.owner, + repo: context.repo.repo, + cache_id: cache.id, + }) + console.log("Cache cleared.") + } + } + - name: Uploading new cache + uses: actions/cache@v4.2.3 + with: + # caching again since for some reason it doesnt work with the first post cache shit + key: cache-build-linux-debug + path: | + .haxelib/ + export/debug/linux/haxe/ + export/debug/linux/obj/ \ No newline at end of file diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 92abcd45..05b1c794 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,8 +1,9 @@ +name: Mac OS Builds -name: Mac OS Build on: push: workflow_dispatch: + jobs: build: name: Mac OS Build @@ -72,3 +73,69 @@ jobs: .haxelib/ export/release/macos/haxe/ export/release/macos/obj/ + +# 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) + debug_build: + name: Mac OS Debug Build + permissions: write-all + runs-on: macos-14 + needs: build # since its low priority, it'll run after, so actions will concentrate first on normal builds + steps: + - name: Pulling the new commit + uses: actions/checkout@v4 + - name: Setting up Haxe + uses: krdlab/setup-haxe@v2 + with: + haxe-version: 4.3.7 + - name: Restore existing build cache for faster compilation + uses: actions/cache@v4.2.3 + with: + # not caching the bin folder to prevent asset duplication and stuff like that + key: cache-build-mac-debug + path: | + .haxelib/ + export/debug/macos/haxe/ + export/debug/macos/obj/ + - run: | + echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV + - name: Installing/Updating libraries + run: | + haxe -cp commandline -D analyzer-optimize --run Main setup -s + - name: Building the game + run: | + arch -x86_64 haxelib run lime build mac + - name: Tar files + run: tar -zcvf CodenameEngine.tar.gz -C export/debug/macos/bin . + - name: Uploading artifact (entire build) + uses: actions/upload-artifact@v4 + with: + name: Codename Engine Debug + path: CodenameEngine.tar.gz + - name: Clearing already existing cache + uses: actions/github-script@v6 + with: + script: | + const caches = await github.rest.actions.getActionsCacheList({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + for (const cache of caches.data.actions_caches) { + if (cache.key == "cache-build-mac-debug") { + console.log('Clearing ' + cache.key + '...') + await github.rest.actions.deleteActionsCacheById({ + owner: context.repo.owner, + repo: context.repo.repo, + cache_id: cache.id, + }) + console.log("Cache cleared.") + } + } + - name: Uploading new cache + uses: actions/cache@v4.2.3 + with: + # caching again since for some reason it doesnt work with the first post cache shit + key: cache-build-mac-debug + path: | + .haxelib/ + export/debug/macos/haxe/ + export/debug/macos/obj/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8113c7bf..d84660ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -184,7 +184,7 @@ jobs: name: Release ${{ github.event.inputs.tag_name }} draft: true prerelease: ${{ github.event.inputs.prerelease }} - body: ${{ steps.build_body.outputs.body }} + body: ${{ steps.build_body.outputs.body }} generate_release_notes: true files: | renamed/Codename Engine-Windows.zip diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9815a3e7..3c4268b9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,8 +1,9 @@ +name: Windows Builds -name: Windows Build on: push: workflow_dispatch: + jobs: build: name: Windows Build @@ -70,3 +71,67 @@ jobs: .haxelib/ export/release/windows/haxe/ export/release/windows/obj/ + +# 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) + debug_build: + name: Windows Debug Build + permissions: write-all + runs-on: windows-latest + needs: build # since its low priority, it'll run after, so actions will concentrate first on normal builds + steps: + - name: Pulling the new commit + uses: actions/checkout@v4 + - name: Setting up Haxe + uses: krdlab/setup-haxe@v2 + with: + haxe-version: 4.3.7 + - name: Restore existing build cache for faster compilation + uses: actions/cache@v4.2.3 + with: + # not caching the bin folder to prevent asset duplication and stuff like that + key: cache-build-windows-debug + path: | + .haxelib/ + export/debug/windows/haxe/ + export/debug/windows/obj/ + - run: | + echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV + - name: Installing/Updating libraries + run: | + haxe -cp commandline -D analyzer-optimize --run Main setup -s --no-vscheck + - name: Building the game + run: | + haxelib run lime build windows -debug + - name: Uploading artifact (entire build) + uses: actions/upload-artifact@v4 + with: + name: Codename Engine Debug + path: export/debug/windows/bin + - name: Clearing already existing cache + uses: actions/github-script@v6 + with: + script: | + const caches = await github.rest.actions.getActionsCacheList({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + for (const cache of caches.data.actions_caches) { + if (cache.key == "cache-build-windows-debug") { + console.log('Clearing ' + cache.key + '...') + await github.rest.actions.deleteActionsCacheById({ + owner: context.repo.owner, + repo: context.repo.repo, + cache_id: cache.id, + }) + console.log("Cache cleared.") + } + } + - name: Uploading new cache + uses: actions/cache@v4.2.3 + with: + # caching again since for some reason it doesnt work with the first post cache shit + key: cache-build-windows-debug + path: | + .haxelib/ + export/debug/windows/haxe/ + export/debug/windows/obj/ \ No newline at end of file diff --git a/project.xml b/project.xml index 3d6399a1..480cfc95 100644 --- a/project.xml +++ b/project.xml @@ -50,7 +50,7 @@ - +