Mac OS Builds #1096
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mac OS Builds | |
| on: | |
| push: | |
| workflow_dispatch: | |
| env: | |
| HAXE_VERSION: 4.3.7 | |
| HXCPP_COMPILE_CACHE: ${{ github.workspace }}/.hxcpp_cache | |
| jobs: | |
| build: | |
| name: Mac OS Build | |
| permissions: write-all | |
| runs-on: macos-26 | |
| steps: | |
| - name: Pulling the new commit | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setting up Haxe | |
| uses: krdlab/setup-haxe@v2 | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| # - 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 | |
| # path: | | |
| # .haxelib/ | |
| # export/release/macos/obj/ | |
| - name: Installing/Updating libraries | |
| run: | | |
| brew untap aws/tap | |
| brew install zlib | |
| haxe -cp commandline -D analyzer-optimize --run Main setup -si | |
| - name: Building the game | |
| run: | | |
| haxelib run lime setup -alias -y -nocffi | |
| haxelib run lime rebuild hxcpp | |
| haxelib run lime rebuild tools | |
| haxelib run lime rebuild mac -nocolor | |
| haxelib run lime build mac -DCOMPILE_EXPERIMENTAL | |
| - name: Tar files | |
| run: tar -zcvf CodenameEngine.tar.gz -C export/release/macos/bin . | |
| - name: Uploading artifact (executable) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Codename Engine (Executable Only) | |
| path: export/release/macos/bin/CodenameEngine.app/Contents/MacOS/CodenameEngine | |
| - name: Uploading artifact (entire build) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Codename Engine | |
| path: CodenameEngine.tar.gz | |
| - name: Building the game (debug build) | |
| run: haxelib run lime build mac -debug -DCOMPILE_EXPERIMENTAL | |
| - name: Tar files (debug build) | |
| run: tar -zcvf CodenameEngineDebug.tar.gz -C export/debug/macos/bin . | |
| - name: Uploading artifact (debug executable) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Codename Engine Debug (Executable Only) | |
| path: export/debug/macos/bin/CodenameEngine.app/Contents/MacOS/CodenameEngine | |
| - name: Uploading artifact (entire debug build) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Codename Engine Debug | |
| path: CodenameEngineDebug.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") { | |
| # 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 | |
| # path: | | |
| # .haxelib/ | |
| # export/release/macos/obj/ |