Skip to content

Mobile + Release

Mobile + Release #87

name: Mobile + Release
on: workflow_dispatch
permissions:
contents: write
jobs:
get-commit-hash:
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.get_commit_hash.outputs.COMMIT_HASH }}
steps:
- name: Get latest commit hash
id: get_commit_hash
run: |
commit_hash=${GITHUB_SHA::7}
echo "Latest commit hash is $commit_hash"
echo "::set-output name=COMMIT_HASH::$commit_hash"
Mobile:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Haxe
uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.6
- name: Install Libraries
run: |
haxelib git hxcpp https://github.com/mcagabe19-stuff/hxcpp --quiet
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
haxelib install hscript-iris 1.1.0 --quiet
haxelib install tjson 1.4.0 --quiet
haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c072720e0d1236b94afe68e3e --quiet
haxelib git linc_luajit https://github.com/mcagabe19-stuff/linc_luajit-rewriten --quiet
haxelib install hxvlc 1.8.2 --quiet --skip-dependencies
haxelib git funkin.vis https://github.com/FunkinCrew/funkVis 22b1ce089dd924f15cdc4632397ef3504d464e90 --quiet --skip-dependencies
haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666 --quiet
haxelib git extension-androidtools https://github.com/MAJigsaw77/extension-androidtools df9dfd0cda74e5460ae3afcfff1081c50959ed4a --quiet --skip-dependencies
- name: Configure Android
if: startsWith(matrix.os, 'ubuntu')
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 (Android)
if: startsWith(matrix.os, 'ubuntu')
run: haxelib run lime build android -final -D officialBuild
- name: Compile (iOS)
if: startsWith(matrix.os, 'macos')
run: haxelib run lime build ios -final -nosign -D officialBuild
- name: Make Ipa And Zip For Release
if: startsWith(matrix.os, 'macos')
run: |
cd export/release/ios/build/*-iphoneos
mkdir Payload
mv *.app Payload
zip -r PsychEngine.ipa Payload
zip PsychEngine-iOS.zip PsychEngine.ipa
- name: Upload Artifact (Android)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@main
with:
name: androidBuild
path: export/release/android/bin/app/build/outputs/apk/release/*.apk
if-no-files-found: error
- name: Upload Artifact (iOS)
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@main
with:
name: iOSBuild
path: export/release/ios/build/Release-iphoneos/*.zip
if-no-files-found: error
Releaser:
needs: [get-commit-hash, Mobile]
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Download Android Build
uses: actions/download-artifact@main
with:
name: androidBuild
path: /home/runner
- name: Move Android File
run: mv /home/runner/PsychEngine-release.apk /home/runner/PsychEngine-Android.apk
- name: Download iOS Build
uses: actions/download-artifact@main
with:
name: iOSBuild
path: /home/runner
- name: Publish The Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "devbuild-${{ needs.get-commit-hash.outputs.commit_hash }}"
title: "DevBuild ${{ needs.get-commit-hash.outputs.commit_hash }}"
files: |
/home/runner/*.apk
/home/runner/*.zip