Skip to content
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: Install Libraries
run: |
haxelib setup ~/haxelib
yes | haxelib git hxcpp https://github.com/mcagabe19-stuff/hxcpp --quiet
yes | haxelib git lime https://github.com/mcagabe19-stuff/lime --quiet
haxelib install openfl 9.3.3 --quiet
haxelib install flixel 5.6.1 --quiet
haxelib install flixel-addons 3.2.2 --quiet
haxelib install flixel-tools 1.5.1 --quiet
yes | haxelib git hscript-iris https://github.com/crowplexus/hscript-iris dev --quiet
haxelib install tjson 1.4.0 --quiet
yes | haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c072720e0d1236b94afe68e3e --quiet
yes | haxelib git linc_luajit https://github.com/mcagabe19-stuff/linc_luajit-rewriten --quiet
yes | haxelib git hxvlc https://github.com/MAJigsaw77/hxvlc 70e7f5f3e76d526ac6fb8f0e6665efe7dfda589d --quiet --skip-dependencies
yes | haxelib git funkin.vis https://github.com/FunkinCrew/funkVis d5361037efa3a02c4ab20b5bd14ca11e7d00f519 --quiet --skip-dependencies
yes | haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666 --quiet
yes | haxelib git extension-androidtools https://github.com/MAJigsaw77/extension-androidtools 727693f0a76c6e396df675bb0ed95d7639a4db01 --quiet --skip-dependencies
- 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