|
| 1 | +name: Release Binaries |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build ${{ matrix.target }} |
| 10 | + runs-on: ${{ matrix.runs-on }} |
| 11 | + timeout-minutes: 120 |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - target: aarch64-apple-darwin |
| 17 | + runs-on: macos-latest |
| 18 | + archive: tgz |
| 19 | + - target: x86_64-apple-darwin |
| 20 | + runs-on: macos-15-intel |
| 21 | + archive: tgz |
| 22 | + - target: aarch64-unknown-linux-gnu |
| 23 | + runs-on: ubuntu-24.04-arm |
| 24 | + archive: tgz |
| 25 | + - target: x86_64-unknown-linux-gnu |
| 26 | + runs-on: ubuntu-24.04 |
| 27 | + archive: tgz |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v6 |
| 30 | + with: |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - uses: ./.github/actions/setup-rust |
| 34 | + with: |
| 35 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + targets: ${{ matrix.target }} |
| 37 | + enable-sccache: "false" |
| 38 | + |
| 39 | + - name: Build release binary |
| 40 | + run: cargo build --release --package vortex-tui --bin vx --target ${{ matrix.target }} |
| 41 | + |
| 42 | + - name: Create archive (tgz) |
| 43 | + if: matrix.archive == 'tgz' |
| 44 | + run: | |
| 45 | + cd target/${{ matrix.target }}/release |
| 46 | + tar -czvf ../../../vx-${{ matrix.target }}.tar.gz vx |
| 47 | +
|
| 48 | + - name: Create archive (zip) |
| 49 | + if: matrix.archive == 'zip' |
| 50 | + run: | |
| 51 | + cd target/${{ matrix.target }}/release |
| 52 | + zip ../../../vx-${{ matrix.target }}.zip vx.exe |
| 53 | +
|
| 54 | + - name: Upload release asset |
| 55 | + uses: softprops/action-gh-release@v2 |
| 56 | + with: |
| 57 | + files: vx-${{ matrix.target }}.${{ matrix.archive == 'tgz' && 'tar.gz' || 'zip' }} |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments