From 74d675167cde15c7f01db3bd5cd78b333cae11fe Mon Sep 17 00:00:00 2001 From: charludo Date: Thu, 12 Sep 2024 15:46:21 +0200 Subject: [PATCH] Add GitHub action to build and release CLI --- .github/workflows/release.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a23d42..90e1292 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,16 +8,30 @@ on: tags: - v[0-9]+.* jobs: - create-release: + build: + name: Build and release binaries runs-on: ubuntu-latest + + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + steps: - - uses: actions/checkout@v4 - - uses: taiki-e/create-gh-release-action@v1 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} + toolchain: stable + override: true + target: ${{ matrix.platform == 'windows-latest' && 'x86_64-pc-windows-gnu' || 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }} + + - name: Build binary + run: cargo build --release --package cli upload-assets: - needs: create-release + needs: build strategy: matrix: include: