|
| 1 | +name: Release Build Distribution |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + name: Compile for ${{ matrix.target }} |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - os: windows-latest |
| 21 | + target: x86_64-pc-windows-msvc |
| 22 | + artifact_name: gpupatch.exe |
| 23 | + asset_name: gpupatch-windows-amd64.exe |
| 24 | + - os: ubuntu-latest |
| 25 | + target: x86_64-unknown-linux-gnu |
| 26 | + artifact_name: gpupatch |
| 27 | + asset_name: gpupatch-linux-amd64 |
| 28 | + - os: macos-latest |
| 29 | + target: x86_64-apple-darwin |
| 30 | + artifact_name: gpupatch |
| 31 | + asset_name: gpupatch-macos-amd64 |
| 32 | + - os: macos-latest |
| 33 | + target: aarch64-apple-darwin |
| 34 | + artifact_name: gpupatch |
| 35 | + asset_name: gpupatch-macos-arm64 |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout Source |
| 39 | + uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Install Rust |
| 42 | + uses: actions-rs/toolchain@v1 |
| 43 | + with: |
| 44 | + toolchain: stable |
| 45 | + target: ${{ matrix.target }} |
| 46 | + override: true |
| 47 | + |
| 48 | + - name: Compile Production Binary |
| 49 | + run: cargo build --release --target ${{ matrix.target }} |
| 50 | + |
| 51 | + - name: Stage Assets for Upload |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + if [ "${{ matrix.os }}" = "windows-latest" ]; then |
| 55 | + cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }} |
| 56 | + else |
| 57 | + cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }} |
| 58 | + chmod +x ./${{ matrix.asset_name }} |
| 59 | + fi |
| 60 | +
|
| 61 | + - name: Upload to GitHub Release |
| 62 | + uses: softprops/action-gh-release@v1 |
| 63 | + with: |
| 64 | + files: | |
| 65 | + ${{ matrix.asset_name }} |
| 66 | + env: |
| 67 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments