-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (76 loc) · 2.75 KB
/
build-nym-vpn-core-android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: build-nym-vpn-core-android
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/build-nym-vpn-core-android.yml"
workflow_call:
outputs:
RUST_VERSION:
value: ${{ jobs.build-android.outputs.RUST_VERSION }}
env:
CARGO_TERM_COLOR: always
CARGO_TARGET: release
WG_GO_LIB_PATH: ${{ github.workspace }}/build/lib/aarch64-linux-android
WG_GO_LIB_NAME: wireguard-go_aarch64-linux-android
UPLOAD_DIR_ANDROID: android_artifacts
jobs:
build-wireguard-go-android:
uses: ./.github/workflows/build-wireguard-go-android.yml
build-android:
needs: build-wireguard-go-android
runs-on: arc-ubuntu-22.04
outputs:
UPLOAD_DIR_ANDROID: ${{ env.UPLOAD_DIR_ANDROID }}
RUST_VERSION: ${{ steps.rust-version.outputs.rustc }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler
- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Add android target
run: |
rustup target install aarch64-linux-android
- name: Setup Android SDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
- name: Install cargo deps
run: |
cargo install --locked cargo-ndk cargo-license
- name: Download wireguard-go artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.WG_GO_LIB_NAME }}
path: ${{ env.WG_GO_LIB_PATH }}
- name: Build nym-vpn-core for android
working-directory: nym-vpn-core/crates/nym-vpn-lib
env:
RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}"
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cargo ndk -t arm64-v8a -o ../target/aarch64-linux-android/release build --${{ env.CARGO_TARGET }}
ls -la ../target/aarch64-linux-android/release/ || true
- name: Get rust version used for build
id: rust-version
run: |
echo "rustc=$(rustc -V)" >> $GITHUB_OUTPUT
- name: Move things around to prepare for upload
env:
SRC_BINARY: nym-vpn-core/target/aarch64-linux-android/${{ env.CARGO_TARGET }}/
run: |
mkdir ${{ env.UPLOAD_DIR_ANDROID }}
cp -vpr ${{ env.SRC_BINARY }}/libnym_vpn_lib.so ${{ env.UPLOAD_DIR_ANDROID }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_DIR_ANDROID }}
path: ${{ env.UPLOAD_DIR_ANDROID }}
retention-days: 1