|
| 1 | +# GitHub Actions Workflow for Building Haxe Project |
| 2 | +# Improved for readability, maintainability, and efficiency |
| 3 | + |
| 4 | +name: Build |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ main ] |
| 9 | + pull_request: |
| 10 | + branches: [ main ] |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + buildLinux: |
| 15 | + name: ✨ Build on Linux |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout Code |
| 20 | + uses: actions/checkout@v4.1.7 |
| 21 | + |
| 22 | + - name: Setup Haxe |
| 23 | + uses: krdlab/setup-haxe@master |
| 24 | + with: |
| 25 | + haxe-version: 4.3.6 |
| 26 | + |
| 27 | + - name: Install Dependencies & Setup |
| 28 | + run: | |
| 29 | + sudo apt-get update |
| 30 | + sudo apt-get install -y libvlc-dev libvlccore-dev |
| 31 | + haxelib setup ~/haxelib |
| 32 | + haxelib install hxcpp --quiet |
| 33 | + chmod +x ./setup/unix.sh |
| 34 | + ./setup/unix.sh |
| 35 | +
|
| 36 | + - name: Skip SScript setup mode |
| 37 | + run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa |
| 38 | + |
| 39 | + - name: Create Version Tag |
| 40 | + run: echo "${{ github.run_id }}" > VERSION |
| 41 | + |
| 42 | + - name: Compile for Linux |
| 43 | + run: haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" -D officialBuild |
| 44 | + |
| 45 | + - name: Upload Artifact |
| 46 | + uses: actions/upload-artifact@v4.3.4 |
| 47 | + with: |
| 48 | + name: linuxBuild |
| 49 | + path: export/release/linux/bin |
| 50 | + |
| 51 | + buildWindows: |
| 52 | + name: 🌐 Build on Windows |
| 53 | + runs-on: windows-latest |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout Code |
| 57 | + uses: actions/checkout@v4.1.7 |
| 58 | + |
| 59 | + - name: Setup Haxe |
| 60 | + uses: krdlab/setup-haxe@master |
| 61 | + with: |
| 62 | + haxe-version: 4.3.6 |
| 63 | + |
| 64 | + - name: Install Dependencies & Setup |
| 65 | + run: | |
| 66 | + haxelib setup C:/haxelib |
| 67 | + haxelib install hxcpp --quiet |
| 68 | + setup\windows.bat |
| 69 | + shell: cmd |
| 70 | + |
| 71 | + - name: Skip SScript setup mode |
| 72 | + run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> %USERPROFILE%\settings.cocoa |
| 73 | + shell: cmd |
| 74 | + |
| 75 | + - name: Create Version Tag |
| 76 | + run: echo "${{ github.run_id }}" > VERSION |
| 77 | + |
| 78 | + - name: Compile for Windows |
| 79 | + run: haxelib run lime build windows --app-version="4.0.0-${{ github.run_id }}" -D officialBuild |
| 80 | + |
| 81 | + - name: Upload Artifact |
| 82 | + uses: actions/upload-artifact@v4.3.4 |
| 83 | + with: |
| 84 | + name: windowsBuild |
| 85 | + path: export/release/windows/bin |
| 86 | + |
| 87 | + buildMac: |
| 88 | + name: 🌟 Build on macOS |
| 89 | + runs-on: macos-15 |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout Code |
| 93 | + uses: actions/checkout@v4.1.7 |
| 94 | + |
| 95 | + - name: Setup Haxe |
| 96 | + uses: krdlab/setup-haxe@master |
| 97 | + with: |
| 98 | + haxe-version: 4.3.6 |
| 99 | + |
| 100 | + - name: Install Dependencies & Setup |
| 101 | + run: | |
| 102 | + haxelib setup ~/haxelib |
| 103 | + haxelib install hxcpp --quiet |
| 104 | + chmod +x ./setup/unix.sh |
| 105 | + ./setup/unix.sh |
| 106 | +
|
| 107 | + - name: Skip SScript setup mode |
| 108 | + run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa |
| 109 | + |
| 110 | + - name: Create Version Tag |
| 111 | + run: echo "${{ github.run_id }}" > VERSION |
| 112 | + |
| 113 | + - name: Compile for macOS |
| 114 | + run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" -D officialBuild |
| 115 | + |
| 116 | + - name: Upload Artifact |
| 117 | + uses: actions/upload-artifact@v4.3.4 |
| 118 | + with: |
| 119 | + name: macBuild |
| 120 | + path: export/release/macos/bin |
0 commit comments