style: lint #21
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: Build | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '.github/**' | |
- '!.github/workflows/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }} | |
strategy: | |
matrix: | |
abi: [ aarch64-linux-android, x86_64-linux-android ] | |
name: Build (${{ matrix.abi }}) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: cargo- | |
- name: Prepare environment | |
run: | | |
rustup target add aarch64-linux-android | |
rustup target add x86_64-linux-android | |
cargo install cargo-make || true | |
- name: Build with cargo | |
id: release | |
env: | |
TARGET_ABI: ${{ matrix.abi }} | |
UPX_COMPRESS: 1 | |
run: | | |
cargo make release | |
echo name="DexHunter-$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version').r$(git rev-list --count HEAD).$(git rev-parse --short HEAD) (${{ matrix.abi }})" >> $GITHUB_OUTPUT | |
- name: Upload artifacts | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.release.outputs.name }} | |
path: ./target/${{ matrix.abi }}/release/dexhunter |