summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yaml
diff options
context:
space:
mode:
authorFelix Obenhuber <flxo@users.noreply.github.com>2024-04-02 11:39:24 +0200
committerGitHub <noreply@github.com>2024-04-02 17:39:24 +0800
commit9354683481ff3c1a874d25f2a4082f14ec253698 (patch)
treef4fd5dcaaf39ca7c4b9d8bb114d8459208435cbe /.github/workflows/release.yaml
parent6ef2d569b531faf0c0b9dce2f3b0588ca6645e47 (diff)
Enable Android build (#384)
* Support build for target_os android The target_os `android` is quite similar to `linux` but must be mentioned in the guards explicitly. Tested for target `aarch64-linux-android`. * Add target aarch64-linux-android to ci Use `cross` for building target `aarch64-linux-android`. In the `ci` workflow the matrix branch of `os` `ubuntu-latest` is used because the matrix organization is host os centric instead of target. Releases are build with `cross` for target `aarch64-linux-android`. Install `cross` if needed for a run. At the time of writing the latest release of `cross` can't build binaries for target `aarch64-linux-android` and it's common sense that the latest git tag or `master` shall be used [1]. [1] https://github.com/cross-rs/cross/issues/1222 * Add android related readme section
Diffstat (limited to '.github/workflows/release.yaml')
-rw-r--r--.github/workflows/release.yaml12
1 files changed, 11 insertions, 1 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index a9ea033..630cadd 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -52,11 +52,17 @@ jobs:
strategy:
matrix:
build:
+ - aarch64-linux-android
- linux-x64-gnu
- linux-x64-musl
- macos-x64
- windows-x64-msvc
include:
+ - cargo: cargo # default; overwrite with `cross` if necessary
+ - build: aarch64-linux-android
+ os: ubuntu-latest
+ target: aarch64-linux-android
+ cargo: cross
- build: linux-x64-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
@@ -84,13 +90,17 @@ jobs:
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y --no-install-recommends musl-tools
+ - name: Install cross
+ if: matrix.cargo == 'cross'
+ run: cargo install --git https://github.com/cross-rs/cross.git --rev 085092c cross
+
- name: Build release binary
shell: bash
env:
RUSTFLAGS: "-C strip=symbols"
run: |
mkdir -p "$BANDWHICH_GEN_DIR"
- cargo build --verbose --release --target ${{ matrix.target }}
+ ${{ matrix.cargo }} build --verbose --release --target ${{ matrix.target }}
- name: Collect build artifacts
shell: bash