Build #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |