on main help sign in
Add build workflow: compile check and optional APK

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mVy1fu8zBn38wHgJqmLNz

commitf14c973ebd127ab5f19c7f4a4d5876921386e80f authorClaude <noreply@anthropic.com> dateSun 27 Sep 2026, 00:11 (2 weeks ago) parentcea2030
1 file changed+86−2
.github/workflows/build.yml+86−2
.github/workflows/build.yml+86−2
@@ -2,9 +2,93 @@ name: Build MultiGram
22
33on:
44 workflow_dispatch:
5+ inputs:
6+ ref:
7+ description: Branch, tag or commit to build
8+ default: multigram
9+ required: true
10+ apk:
11+ description: Also build a full release APK (slow, compiles the native code)
12+ type: boolean
13+ default: false
14+ workflow_call:
15+ inputs:
16+ ref:
17+ type: string
18+ required: true
19+ apk:
20+ type: boolean
21+ default: false
22+
23+permissions:
24+ contents: read
525
626jobs:
7− placeholder:
27+ compile:
28+ name: Compile Java and Kotlin
29+ runs-on: ubuntu-latest
30+ timeout-minutes: 60
31+ steps:
32+ - uses: actions/checkout@v4
33+ with:
34+ ref: ${{ inputs.ref }}
35+ - name: Fetch the submodules the Java build needs
36+ run: git submodule update --init --depth 1 TMessagesProj/lib/jlatexmath TMessagesProj_Modules/media
37+ - uses: actions/setup-java@v4
38+ with:
39+ distribution: temurin
40+ java-version: '17'
41+ - uses: gradle/actions/setup-gradle@v4
42+ - name: Compile
43+ run: |
44+ echo "org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g" >> gradle.properties
45+ ./gradlew --no-daemon --stacktrace \
46+ :TMessagesProj:compileReleaseJavaWithJavac \
47+ :TMessagesProj_App:compileAfatReleaseJavaWithJavac
48+ - name: Run MultiGram tool checks
49+ if: hashFiles('multigram/tools/check.sh') != ''
50+ run: bash multigram/tools/check.sh
51+
52+ apk:
53+ name: Release APK
54+ if: ${{ inputs.apk }}
55+ needs: compile
856 runs-on: ubuntu-latest
57+ timeout-minutes: 300
958 steps:
10− - run: echo "The build job is added in the next commit."
59+ - uses: actions/checkout@v4
60+ with:
61+ ref: ${{ inputs.ref }}
62+ submodules: true
63+ - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
64+ with:
65+ tool-cache: false
66+ android: false
67+ - uses: actions/setup-java@v4
68+ with:
69+ distribution: temurin
70+ java-version: '17'
71+ - uses: nttld/setup-ndk@v1.4.2
72+ with:
73+ ndk-version: r27c
74+ link-to-sdk: true
75+ - name: Install NDK for the JNI build
76+ run: yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;27.2.12479018"
77+ - name: Build
78+ env:
79+ APP_ID: ${{ secrets.MULTIGRAM_APP_ID }}
80+ APP_HASH: ${{ secrets.MULTIGRAM_APP_HASH }}
81+ run: |
82+ vars=gradle.properties
83+ echo "org.gradle.workers.max=1" >> $vars
84+ [ -n "$APP_ID" ] && echo "APP_ID=$APP_ID" >> $vars
85+ [ -n "$APP_HASH" ] && echo "APP_HASH=$APP_HASH" >> $vars
86+ echo "RELEASE_KEYSTORE_FILE=$PWD/TMessagesProj/config/release.keystore" >> $vars
87+ sudo apt update
88+ sudo apt -y install ninja-build meson nasm gperf pkg-config unzip
89+ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
90+ ./gradlew :TMessagesProj_App:assembleAfatRelease
91+ - uses: actions/upload-artifact@v4
92+ with:
93+ name: multigram-apk
94+ path: TMessagesProj_App/build/outputs/apk/afat/release/*.apk