Android Build #76
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 Build | |
on: workflow_dispatch | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
submodules: true | |
- name: Setup Android NDK | |
id: setup-ndk | |
uses: nttld/setup-ndk@main | |
with: | |
ndk-version: r21e | |
- name: Setup Java JDK | |
uses: actions/setup-java@main | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: Setup Haxe | |
uses: krdlab/setup-haxe@master | |
with: | |
haxe-version: 4.2.5 | |
- name: Restore Previous Cache | |
id: cache-debug-build-android-restore | |
uses: actions/cache/restore@main | |
with: | |
path: | | |
.haxelib/ | |
export/release/android/haxe/ | |
export/release/android/obj/ | |
key: cache-android-build | |
- name: Installing Libraries | |
run: | | |
haxelib setup ~/haxelib | |
haxelib install hxcpp 4.2.1 > /dev/null --quiet | |
haxelib install lime 7.9.0 | |
haxelib install openfl 9.1.0 | |
haxelib install flixel 4.11.0 | |
haxelib install flixel-tools | |
haxelib install flixel-ui | |
haxelib install flixel-addons 2.11.0 | |
haxelib install tjson | |
haxelib install hxjsonast | |
haxelib install hxCodec 2.6.1 | |
haxelib git linc_luajit https://github.com/Aly-Ant0/linc_luajit.git | |
haxelib install hscript 2.5.0 | |
haxelib git hscript-ex https://github.com/ianharrigan/hscript-ex | |
haxelib git extension-androidtools https://github.com/Default-name123/oldtools.git | |
haxelib install hxcpp-debug-server | |
haxelib list | |
- name: Configure Android | |
run: | | |
haxelib run lime setup -alias -y | |
haxelib run lime config ANDROID_SDK $ANDROID_HOME | |
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_HOME | |
haxelib run lime config JAVA_HOME $JAVA_HOME | |
haxelib run lime config ANDROID_SETUP true | |
haxelib set flixel-addons 2.11.0 | |
haxelib set flixel 4.11.0 | |
haxelib set openfl 9.1.0 | |
haxelib set lime 7.9.0 | |
haxelib set hxcpp 4.2.1 | |
haxelib set hxCodec 2.6.1 | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: Building | |
run: haxelib run lime build android -final | |
- 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") { | |
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: | | |
.haxelib/ | |
export/release/android/haxe/ | |
export/release/android/obj/ | |
key: cache-android-build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: HumanImposterv2-Android | |
path: export/release/android/bin/app/build/outputs/apk/debug | |
if-no-files-found: warn |