|
| 1 | +name: ProXPL Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-and-package: |
| 13 | + name: Build on ${{ matrix.os }} |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 19 | + include: |
| 20 | + - os: ubuntu-latest |
| 21 | + artifact_name: proxpl-linux |
| 22 | + binary_path: build/proxpl |
| 23 | + asset_name: proxpl-linux |
| 24 | + - os: windows-latest |
| 25 | + artifact_name: proxpl-windows |
| 26 | + binary_path: build\Release\proxpl.exe |
| 27 | + asset_name: proxpl-windows.exe |
| 28 | + - os: macos-latest |
| 29 | + artifact_name: proxpl-macos |
| 30 | + binary_path: build/proxpl |
| 31 | + asset_name: proxpl-macos |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout Code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Install LLVM (Ubuntu) |
| 38 | + if: matrix.os == 'ubuntu-latest' |
| 39 | + run: | |
| 40 | + sudo apt-get update |
| 41 | + sudo apt-get install -y llvm-dev libclang-dev clang |
| 42 | +
|
| 43 | + - name: Install LLVM (macOS) |
| 44 | + if: matrix.os == 'macos-latest' |
| 45 | + run: | |
| 46 | + brew install llvm |
| 47 | + echo "CMAKE_PREFIX_PATH=$(brew --prefix llvm)" >> $GITHUB_ENV |
| 48 | +
|
| 49 | + - name: Install LLVM (Windows) |
| 50 | + if: matrix.os == 'windows-latest' |
| 51 | + run: choco install llvm -y |
| 52 | + |
| 53 | + - name: Configure CMake |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 57 | +
|
| 58 | + - name: Build |
| 59 | + shell: bash |
| 60 | + run: cmake --build build --config Release --verbose |
| 61 | + |
| 62 | + - name: Verify Build (Check Binary Exists) |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + if [ -f "${{ matrix.binary_path }}" ]; then |
| 66 | + echo "Binary found at ${{ matrix.binary_path }}" |
| 67 | + else |
| 68 | + echo "Binary NOT found at ${{ matrix.binary_path }}" |
| 69 | + # List directory for debugging |
| 70 | + ls -R build |
| 71 | + exit 1 |
| 72 | + fi |
| 73 | +
|
| 74 | + - name: Rename Binary |
| 75 | + shell: bash |
| 76 | + run: | |
| 77 | + mv "${{ matrix.binary_path }}" ${{ matrix.asset_name }} |
| 78 | +
|
| 79 | + - name: Upload Artifact |
| 80 | + uses: actions/upload-artifact@v4 |
| 81 | + with: |
| 82 | + name: ${{ matrix.asset_name }} |
| 83 | + path: ${{ matrix.asset_name }} |
| 84 | + |
| 85 | + release: |
| 86 | + name: Create Release |
| 87 | + needs: build-and-package |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - name: Download Windows Artifact |
| 91 | + uses: actions/download-artifact@v4 |
| 92 | + with: |
| 93 | + name: proxpl-windows.exe |
| 94 | + |
| 95 | + - name: Download Linux Artifact |
| 96 | + uses: actions/download-artifact@v4 |
| 97 | + with: |
| 98 | + name: proxpl-linux |
| 99 | + |
| 100 | + - name: Download macOS Artifact |
| 101 | + uses: actions/download-artifact@v4 |
| 102 | + with: |
| 103 | + name: proxpl-macos |
| 104 | + |
| 105 | + - name: Create Release |
| 106 | + uses: softprops/action-gh-release@v1 |
| 107 | + with: |
| 108 | + files: | |
| 109 | + proxpl-windows.exe |
| 110 | + proxpl-linux |
| 111 | + proxpl-macos |
| 112 | + generate_release_notes: true |
| 113 | + draft: false |
| 114 | + prerelease: false |
0 commit comments