diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6cf59735..9461ff91 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -35,9 +35,9 @@ jobs: run: | ls haxe -cp ./update -D analyzer-optimize -main Update --interp - # - name: Building the game - # run: | - # haxelib run lime build linux + - name: Building the game + run: | + haxelib run lime build linux - name: Artifact upload (entire build) uses: actions/upload-artifact@v2 with: @@ -59,7 +59,7 @@ jobs: for (const cache of caches.data.actions_caches) { if (cache.key == "cache-build-linux") { console.log('Clearing ' + cache.key + '...') - github.rest.actions.deleteActionsCacheById({ + await github.rest.actions.deleteActionsCacheById({ owner: context.repo.owner, repo: context.repo.repo, cache_id: cache.id, @@ -70,7 +70,7 @@ jobs: - name: Cache... again uses: actions/cache@v3 with: - # not caching the bin folder to prevent asset duplication and stuff like that + # caching again since for some reason it doesnt work with the first post cache shit key: cache-build-linux path: | .haxelib/ diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a10365c5..98f7895a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,7 +6,7 @@ on: jobs: build: name: Mac OS Build - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Pulling the new commit uses: actions/checkout@v2 @@ -14,6 +14,8 @@ jobs: uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 + - name: Show current dir + run: pwd - name: Cache Haxelibs and build uses: actions/cache@v3 with: @@ -31,6 +33,7 @@ jobs: haxelib setup ".haxelib" - name: Installing libraries run: | + ls haxe -cp ./update -D analyzer-optimize -main Update --interp - name: Building the game run: | @@ -44,4 +47,34 @@ jobs: uses: actions/upload-artifact@v2 with: name: Update-Mac - path: export/release/mac/bin/CodenameEngine \ No newline at end of file + path: export/release/mac/bin/CodenameEngine + - name: Clear 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: Cache... again + uses: actions/cache@v3 + with: + # caching again since for some reason it doesnt work with the first post cache shit + key: cache-build-mac + path: | + .haxelib/ + export/release/mac/haxe/ + export/release/mac/obj/ + restore-keys: | + cache-build-mac \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 33bed189..1a66594e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,7 +6,7 @@ on: jobs: build: name: Windows Build - runs-on: windows-latest + runs-on: windowsos-latest steps: - name: Pulling the new commit uses: actions/checkout@v2 @@ -14,6 +14,8 @@ jobs: uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 + - name: Show current dir + run: pwd - name: Cache Haxelibs and build uses: actions/cache@v3 with: @@ -27,10 +29,11 @@ jobs: cache-build-windows - name: Setting up Haxelib run: | - if (not exist ".haxelib\") mkdir ".haxelib" + mkdir -p ".haxelib" haxelib setup ".haxelib" - name: Installing libraries run: | + ls haxe -cp ./update -D analyzer-optimize -main Update --interp - name: Building the game run: | @@ -44,4 +47,34 @@ jobs: uses: actions/upload-artifact@v2 with: name: Update-Windows - path: export/release/windows/bin/CodenameEngine.exe \ No newline at end of file + path: export/release/windows/bin/CodenameEngine.exe + - name: Clear 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") { + 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: Cache... again + uses: actions/cache@v3 + with: + # caching again since for some reason it doesnt work with the first post cache shit + key: cache-build-windows + path: | + .haxelib/ + export/release/windows/haxe/ + export/release/windows/obj/ + restore-keys: | + cache-build-windows \ No newline at end of file