Skip to content

fix: update release workflow to use modern actions #2

fix: update release workflow to use modern actions

fix: update release workflow to use modern actions #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: .exe
- os: macos-latest
target: x86_64-apple-darwin
suffix: ""
- os: macos-latest
target: aarch64-apple-darwin
suffix: ""
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install musl tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y musl-tools
- name: Build binary
run: cargo build --verbose --release --target ${{ matrix.target }}
- name: Strip binary (linux and macos)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: strip target/${{ matrix.target }}/release/wt${{ matrix.suffix }}
- name: Package binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
7z a ../../../wt-${{ matrix.target }}.zip wt.exe
else
tar czvf ../../../wt-${{ matrix.target }}.tar.gz wt
fi
- name: Upload binary to release
uses: softprops/action-gh-release@v1
with:
files: wt-${{ matrix.target }}.*