-
Notifications
You must be signed in to change notification settings - Fork 11
122 lines (110 loc) · 3.62 KB
/
build-android.yml
File metadata and controls
122 lines (110 loc) · 3.62 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}-build-android"
cancel-in-progress: true
on:
workflow_call:
env:
ANDROID_NDK_VERSION: 28.1.13356709
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RELEASE: 1
jobs:
build-android:
if: github.repository == 'wireapp/core-crypto'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- task: android-armv7
target: armv7-linux-androideabi
- task: android-armv8
target: aarch64-linux-android
- task: android-x86
target: x86_64-linux-android
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-and-cache-rust
with:
target: ${{ matrix.target }}
- name: setup android sdk
uses: android-actions/setup-android@v3
- name: install ndk
run: echo "y" | sdkmanager --install "ndk;$ANDROID_NDK_VERSION"
- name: build android package
env:
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/${{ env.ANDROID_NDK_VERSION}}
run: |
make ${{ matrix.task }}
- uses: actions/upload-artifact@v4
with:
name: android-target-${{ matrix.target }}
path: target/${{ matrix.target }}/release/libcore_crypto_ffi.*
retention-days: 1
uniffi-bindgen:
uses: ./.github/actions/make/uniffi-bindgen
ffi-library:
if: github.repository == 'wireapp/core-crypto'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-and-cache-rust
- run: make ffi-library
- uses: actions/upload-artifact@v4
with:
name: ffi-library
path: target/release/libcore_crypto_ffi.so
retention-days: 1
package-android:
if: github.repository == 'wireapp/core-crypto'
runs-on: ubuntu-latest
needs:
- build-android
- uniffi-bindgen
- ffi-library
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-and-cache-rust
- name: set up jdk 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
- name: gradle setup
uses: gradle/actions/setup-gradle@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: setup android sdk
uses: android-actions/setup-android@v3
- name: install ndk
run: echo "y" | sdkmanager --install "ndk;$ANDROID_NDK_VERSION"
- name: download armv7-linux-androideabi binaries
uses: actions/download-artifact@v5
with:
name: android-target-armv7-linux-androideabi
path: target/armv7-linux-androideabi/release
- name: download aarch64-linux-android binaries
uses: actions/download-artifact@v5
with:
name: android-target-aarch64-linux-android
path: target/aarch64-linux-android/release
- name: download x86_64-linux-android binaries
uses: actions/download-artifact@v5
with:
name: android-target-x86_64-linux-android
path: target/x86_64-linux-android/release
- name: download ffi-library
uses: actions/download-artifact@v5
with:
name: ffi-library
path: target/release/
- name: fetch uniffi bindgen artifact
uses: ./.github/actions/make/uniffi-bindgen
- run: make android
- uses: actions/upload-artifact@v4
with:
name: android
path: |
crypto-ffi/bindings
target/*android*
retention-days: 1