Skip to content

Commit

Permalink
feat: improve build workflow
Browse files Browse the repository at this point in the history
- Stop using unmaintained `actions-rs/toolchain`
- Build for 32-bit Windows
  • Loading branch information
rushiiMachine committed Oct 31, 2024
1 parent 6dd69c3 commit 785da8e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Build

on:
push:
branches:
Expand All @@ -10,36 +12,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
override: true
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@v2
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('lib/rust/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Build release
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=x86_64-pc-windows-gnu
- 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/x86_64-pc-windows-gnu/release/osu-switcher.exe
path: ${{ github.workspace }}/target/**/osu-switcher.exe

0 comments on commit 785da8e

Please sign in to comment.