name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: ".exe"
- os: macos-latest
target: x86_64-apple-darwin
suffix: ""
linker: rust-lld
- os: macos-latest
target: aarch64-apple-darwin
suffix: ""
linker: ""
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Build release binary
env:
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER: ${{ matrix.linker }}
run: cargo build --release --all-features --target ${{ matrix.target }}
- name: Rename binary
shell: bash
run: |
cp target/${{ matrix.target }}/release/dsv${{ matrix.suffix }} \
dsv-${{ matrix.target }}${{ matrix.suffix }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dsv-${{ matrix.target }}
path: dsv-${{ matrix.target }}${{ matrix.suffix }}
if-no-files-found: error
checksums:
name: Checksums
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Generate SHA256SUMS
run: |
cd dist
sha256sum dsv-* > dsv-SHA256SUMS.txt
cat dsv-SHA256SUMS.txt
- name: Upload checksums
uses: actions/upload-artifact@v4
with:
name: dsv-SHA256SUMS
path: dist/dsv-SHA256SUMS.txt
release:
name: Create release
needs: [build, checksums]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" dist/dsv-* \
--title "$GITHUB_REF_NAME" \
--generate-notes