Skip to content

Commit 479401e

Browse files
committed
ci: add Android cross-compilation CI job
1 parent a082ce5 commit 479401e

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ jobs:
211211
- name: Build and test
212212
run: cargo test -vv
213213

214+
215+
android-cross-compile:
216+
name: Cross-Compile for Android (${{ matrix.package }})
217+
runs-on: ubuntu-latest
218+
strategy:
219+
fail-fast: false
220+
matrix:
221+
package:
222+
- android-aarch64
223+
- android-armv7
224+
- android-x86_64
225+
steps:
226+
- uses: actions/checkout@v4
227+
228+
- name: Install Nix
229+
uses: cachix/install-nix-action@v31
230+
231+
- name: Build
232+
run: nix build .#${{ matrix.package }} -L
233+
214234
fuzz-corpus:
215235
name: Verify Fuzz Corpus
216236
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
- Added Android cross-compilation support (`aarch64-linux-android`, `armv7-linux-androideabi`, `x86_64-linux-android`) via Nix package outputs (`nix build .#android-aarch64`, etc.).
12+
- Added Nix package outputs for Android with bundled NDK r27, Rust toolchains, Boost, and cmake.
1113
- Added `BlockTreeEntry::ancestor` to look up an ancestor block at a given height. Returns `None` if the height is out of range. This operation is O(log N).
1214
- Added `Transaction::locktime()` to retrieve a transaction's `nLockTime` value as a `u32`.
1315
- Added `TxIn::sequence()` to retrieve an input's `nSequence` value as a `u32`.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ dependencies. Once setup, run:
3434
cargo b
3535
```
3636

37+
### Android Cross-Compilation
38+
39+
Android cross-compilation requires [Nix](https://nixos.org/).
40+
41+
Nix package outputs bundle the exact NDK version, Rust toolchains with Android
42+
targets, Boost, and cmake in a single reproducible build drying out the support
43+
needed on rust-bitcoinkernel side.
44+
45+
```bash
46+
nix build .#android-aarch64
47+
nix build .#android-armv7
48+
nix build .#android-x86_64
49+
```
50+
51+
The resulting libraries are placed in `result/lib/`.
52+
3753
## MSRV (Minimum Supported Rust Version)
3854

3955
The minimum supported Rust version is 1.71. Users on rustc older than

0 commit comments

Comments
 (0)