-
-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (78 loc) · 2.16 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
87
88
name: aapt2 build
on:
push:
branches:
- main
paths-ignore:
- README.md
- LICENSE
- .github/**
- patches/**
workflow_dispatch:
jobs:
android:
name: Build for Android
runs-on: ubuntu-latest
strategy:
matrix:
target_arch:
- arm
- aarch64
- i686
- x86_64
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- name: Setup ndk r26b
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
add-to-path: false
- name: Prerequisites
run: |
sudo apt-get install \
git tar \
ninja-build \
autogen \
autoconf \
automake \
libtool \
build-essential \
cmake m4 \
-y || exit 1
- name: Setup protoc
run: |
tools_path=${{ github.workspace }}/tools
mkdir $tools_path || exit 1
cd src/third_party/protobuf/cmake || exit 1
mkdir build && cd build
cmake -Dprotobuf_BUILD_TESTS=OFF ..
make -j$(nproc)
cp $(find . -name protoc-*) $tools_path || exit 1
echo "PROTOC VERSION: $($(find $tools_path -name protoc-*) --version)"
- name: Setup elf-cleaner
run: |
git clone --depth 1 https://github.com/termux/termux-elf-cleaner.git src/third_party/elf-cleaner
cd src/third_party/elf-cleaner || exit 1
autoreconf -vfi
./configure
make -j$(nproc)
make check
sudo make install
- name: Grant execute permission for build.sh
run: chmod +x build.sh
- name: Build aapt2 and zipalign
run: ./build.sh ${{ matrix.target_arch }}
env:
NDK_PATH: ${{ steps.setup-ndk.outputs.ndk-path }}
TOOLS_PATH: ${{ github.workspace }}/tools
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: aapt2-${{ matrix.target_arch }}
path: build/bin