This repository was archived by the owner on Dec 19, 2025. It is now read-only.
opp #41
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 and Notify | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| confirm: | |
| description: "Confirm to proceed with the build?" | |
| required: true | |
| type: boolean | |
| Mobile: | |
| description: "Include Android and iOS builds?" | |
| required: true | |
| type: boolean | |
| env: | |
| ARGS: "-D officialBuild -D NotDeveloper" | |
| HAXE_VERSION: 4.3.6 | |
| jobs: | |
| confirm: | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.confirm == 'true' }} | |
| name: Confirm Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Confirm Build | |
| run: echo "Build confirmed. Proceeding with the build." | |
| setup-haxe: | |
| name: Setup and Cache Haxe Dependencies | |
| runs-on: ubuntu-latest | |
| needs: confirm | |
| steps: | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.haxelib | |
| key: ${{ runner.os }}-haxe-${{ hashFiles('**/*.hxml') }} | |
| Computer: | |
| name: Computer | |
| runs-on: ubuntu-latest | |
| needs: setup-haxe | |
| steps: | |
| - name: Setup Computer | |
| run: echo "Computer setup complete." | |
| shell: bash | |
| buildLinux: | |
| name: Build on Linux | |
| runs-on: ubuntu-latest | |
| needs: Computer | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - uses: krdlab/setup-haxe@master | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libvlc-dev libvlccore-dev | |
| haxelib setup ~/haxelib | |
| haxelib install hxcpp --quiet | |
| chmod +x ./setup/unix.sh | |
| ./setup/unix.sh | |
| - run: echo "${{ github.run_id }}" > VERSION | |
| - run: haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $ARGS | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Linux Build | |
| path: 'export/release/linux/bin' | |
| buildWindows: | |
| name: Build on Windows | |
| runs-on: windows-latest | |
| needs: Computer | |
| strategy: | |
| matrix: | |
| arch: [64, 32] | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - uses: krdlab/setup-haxe@master | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - run: | | |
| haxelib setup C:/haxelib | |
| haxelib install hxcpp --quiet | |
| setup\windows.bat | |
| shell: cmd | |
| - run: echo "${{ github.run_id }}" > VERSION | |
| shell: bash | |
| - run: | | |
| haxelib run lime build windows ${{ matrix.arch == 32 && '-32 -D 32bits' || '' }} --app-version="4.0.0-${{ github.run_id }}" $ARGS | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Windows Build (x${{ matrix.arch }}) | |
| path: export/${{ matrix.arch == 64 && 'release' || '32bit' }}/windows/bin | |
| buildMac: | |
| name: Build on macOS (Universal) | |
| runs-on: macos-13 | |
| needs: Computer | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - uses: krdlab/setup-haxe@master | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - run: | | |
| haxelib setup ~/haxelib | |
| haxelib install hxcpp --quiet | |
| haxelib install lime --quiet | |
| haxelib run lime rebuild lime mac -64 | |
| haxelib run lime rebuild lime mac -Dmac-catalyst -Dmac-arm64 | |
| chmod +x ./setup/unix.sh | |
| ./setup/unix.sh | |
| - run: echo "${{ github.run_id }}" > VERSION | |
| - run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" $ARGS | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macOS Build | |
| path: export/release/macos/bin | |
| Mobile: | |
| name: Mobile | |
| runs-on: ubuntu-latest | |
| needs: setup-haxe | |
| if: ${{ github.event.inputs.Mobile == 'true' }} | |
| steps: | |
| - name: Include Mobile Builds | |
| run: echo "Mobile builds are included." | |
| shell: bash | |
| buildAndroid: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| needs: Mobile | |
| if: ${{ github.event.inputs.Mobile == 'true' }} | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - uses: krdlab/setup-haxe@master | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - uses: android-actions/setup-android@v3 | |
| - run: | | |
| haxelib setup ~/haxelib | |
| haxelib install hxcpp --quiet | |
| haxelib install lime --quiet | |
| haxelib install openfl --quiet | |
| chmod +x ./setup/unix.sh | |
| ./setup/unix.sh | |
| - run: echo "${{ github.run_id }}" > VERSION | |
| - run: | | |
| lime setup android | |
| haxelib run lime build android --app-version="4.0.0-${{ github.run_id }}" $ARGS | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Android Build | |
| path: export/release/android/bin | |
| buildiOS: | |
| name: Build iOS | |
| runs-on: macos-13 | |
| needs: Mobile | |
| if: ${{ github.event.inputs.Mobile == 'true' }} | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - uses: krdlab/setup-haxe@master | |
| with: | |
| haxe-version: ${{ env.HAXE_VERSION }} | |
| - run: | | |
| haxelib setup ~/haxelib | |
| haxelib install hxcpp --quiet | |
| haxelib install lime --quiet | |
| haxelib install openfl --quiet | |
| chmod +x ./setup/unix.sh | |
| ./setup/unix.sh | |
| - run: echo "${{ github.run_id }}" > VERSION | |
| - run: haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $ARGS | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: iOS Build | |
| path: export/release/ios/bin/ | |
| notifyDiscord: | |
| name: π£ Notify Discord | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - buildLinux | |
| - buildWindows | |
| - buildMac | |
| - buildAndroid | |
| - buildiOS | |
| steps: | |
| - name: Send Discord Notification | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| COMMIT_URL: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | |
| BRANCH: ${{ github.ref_name }} | |
| run: | | |
| check() { | |
| case "$1" in | |
| success) echo "β Passed";; | |
| skipped) echo "βͺ Skipped";; | |
| *) echo "β Failed";; | |
| esac | |
| } | |
| STATUS_LINUX=$(check ${{ needs.buildLinux.result }}) | |
| STATUS_WIN=$(check ${{ needs.buildWindows.result }}) | |
| STATUS_MAC=$(check ${{ needs.buildMac.result }}) | |
| STATUS_ANDROID=$(check ${{ needs.buildAndroid.result }}) | |
| STATUS_IOS=$(check ${{ needs.buildiOS.result }}) | |
| TITLE="β Build Successful" | |
| COLOR=65280 | |
| for status in "$STATUS_LINUX" "$STATUS_WIN" "$STATUS_MAC" "$STATUS_ANDROID" "$STATUS_IOS"; do | |
| [[ "$status" == "β Failed" ]] && TITLE="β Build Failed" && COLOR=16711680 && break | |
| done | |
| CONTENT="**Linux**: $STATUS_LINUX\n**Windows**: $STATUS_WIN\n**macOS**: $STATUS_MAC\n**Android**: $STATUS_ANDROID\n**iOS**: $STATUS_IOS" | |
| curl -H "Content-Type: application/json" -X POST -d "{ | |
| \"username\": \"GitHub Build Report\", | |
| \"embeds\": [{ | |
| \"title\": \"$TITLE\", | |
| \"description\": \"$CONTENT\", | |
| \"color\": $COLOR, | |
| \"fields\": [ | |
| { \"name\": \"π Workflow Run\", \"value\": \"[View Run]($RUN_URL)\" }, | |
| { \"name\": \"π¦ Branch\", \"value\": \"$BRANCH\", \"inline\": true }, | |
| { \"name\": \"π Commit\", \"value\": \"[View Commit]($COMMIT_URL)\", \"inline\": true } | |
| ], | |
| \"footer\": { \"text\": \"GitHub Actions β’ ${{ github.repository }}\" }, | |
| \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\" | |
| }] | |
| }" $DISCORD_WEBHOOK |