OH WAIT #66
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
name: Android | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
Mobile: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Setup Haxe | |
uses: krdlab/setup-haxe@master | |
with: | |
haxe-version: 4.3.6 | |
- name: Restore Previous Cache | |
id: cache-debug-build-android-restore | |
uses: actions/cache/restore@main | |
with: | |
path: | | |
/home/runner/haxelib/ | |
export/release/android/haxe/ | |
export/release/android/obj/ | |
key: cache-android-build-new | |
- name: Setup Haxelib | |
run: | | |
haxelib setup ~/haxelib | |
- name: Configure Android | |
run: | | |
haxelib run lime config ANDROID_SDK $ANDROID_HOME | |
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_LATEST_HOME | |
haxelib run lime config JAVA_HOME $JAVA_HOME_17_X64 | |
haxelib run lime config ANDROID_SETUP true | |
- name: Compile | |
run: haxelib run lime build android -D officialBuild | |
- name: Clear Previous Cache | |
uses: actions/github-script@main | |
with: | |
script: | | |
try { | |
const caches = await github.rest.actions.getActionsCacheList({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}) | |
if (typeof caches.data.actions_caches != null && caches.data.actions_caches.length > 0) { | |
for (const cache of caches.data.actions_caches) { | |
if (cache.key == "cache-android-build-new") { | |
console.log('Clearing ' + cache.key + '...') | |
await github.rest.actions.deleteActionsCacheById({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
cache_id: cache.id, | |
}) | |
console.log("Previous Cache Cleared!") | |
} | |
} | |
} | |
} catch (error) { | |
console.log(error.message); | |
} | |
- name: Save Current Cache | |
id: cache-release-build-android-save | |
uses: actions/cache/save@main | |
with: | |
path: | | |
/home/runner/haxelib/ | |
export/release/android/haxe/ | |
export/release/android/obj/ | |
key: cache-android-build-new | |
- name: Upload Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: PsychEngine-release | |
path: export/release/android/bin/app/build/outputs/apk/release | |
if-no-files-found: error |