This repository fetches a specific EasyTier revision and builds a static library libeasytier_ffi.a for Android. It is CI-only: builds run on GitHub Actions (no local/Windows entry points). All build parameters live in BUILD_CONFIG.env.
- Clones EasyTier into
third_party/easytierat the revision you choose. - Locates the FFI crate (
easytier-contrib/easytier-ffi) automatically, or viaFFI_MANIFEST. - Patches its
Cargo.tomltocrate-type = ["staticlib"](so you get a.a, not a.so). - Builds
libeasytier_ffi.afor these ABIs:arm64-v8a,armeabi-v7a,x86,x86_64
- Runs the four ABI builds in parallel via a matrix workflow.
- Normalizes outputs into
dist/<abi>/libeasytier_ffi.a, then packages them as a single zip artifact.
- Edit
BUILD_CONFIG.envat repo root:
REPO_URL=https://github.com/EasyTier/EasyTier.git
ET_REF=releases/v2.4.2 # tag/branch/commit, e.g. v2.4.2 or main
NDK_VERSION=r26d # NDK version used on CI
RUST_TARGETS=aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
CARGO_PROFILE=release # or a custom named profile defined in your workspace
# Optional: only set if auto-detection fails (use relative paths, no quotes)
FFI_MANIFEST=third_party/easytier/easytier-contrib/easytier-ffi/Cargo.tomlTip: Do not use
${{ github.workspace }}or shell variables inBUILD_CONFIG.env. The file is imported as literalKEY=VALUE.
-
Commit and push your changes.
-
In GitHub → Actions → run the workflow defined at
.github/workflows/android.yml. -
After it finishes, download the artifact named
libeasytier_ffi-android-libs(a zip).
The artifact zip contains:
dist/
arm64-v8a/libeasytier_ffi.a
armeabi-v7a/libeasytier_ffi.a
x86/libeasytier_ffi.a
x86_64/libeasytier_ffi.a
The zip filename includes your ET_REF (slashes sanitized) and NDK_VERSION.
-
Workflow:
.github/workflows/android.yml- Loads
BUILD_CONFIG.env. - Installs NDK via
nttld/setup-ndk@v1(version fromNDK_VERSION). - Installs Rust toolchains (targets from
RUST_TARGETS). - Installs
protoc(required by EasyTier’s build script) and verifies it. - Matrix build: four parallel jobs, one ABI each, calling
scripts/build_android.sh. - Normalizes outputs so each ABI has
dist/<abi>/libeasytier_ffi.a. - A final packaging job downloads the four ABI artifacts and zips
dist/.
- Loads
-
Scripts:
scripts/fetch_easytier.sh: clone/switch EasyTier toET_REF.scripts/build_android.sh:- Ensures toolchains and NDK.
- Auto-detects the FFI crate. If
FFI_MANIFESTis set but invalid, it falls back to auto detection and common paths. - Patches
crate-typeto["staticlib"]. - Runs
cargo ndk ... buildwith yourCARGO_PROFILE.
| Key | Description | Example |
|---|---|---|
REPO_URL |
EasyTier upstream repository | https://github.com/EasyTier/EasyTier.git |
ET_REF |
Tag/branch/commit to build | v2.4.2 or releases/v2.4.2 or main |
NDK_VERSION |
Android NDK version installed on CI | r26d |
RUST_TARGETS |
Rust targets to install with the toolchain | aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android |
CARGO_PROFILE |
Cargo profile passed to the build (release by default; custom names supported) |
release |
FFI_MANIFEST |
Optional. Path to the FFI Cargo.toml if auto-detection fails (use relative path). |
third_party/easytier/easytier-contrib/easytier-ffi/Cargo.toml |
Notes:
- If
ET_REFcontains/(e.g.,releases/v2.4.2), the workflow sanitizes it for file names. FFI_MANIFESTis resolved to an absolute path inside the script so directory changes don’t break it.- The matrix defines the ABI list;
ABISfrom env is not used in the matrix setup.
- Scripts in this repo: MIT (see
LICENSE). - Upstream EasyTier retains its original license and copyrights.