This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
rustboyadvance-ng/.github/workflows/build.yml
Michel Heily 8f4b98b8e4 ci: Use ./gradelew assemble instead of build
I don't want to handle these lints right now


Former-commit-id: 0d7d4707346b0e47fb9de46dc774b9c02f7f4a95
Former-commit-id: 001a62161e1b4592fc9f6846fad3f1fdcfe4b750
2020-10-20 02:03:42 +03:00

147 lines
4.1 KiB
YAML

name: Build
on:
push:
branches:
- master
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release --manifest-path platform/rustboyadvance-sdl2/Cargo.toml
- name: Collect artifacts
run: |
mkdir artifacts
mkdir artifacts/assets
cp README.md artifacts
cp LICENSE artifacts
cp ./assets/icon_cropped_small.png artifacts/assets
cp ./target/release/rustboyadvance-sdl2 artifacts
- name : Upload artifacts
uses: actions/upload-artifact@v2
with:
name: rustboyadvance-sdl2-x86_64-unknown-linux-gnu
path: artifacts
build-android-apk:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchains
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build APK
working-directory: ./platform/android
run: ./gradlew assemble
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: rustdroid.apk
path: ./platform/android/app/build/outputs/apk/release/app-release-unsigned.apk
build-windows-64:
runs-on: windows-2019
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
submodules: recursive
- run: rustup target add x86_64-pc-windows-msvc
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --target x86_64-pc-windows-msvc --release --manifest-path .\platform\rustboyadvance-sdl2\Cargo.toml
- name: Collect artifacts
run: |
mkdir artifacts
mkdir artifacts\assets
copy README.md artifacts
copy LICENSE artifacts
copy .\assets\icon_cropped_small.png artifacts\assets
copy .\target\x86_64-pc-windows-msvc\release\rustboyadvance-sdl2.exe artifacts
copy .\platform\rustboyadvance-sdl2\msvc\64\*.dll artifacts
copy .\platform\rustboyadvance-sdl2\msvc\64\LICENSE.* artifacts
- name : Upload artifacts
uses: actions/upload-artifact@v2
with:
name: rustboyadvance-sdl2-x86_64-pc-windows-msvc
path: artifacts