-
Notifications
You must be signed in to change notification settings - Fork 21
86 lines (69 loc) · 2.34 KB
/
build.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
name: build
on: [push, pull_request]
env:
NDK_VERSION: 25.2.9519653
MIN_SDK_VERSION: 21
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
abi: ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
steps:
- uses: actions/checkout@v3
- name: Cache NDK
id: ndk-cache
uses: actions/cache@v3
with:
path: ndk
key: ndk-${{ env.NDK_VERSION }}
restore-keys: |
ndk-${{ env.NDK_VERSION }}
- name: Install NDK
if: steps.ndk-cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
mv $ANDROID_HOME/ndk/${{ env.NDK_VERSION }} ndk
- name: Set NDK environment variable
run: echo "ANDROID_NDK_HOME=$(pwd)/ndk" >> $GITHUB_ENV
- name: Build with CMake
run: |
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -DANDROID_PLATFORM=android-${{ env.MIN_SDK_VERSION }} -DANDROID_ARM_NEON=TRUE .
cmake --build . -- -j$(nproc)
- name: Rename output
run: |
mv libv4a_re.so libv4a_re_${{ matrix.abi }}.so
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: compiled-binaries
path: libv4a_re_*.so
package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# Download the compiled binaries from the 'build' workflow
- name: Download compiled libraries
uses: actions/download-artifact@v3
with:
name: compiled-binaries
path: compiled/
# Prepare Magisk module directory by copying the necessary ABI files
- name: Prepare Magisk Module
run: |
for abi in armeabi-v7a arm64-v8a x86 x86_64; do
mkdir -p module/common/files/$abi
cp compiled/libv4a_re_$abi.so module/common/files/$abi/
done
# Zip the Magisk module
- name: Zip Magisk Module
run: |
cd module
zip -r ../magisk_module.zip ./
# Upload the zipped Magisk module as an artifact
- name: Upload Magisk Module
uses: actions/upload-artifact@v3
with:
name: magisk_module
path: magisk_module.zip