forked from Telegram-FOSS-Team/Telegram-FOSS
-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (131 loc) · 4.04 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Build
on:
workflow_dispatch:
branches:
- '**'
jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
submodules: true
- name: Free up some space
run: |
sudo apt purge --allow-remove-essential --auto-remove \
'*apache2*' \
'*docker*' \
'*dotnet*' \
'*firefox*' \
'*google*' \
'*gstreamer*' \
'*jdk*' \
'*nginx*' \
'*php*' \
'*ruby*' \
'*wayland*' \
'auto*' \
'azure-cli' \
'bind9*' \
'binutils*' \
'build-essential' \
'clang*' \
'container*' \
'fonts*' \
'gcc-9' \
'gcc-10' \
'gcc-11' \
'gcc-12' \
'gh' \
'glib*' \
'libmono*' \
'lld*' \
'llvm*' \
'mercurial*' \
'mysql*' \
'postgresql*' \
'powershell' \
'vim*' \
'x11*' \
'xdg*' > '/dev/null'
sudo rm --recursive --force \
"${HOME}/.cargo" \
"${HOME}/.rustup" \
"${HOME}/linuxbrew" \
'/etc/cni/net.d' \
'/etc/docker' \
'/etc/mono' \
'/etc/mysql' \
'/lib/tmpfiles.d' \
'/opt/'* \
'/opt/az' \
'/usr/lib/heroku' \
'/usr/lib/mono' \
'/usr/libexec/docker' \
'/usr/local/lib/android' \
'/usr/local/lib/android' \
'/usr/local/share/man' \
'/usr/local/share/vcpkg' \
'/usr/share/fonts' \
'/usr/share/icons' \
'/usr/share/java' \
'/usr/share/php' \
'/usr/share/swift' \
'/var/lib/apache2' \
'/var/lib/gems'
- name: Install required dependencies
run: |
sudo apt install cmake golang-go libuv1 make ninja-build yasm
- name: Set up JDK 18
uses: actions/setup-java@main
with:
java-version: 18
distribution: temurin
- name: Setup Android SDK
run: |
declare -r tarball_filename='/tmp/tools.zip'
declare -r sdk_root='/tmp/android-sdk'
declare -r cmdline_tools_directory='/tmp/cmdline-tools'
wget 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' --output-document="${tarball_filename}"
unzip -d '/tmp' "${tarball_filename}"
yes | "${cmdline_tools_directory}/bin/sdkmanager" --licenses --sdk_root="${sdk_root}"
unlink "${tarball_filename}"
rm --recursive "${cmdline_tools_directory}"
echo "ANDROID_SDK_ROOT=${sdk_root}" >> "${GITHUB_ENV}"
- name: Set up JDK 11
uses: actions/setup-java@main
with:
java-version: 11
distribution: temurin
- name: Setup API keys
run: |
echo -e 'APP_ID = 105810\nAPP_HASH = 3e7a52498eec003c5896a330e5d29397' > API_KEYS
- name: Setup Android cross-compiler
uses: nttld/setup-ndk@main
id: setup-ndk
with:
ndk-version: r21e
- name: Post setup settings for Android cross-compiler
run: |
echo 'NDK=${{ steps.setup-ndk.outputs.ndk-path }}' >> "${GITHUB_ENV}"
- name: Setup upterm session
if: false
uses: lhotari/action-upterm@v1
- name: Build required dependencies
working-directory: ./TMessagesProj/jni
run: |
./build_libvpx_clang.sh
./build_ffmpeg_clang.sh
./patch_ffmpeg.sh
./patch_boringssl.sh
NINJA_PATH='/usr/bin/ninja' ./build_boringssl.sh
- name: Build Android project
run: |
bash gradlew --no-daemon 'assembleAfatRelease'
- name: Upload artifact
uses: actions/upload-artifact@main
with:
path: ./TMessagesProj_App/build/outputs/apk/afat/release/app.apk