forked from MobilePorting/CodenameEngine-Mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
name: Mac OS Build | ||
on: | ||
push: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
name: Mac OS Build | ||
permissions: write-all | ||
runs-on: macos-latest | ||
steps: | ||
- name: Pulling the new commit | ||
uses: actions/checkout@v2 | ||
- name: Setting up Haxe | ||
uses: krdlab/setup-haxe@v1.5.1 | ||
with: | ||
haxe-version: 4.2.5 | ||
- name: Restore existing build cache for faster compilation | ||
uses: actions/cache@v3 | ||
with: | ||
# not caching the bin folder to prevent asset duplication and stuff like that | ||
key: cache-build-mac | ||
path: | | ||
.haxelib/ | ||
export/release/macos/haxe/ | ||
export/release/macos/obj/ | ||
restore-keys: | | ||
cache-build-mac | ||
- name: Installing/Updating libraries | ||
run: | | ||
haxe -cp commandline -D analyzer-optimize --run Main setup | ||
- name: Building the game | ||
run: | | ||
haxelib run lime build mac | ||
- name: Tar files | ||
run: tar -zcvf CodenameEngine.tar.gz export/release/macos/bin | ||
- name: Uploading artifact (entire build) | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Codename Engine | ||
path: CodenameEngine.tar.gz | ||
# - name: Uploading artifact (executable) | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: Update-Mac | ||
# path: export/release/macos/bin/CodenameEngine | ||
- 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@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/macos/haxe/ | ||
export/release/macos/obj/ | ||
restore-keys: | | ||
cache-build-mac |