feat: improve build workflow #14
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: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup toolchain | |
run: | | |
rustup toolchain add --profile=minimal stable | |
rustup target add x86_64-pc-windows-msvc | |
rustup target add i686-pc-windows-msvc | |
- name: Rust caching | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
${{ github.workspace }}/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: | | |
cargo build --target=x86_64-pc-windows-msvc | |
cargo build --target=i686-pc-windows-msvc | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: osu-switcher | |
path: ${{ github.workspace }}/target/**/osu-switcher.exe |