jarvis, completely rewrite the workflow #214
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Game | |
| strategy: | |
| matrix: | |
| include: | |
| - target: windows | |
| runs-on: windows-latest | |
| - target: macos | |
| runs-on: macos-latest | |
| - target: linux | |
| runs-on: ubuntu-latest | |
| - target: ios | |
| runs-on: macos-26 | |
| - target: android | |
| runs-on: ubuntu-latest | |
| runs-on: | |
| - ${{matrix.runs-on}} | |
| steps: | |
| - name: Checkout Repository | |
| uses: funkincrew/ci-checkout@main | |
| - name: Setup Haxe | |
| uses: funkincrew/ci-haxe@master | |
| with: | |
| haxe-version: 4.3.7 | |
| - name: Install HMM with Funkin' Patches | |
| run: | | |
| haxelib --debug --never --global git haxelib https://github.com/FunkinCrew/haxelib.git funkin-patches --skip-dependencies | |
| haxelib --debug --never --global git hmm https://github.com/FunkinCrew/hmm funkin-patches | |
| haxelib --debug --never newrepo | |
| - name: Restore HMM Cache | |
| id: hmm-cache | |
| uses: actions/cache@main | |
| with: | |
| path: .haxelib | |
| key: ${{runner.os}}-hmm | |
| - name: Install Dependencies using HMM | |
| run: haxelib --global run hmm install -q | |
| - name: Compile HXCPP Build Tools | |
| run: | | |
| cd .haxelib/hxcpp/git/tools/hxcpp | |
| haxe compile.hxml | |
| cd ../../../../.. | |
| - name: Restore hxcpp cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{runner.temp}}/hxcpp_cache | |
| key: ${{runner.os}}-hxcpp | |
| - name: Configure HXCPP Cache | |
| shell: bash | |
| run: | | |
| echo "HXCPP_COMPILE_CACHE=${{runner.temp}}/hxcpp_cache" >> "$GITHUB_ENV" | |
| echo 'HXCPP_CACHE_MB="4096"' >> "$GITHUB_ENV" | |
| haxelib run hxcpp cache list | |
| - name: Install Linux Dependencies | |
| if: ${{runner.os == 'Linux'}} | |
| run: | | |
| sudo apt-get -y install libvlc-dev libvlccore-dev | |
| - name: Setup Android NDK | |
| uses: nttld/setup-ndk@main | |
| if: ${{matrix.target == 'android'}} | |
| id: ndk | |
| with: | |
| ndk-version: r21e | |
| - name: Setup Java | |
| uses: actions/setup-java@main | |
| if: ${{matrix.target == 'android'}} | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Configure Android | |
| if: ${{matrix.target == 'android'}} | |
| run: | | |
| haxelib run lime config ANDROID_SDK $ANDROID_HOME | |
| haxelib run lime config ANDROID_NDK_ROOT ${{steps.ndk.outputs.ndk-path}} | |
| haxelib run lime config JAVA_HOME $JAVA_HOME | |
| haxelib run lime config ANDROID_SETUP true | |
| - name: Compile the Application | |
| if: ${{matrix.target != 'ios'}} | |
| run: haxelib run lime build ${{matrix.target}} | |
| - name: Compile the Application (No Signing) | |
| if: ${{matrix.target == 'ios'}} | |
| run: haxelib run lime build ios -nosign | |
| - name: Format Artifact String | |
| uses: ASzc/change-string-case-action@v6 | |
| id: artifact-string | |
| with: | |
| string: ${{matrix.target}} | |
| - name: Zip up IPA File | |
| if: ${{matrix.target == 'ios'}} | |
| run: | | |
| cd export/release/ios/build/Release-iphoneos | |
| mkdir Payload | |
| mv *.app Payload | |
| zip -r TechNotDripEngine.ipa Payload | |
| - name: Upload Artifact | |
| if: ${{ matrix.target != 'ios' && matrix.target != 'android' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TechNotDrip-Engine_${{steps.artifact-string.outputs.uppercase}} | |
| path: export/release/${{matrix.target}}/bin/ | |
| - name: Upload Artifact (on iOS) | |
| if: ${{ matrix.target == 'ios' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TechNotDrip-Engine_IOS | |
| path: export/release/ios/build/Release-iphoneos/*.ipa | |
| - name: Upload Artifact (on Android) | |
| if: ${{ matrix.target == 'android' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TechNotDrip-Engine_ANDROID | |
| path: export/release/android/bin/app/build/outputs/apk/debug/*.apk |