Update deps #7
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: Rust | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install linux libs | |
run: sudo apt-get update; sudo apt-get install --no-install-recommends pkg-config build-essential gcc-multilib libudev-dev libjack-jackd2-dev libjack-jackd2-0 libasound2-dev alsa | |
- name: fmt | |
run: cargo fmt --all -- --check | |
- name: clippy | |
run: cargo clippy --all-targets -- -D clippy::all | |
- name: test | |
run: cargo test | |
build_and_release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Build and Release | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-apple-darwin | |
- aarch64-apple-darwin | |
- x86_64-pc-windows-msvc | |
- x86_64-unknown-linux-gnu | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: wordle_linux.tar.gz | |
- target: aarch64-apple-darwin | |
os: macOS-latest | |
name: wordle_arm_mac.tar.gz | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
name: wordle_x86_mac.tar.gz | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
name: wordle_windows.zip | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Add x86 mac target | |
if: matrix.target == 'x86_64-apple-darwin' | |
run: rustup target add x86_64-apple-darwin | |
- name: Install linux deps | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update; sudo apt-get install --no-install-recommends pkg-config build-essential gcc-multilib libudev-dev libjack-jackd2-dev libjack-jackd2-0 libasound2-dev alsa | |
- name: build | |
run: cargo build --release --target ${{ matrix.target }} | |
- name: Prepare build artifacts [Windows] | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip wordle.exe | |
7z a ../../../${{ matrix.name }} wordle.exe | |
cd - | |
- name: Prepare build artifacts [-nix] | |
if: matrix.os != 'windows-latest' | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip wordle | |
tar cvf ../../../${{ matrix.name }} wordle | |
cd - | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ matrix.name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |