|
| 1 | +name: FreeMajor All Platforms |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + release: |
| 9 | + types: [ published, prereleased ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + native: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - os: ubuntu-latest |
| 19 | + name: "Linux" |
| 20 | + build_type: Release |
| 21 | + - os: macos-latest |
| 22 | + name: "macOS" |
| 23 | + build_type: Release |
| 24 | + steps: |
| 25 | + # ... garde EXACTEMENT tes steps existants pour Linux/macOS ... |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + |
| 31 | + - name: Set reusable strings |
| 32 | + id: strings |
| 33 | + shell: bash |
| 34 | + run: | |
| 35 | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" |
| 36 | + |
| 37 | + - name: Install Linux dependencies |
| 38 | + if: matrix.os == 'ubuntu-latest' |
| 39 | + run: | |
| 40 | + sudo apt-get update |
| 41 | + sudo apt-get install -y cmake build-essential libasound2-dev \ |
| 42 | + libjack-jackd2-dev libfltk1.3-dev gettext git |
| 43 | + |
| 44 | + - name: Install macOS dependencies |
| 45 | + if: matrix.os == 'macos-latest' |
| 46 | + run: brew install cmake fltk gettext |
| 47 | + |
| 48 | + - name: Configure CMake |
| 49 | + run: | |
| 50 | + cmake -B ${{ steps.strings.outputs.build-output-dir }} \ |
| 51 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 52 | + -S ${{ github.workspace }} |
| 53 | + |
| 54 | + - name: Build |
| 55 | + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |
| 56 | + |
| 57 | + - name: List build results |
| 58 | + if: always() |
| 59 | + run: find ${{ steps.strings.outputs.build-output-dir }} -name "*FreeMajor*" -type f 2>/dev/null || true |
| 60 | + |
| 61 | + - name: Package binaries |
| 62 | + if: startsWith(github.ref, 'refs/tags/') |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + cd ${{ steps.strings.outputs.build-output-dir }} |
| 66 | + find . -name "*FreeMajor*" -type f -executable 2>/dev/null | head -5 | xargs tar -czf FreeMajor-${{ matrix.name }}.tar.gz || true |
| 67 | + |
| 68 | + - name: Upload binaries |
| 69 | + if: startsWith(github.ref, 'refs/tags/') |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: FreeMajor-${{ matrix.name }} |
| 73 | + path: ${{ steps.strings.outputs.build-output-dir }}/*.tar.gz |
| 74 | + |
| 75 | + windows: |
| 76 | + name: Windows 32/64-bit |
| 77 | + runs-on: ubuntu-latest |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + with: |
| 81 | + submodules: recursive |
| 82 | + |
| 83 | + # Win32 |
| 84 | + - name: Build Win32 |
| 85 | + run: | |
| 86 | + docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \ |
| 87 | + maxrd2/arch-mingw:latest bash -c " |
| 88 | + mkdir -p build-win32 && cd build-win32 |
| 89 | + i686-w64-mingw32-cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=ON .. |
| 90 | + make -j\$(nproc) |
| 91 | + cpack -G ZIP |
| 92 | + cp FreeMajor-*.zip ../FreeMajor-dev-win32.zip || true |
| 93 | + " |
| 94 | + |
| 95 | + # Win64 |
| 96 | + - name: Build Win64 |
| 97 | + run: | |
| 98 | + docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \ |
| 99 | + maxrd2/arch-mingw:latest bash -c " |
| 100 | + mkdir -p build-win64 && cd build-win64 |
| 101 | + x86_64-w64-mingw32-cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=ON .. |
| 102 | + make -j\$(nproc) |
| 103 | + cpack -G ZIP |
| 104 | + cp FreeMajor-*.zip ../FreeMajor-dev-win64.zip || true |
| 105 | + " |
| 106 | + |
| 107 | + - name: Upload Windows artifacts |
| 108 | + if: startsWith(github.ref, 'refs/tags/') |
| 109 | + uses: actions/upload-artifact@v4 |
| 110 | + with: |
| 111 | + name: FreeMajor-Windows |
| 112 | + path: | |
| 113 | + FreeMajor-dev-win32.zip |
| 114 | + FreeMajor-dev-win64.zip |
0 commit comments