Skip to content

Build release APK

Build release APK #5

Workflow file for this run

name: Build release APK
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-20.04
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "10G"
CCACHE_HARDLINK: "true"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: DamianReeves/write-file-action@master
with:
path: ./API_KEYS
contents: |
APP_ID = 6
APP_HASH = "eb06d4abfb49dc3eeb1aeb98ae0f581e"
MAPS_V2_API = 0
SIGNING_KEY_PASSWORD = ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_KEY_ALIAS = ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_STORE_PASSWORD = ${{ secrets.SIGNING_KEY_PASSWORD }}
write-mode: overwrite
- name: Write google-services.json
uses: timheuer/[email protected]
with:
fileName: google-services.json
fileDir: ./TMessagesProj
encodedString: ${{ secrets.GOOGLE_SERVICES_JSON_FILE_IN_BASE64 }}
- name: Write signing keystore file
uses: timheuer/[email protected]
with:
fileName: extera.jks
fileDir: ./TMessagesProj/config
encodedString: ${{ secrets.SIGNING_KEYSTORE_FILE_IN_BASE64 }}
- name: Update packages
run: sudo apt-get update
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Cache Gradle Build
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/build-cache-*
~/.gradle/buildOutputCleanup/cache.properties
key: gradle-builds-${{ github.sha }}
restore-keys: |
gradle-builds
- name: Set up ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache
restore-keys: ccache
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
- name: Prepare Environment
run: |
echo "Removing large packages"
sudo apt-get update
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli firefox mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
echo "Removing large directories"
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/node_modules
df -h
sudo apt-get install bison gcc make curl ninja-build ccache -y
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleAfatRelease
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Release APK
path: TMessagesProj/build/outputs/apk/afat/release/*.apk