Update README.md #13
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: ayyboy | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y libasound2-dev g++-mingw-w64-x86-64 g++-x86-64-linux-gnu zip libdbus-1-dev | |
- name: Add Rust targets | |
run: | | |
rustup target add x86_64-pc-windows-gnu | |
rustup target add x86_64-unknown-linux-gnu | |
- name: Install Rust toolchains | |
run: | | |
rustup toolchain install stable-x86_64-pc-windows-gnu | |
rustup toolchain install stable-x86_64-unknown-linux-gnu | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-registry- | |
- name: Cache Cargo index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-index- | |
- name: Cache Cargo build | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build- | |
- name: Build for Linux | |
run: cargo build --release --target x86_64-unknown-linux-gnu | |
- name: Build for Windows | |
run: cargo build --release --target x86_64-pc-windows-gnu | |
- name: Create Linux zip | |
run: zip -j ayyboy-linux.zip target/x86_64-unknown-linux-gnu/release/ayyboy | |
- name: Create Windows zip | |
run: zip -j ayyboy-windows.zip target/x86_64-pc-windows-gnu/release/ayyboy.exe | |
- name: Build NSFW for Linux | |
run: cargo build --release --features nsfw --target x86_64-unknown-linux-gnu | |
- name: Build NSFW for Windows | |
run: cargo build --release --features nsfw --target x86_64-pc-windows-gnu | |
- name: Create NSFW Linux zip | |
run: zip -j ayyboy-nsfw-linux.zip target/x86_64-unknown-linux-gnu/release/ayyboy | |
- name: Create NSFW Windows zip | |
run: zip -j ayyboy-nsfw-windows.zip target/x86_64-pc-windows-gnu/release/ayyboy.exe | |
- name: Upload Linux artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ayyboy-linux | |
path: ayyboy-linux.zip | |
- name: Upload Windows artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ayyboy-windows | |
path: ayyboy-windows.zip | |
- name: Upload Linux artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ayyboy-nsfw-linux | |
path: ayyboy-nsfw-linux.zip | |
- name: Upload Windows artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ayyboy-nsfw-windows | |
path: ayyboy-nsfw-windows.zip |