From 710cc4d54d55155a9904dd5066cfa130709cdb21 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 15 Oct 2024 16:01:59 +0300 Subject: [PATCH] feat(ci): build & release - optimize workflows Signed-off-by: Lachezar Lechev --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 242618d..cb526f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Build code - run: cargo build + run: cargo build -p stremio-core-android - name: Lint code format run: cargo fmt --all -- --check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 956772d..c722c91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: Release stremio-core-android on: release: @@ -20,22 +20,16 @@ jobs: uses: android-actions/setup-android@v2 - name: Setup Android NDK run: yes | sdkmanager "ndk;21.4.7075529" >/dev/null - - name: Set default rust toolchain - run: rustup default 1.70.0 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Install clippy - run: rustup component add clippy - - name: Add armv7 target - run: rustup target add armv7-linux-androideabi - - name: Add aarch64 target - run: rustup target add aarch64-linux-android - - name: Add i686 target - run: rustup target add i686-linux-android - - name: Add x86_64 target - run: rustup target add x86_64-linux-android - - name: Rust cache - uses: Swatinem/rust-cache@v2 + + # use MSRV + - name: Set Rust version to MSRV 1.70 + uses: dtolnay/rust-toolchain@1.70 + with: + # Add armv7, aarch64, i686, x86_64 targets + targets: armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android + + - uses: Swatinem/rust-cache@v2 + - name: Build aar run: ./gradlew -Pversion=${GITHUB_REF##*/} publishToMavenLocal - name: Archive artifacts