Skip to content

Add files via upload #43

Add files via upload

Add files via upload #43

Workflow file for this run

name: Build
permissions: {}
on:
pull_request:
push:
branches:
- main
env:
CARGO_INCREMENTAL: 0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update
- name: Build for Desktop Platforms
run: cargo build --release
- name: Clean up target directory (Windows only)
if: runner.os == 'Windows'
run: |
Remove-Item -Path "target\release\build" -Recurse -Force
Remove-Item -Path "target\release\deps" -Recurse -Force
Remove-Item -Path "target\release\examples" -Recurse -Force
Remove-Item -Path "target\release\incremental" -Recurse -Force
Remove-Item -Path "target\CACHEDIR.TAG" -Force
Remove-Item -Path "target\.rustc_info.json" -Force
Remove-Item -Path "target\release\.fingerprint" -Recurse -Force
Remove-Item -Path "target\release\.cargo-lock" -Force
- name: Clean up target directory (macOS and Linux only)
if: runner.os != 'Windows'
run: |
rm -rf target/release/build
rm -rf target/release/deps
rm -rf target/release/examples
rm -rf target/release/incremental
rm -f target/CACHEDIR.TAG
rm -f target/.rustc_info.json
rm -rf target/release/.fingerprint
rm -f target/release/.cargo-lock
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: target/
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update
- name: Install Android NDK
run: |
sudo apt-get update
sudo apt-get install -y wget unzip
wget https://dl.google.com/android/repository/android-ndk-r23b-linux.zip -O ndk.zip
unzip ndk.zip -d $HOME
echo "ANDROID_NDK_HOME=$HOME/android-ndk-r23b" >> $GITHUB_ENV
echo "$HOME/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
- name: Add Android target
run: rustup target add aarch64-linux-android
- name: Build for Android
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target aarch64-linux-android
- name: Clean up target directory (Android)
run: |
rm -rf target/release/build
rm -rf target/release/deps
rm -rf target/release/examples
rm -rf target/release/incremental
rm -f target/CACHEDIR.TAG
rm -f target/.rustc_info.json
rm -rf target/release/.fingerprint
rm -f target/release/.cargo-lock
rm -f target/aarch64-linux-android/CACHEDIR.TAG
rm -rf target/aarch64-linux-android/release/build
rm -rf target/aarch64-linux-android/release/deps
rm -rf target/aarch64-linux-android/release/.fingerprint
rm -f target/aarch64-linux-android/release/.cargo-lock
- name: Upload Artifact for Android
uses: actions/upload-artifact@v4
with:
name: build-android
path: target/
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update
- name: Add iOS target
run: rustup target add aarch64-apple-ios
- name: Build for iOS
run: cargo build --release --target aarch64-apple-ios
- name: Clean up target directory (iOS)
run: |
rm -rf target/aarch64-apple-ios/release/build
rm -rf target/aarch64-apple-ios/release/deps
rm -rf target/release/examples
rm -rf target/release/incremental
rm -f target/aarch64-apple-ios/CACHEDIR.TAG
rm -f target/CACHEDIR.TAG
rm -f target/.rustc_info.json
rm -rf target/aarch64-apple-ios/release/.fingerprint
rm -f target/aarch64-apple-ios/release/.cargo-lock
rm -rf target/release
- name: Upload Artifact for iOS
uses: actions/upload-artifact@v4
with:
name: build-ios
path: target/