Build #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
workflow_dispatch: {} | |
jobs: | |
build: | |
name: Build Binary | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
suffix: "macos" | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
suffix: "linux" | |
- os: windows-latest | |
target: x86_64-pc-windows-gnu | |
suffix: "windows" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: Swatinem/rust-cache@v2 | |
- run: | | |
cargo test --target="${{ matrix.target }}" --workspace || exit 1 | |
cargo build --target="${{ matrix.target }}" --profile=dist | |
- run: | | |
rustup target add "aarch64-apple-darwin" | |
cargo build --target="aarch64-apple-darwin" --profile=dist | |
lipo -create -output biodiff target/x86_64-apple-darwin/dist/biodiff target/aarch64-apple-darwin/dist/biodiff | |
lipo -create -output git-biodiff target/x86_64-apple-darwin/dist/git-biodiff target/aarch64-apple-darwin/dist/git-biodiff | |
if: matrix.target == 'x86_64-apple-darwin' | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'macos-latest' | |
with: | |
name: 'biodiff-${{ matrix.suffix }}-${{ github.ref_name }}' | |
path: | | |
biodiff | |
git-biodiff | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: 'biodiff-${{ matrix.suffix }}-${{ github.ref_name }}' | |
path: | | |
target/${{ matrix.target }}/dist/biodiff | |
target/${{ matrix.target }}/dist/git-biodiff | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'windows-latest' | |
with: | |
name: 'biodiff-${{ matrix.suffix }}-${{ github.ref_name }}' | |
path: | | |
target/${{ matrix.target }}/dist/biodiff.exe | |
target/${{ matrix.target }}/dist/git-biodiff.exe |