feat!: the Rust™ Rewrite #141
Workflow file for this run
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: CI | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.vscode/**' | |
tags: | |
- v* | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.vscode/**' | |
env: | |
CARGO_TERM_COLOR: always | |
PKG_CONFIG_SYSROOT_DIR: / | |
permissions: | |
contents: write | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 | |
with: | |
prefix-key: "${{ runner.os }}-tosho-rust" | |
- name: Build | |
run: cargo build --verbose --all | |
- name: Lint | |
run: cargo clippy --verbose --all -- -D warnings | |
- name: Tests | |
run: cargo test --verbose --all | |
build: | |
needs: lint | |
strategy: | |
matrix: | |
os: | |
- [ubuntu-latest, x86_64-unknown-linux-gnu] | |
- [ubuntu-latest, x86_64-unknown-linux-musl] | |
- [macos-latest, x86_64-apple-darwin] | |
- [windows-latest, x86_64-pc-windows-msvc] | |
- [macos-latest, aarch64-apple-darwin] | |
fail-fast: false | |
runs-on: ${{ matrix.os[0] }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Rust Target | |
run: | | |
rustup target add ${{ matrix.os[1] }} | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 | |
with: | |
prefix-key: "${{ runner.os }}-${{ matrix.os[1] }}-tosho-build-rust" | |
- name: Build | |
run: | | |
cargo build --release --verbose --all --target ${{ matrix.os[1] }} | |
ls -l target/release | |
ls -l . | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tosho-${{ matrix.os[1] }} | |
path: | | |
target/release/tosho.exe | |
target/release/tosho | |
- name: Prepare release | |
if: matrix.os[0] != 'windows-latest' | |
shell: bash | |
run: | | |
cd target/release | |
zip -r tosho-${{ runner.os }}.zip tosho* | |
cd ../.. | |
- name: Prepare release (Win32) | |
if: matrix.os[0] == 'windows-latest' | |
run: | | |
cd target/release | |
Compress-Archive -Path tosho.exe -DestinationPath tosho-${{ matrix.os[1] }}.zip | |
cd ../.. | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
target/release/tosho-${{ matrix.os[1] }}.zip | |
draft: true | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generate_release_notes: true |