name: release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
ext: ''
archive: tar.gz
- os: macos-latest
target: aarch64-apple-darwin
ext: ''
archive: tar.gz
- os: macos-latest
target: x86_64-apple-darwin
ext: ''
archive: tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: '.exe'
archive: zip
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}
- name: Package (tar.gz)
if: matrix.archive == 'tar.gz'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../llmtop-${{ github.ref_name }}-${{ matrix.target }}.tar.gz llmtop${{ matrix.ext }}
- name: Package (zip)
if: matrix.archive == 'zip'
shell: pwsh
run: |
Compress-Archive -Path target/${{ matrix.target }}/release/llmtop${{ matrix.ext }} -DestinationPath llmtop-${{ github.ref_name }}-${{ matrix.target }}.zip
- uses: softprops/action-gh-release@v2
with:
files: llmtop-${{ github.ref_name }}-${{ matrix.target }}.*