|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' # triggers on v1.0.0, v2.3.4, etc. |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write # required to create releases |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, windows-latest] |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + submodules: recursive |
| 23 | + |
| 24 | + - name: Install dependencies (Linux) |
| 25 | + if: runner.os == 'Linux' |
| 26 | + run: | |
| 27 | + sudo apt-get update |
| 28 | + sudo apt-get install -y \ |
| 29 | + build-essential cmake \ |
| 30 | + libgl1-mesa-dev libx11-dev libxrandr-dev \ |
| 31 | + libxinerama-dev libxcursor-dev libxi-dev \ |
| 32 | + libwayland-dev libxkbcommon-dev |
| 33 | +
|
| 34 | + - name: Configure and build (Linux) |
| 35 | + if: runner.os == 'Linux' |
| 36 | + run: | |
| 37 | + mkdir build |
| 38 | + cd build |
| 39 | + cmake .. -DCMAKE_BUILD_TYPE=Release |
| 40 | + make |
| 41 | +
|
| 42 | + - name: Configure and build (Windows) |
| 43 | + if: runner.os == 'Windows' |
| 44 | + run: | |
| 45 | + mkdir build |
| 46 | + cd build |
| 47 | + cmake .. -DCMAKE_BUILD_TYPE=Release |
| 48 | + cmake --build . --config Release |
| 49 | +
|
| 50 | + - name: Upload Linux artifact |
| 51 | + if: runner.os == 'Linux' |
| 52 | + uses: actions/upload-artifact@v6 |
| 53 | + with: |
| 54 | + name: EntropyVisualizer-Linux |
| 55 | + path: build/EntropyVisualizer |
| 56 | + |
| 57 | + - name: Upload Windows artifact |
| 58 | + if: runner.os == 'Windows' |
| 59 | + uses: actions/upload-artifact@v6 |
| 60 | + with: |
| 61 | + name: EntropyVisualizer-Windows |
| 62 | + path: build/Release/EntropyVisualizer.exe |
| 63 | + |
| 64 | + release: |
| 65 | + needs: build |
| 66 | + runs-on: ubuntu-latest |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Download Linux artifact |
| 70 | + uses: actions/download-artifact@v6 |
| 71 | + with: |
| 72 | + name: EntropyVisualizer-Linux |
| 73 | + path: artifacts/linux |
| 74 | + |
| 75 | + - name: Download Windows artifact |
| 76 | + uses: actions/download-artifact@v6 |
| 77 | + with: |
| 78 | + name: EntropyVisualizer-Windows |
| 79 | + path: artifacts/windows |
| 80 | + |
| 81 | + - name: Create GitHub Release |
| 82 | + uses: softprops/action-gh-release@v2 |
| 83 | + with: |
| 84 | + tag_name: ${{ github.ref_name }} |
| 85 | + name: Release ${{ github.ref_name }} |
| 86 | + draft: false |
| 87 | + prerelease: false |
| 88 | + files: | |
| 89 | + artifacts/linux/EntropyVisualizer |
| 90 | + artifacts/windows/EntropyVisualizer.exe |
0 commit comments