Skip to content

chore: fix workflow run #2

chore: fix workflow run

chore: fix workflow run #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
binary: sv
archive: sv-linux-x86_64.tar.gz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
binary: sv
archive: sv-linux-x86_64-musl.tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
binary: sv
archive: sv-linux-aarch64.tar.gz
- target: x86_64-apple-darwin
os: macos-latest
binary: sv
archive: sv-macos-x86_64.tar.gz
- target: aarch64-apple-darwin
os: macos-latest
binary: sv
archive: sv-macos-aarch64.tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
binary: sv.exe
archive: sv-windows-x86_64.zip
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools (Linux)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y musl-tools
- name: Install cross-compilation tools (aarch64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package (Unix)
if: runner.os != 'Windows'
run: |
cp target/${{ matrix.target }}/release/${{ matrix.binary }} sv
tar -czf ${{ matrix.archive }} sv
rm sv
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Copy-Item "target\${{ matrix.target }}\release\${{ matrix.binary }}" "sv.exe"
Compress-Archive -Path "sv.exe" -DestinationPath "${{ matrix.archive }}"
Remove-Item "sv.exe"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: ${{ matrix.archive }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum * > checksums.txt
cat checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/*
generate_release_notes: true