refact: remove emulation #196
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: | |
branches: [ "main" ] | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y build-essential ninja-build libgdk3.0-cil libatk1.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libxdo-dev | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
target | |
key: linux-cargo-${{ hashFiles('Cargo.lock') }} | |
restore-keys: linux-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: cargo build --verbose --release --locked | |
- name: Build mkpsxiso | |
run: | | |
cmake --preset ci -S ./mkpsxiso -B ./mkpsxiso/build | |
cmake --build ./mkpsxiso/build --config Release | |
- name: Construct artifact | |
run: | | |
mkdir artifact | |
cp -r assets artifact/assets | |
cp target/release/dmw3_randomizer artifact/ | |
cp mkpsxiso/build/mkpsxiso artifact/ | |
cp mkpsxiso/build/dumpsxiso artifact/ | |
zip -r dmw3-randomizer-linux.zip artifact | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dmw3-randomizer-linux | |
path: dmw3-randomizer-linux.zip | |
build-windows: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
$HOME/.cargo | |
target | |
key: windows-cargo-${{ hashFiles('Cargo.lock') }} | |
restore-keys: windows-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: cargo build --verbose --release --locked | |
- name: Build mkpsxiso | |
run: | | |
cmake --preset ci -S ./mkpsxiso -B ./mkpsxiso/build -G "Visual Studio 17 2022" | |
cmake --build ./mkpsxiso/build --config Release | |
- name: Construct artifact | |
run: | | |
mkdir artifact | |
xcopy assets\ artifact\assets /i | |
xcopy target\release\*.exe artifact\ | |
xcopy mkpsxiso\build\Release\*.exe artifact\ | |
Compress-Archive -Path artifact\* -DestinationPath dmw3-randomizer-windows.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dmw3-randomizer-windows | |
path: dmw3-randomizer-windows.zip | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: [ build-windows, build-linux ] | |
steps: | |
- name: Fetch build artifacts | |
if: ${{ github.ref_type == 'tag' }} | |
uses: actions/download-artifact@v4 | |
with: | |
path: . | |
- name: Publish release | |
if: ${{ github.ref_type == 'tag' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
fail_on_unmatched_files: true | |
files: | | |
dmw3-randomizer-linux/* | |
dmw3-randomizer-windows/* |