2024-01-30 09:14:24 +00:00
|
|
|
name: Pull request
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2024-01-31 04:47:42 +00:00
|
|
|
types: [opened, reopened, synchronize]
|
2024-02-12 03:29:47 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '**.xml'
|
2024-01-30 09:14:24 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Check Access
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: "Check access"
|
|
|
|
uses: "lannonbr/repo-permission-check-action@2.0.0"
|
|
|
|
with:
|
|
|
|
permission: "write"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
ffmpeg:
|
|
|
|
name: Native Build (FFmpeg)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: check
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Fetch Status
|
|
|
|
run: |
|
|
|
|
sed -i 's/\/\///g' settings.gradle
|
|
|
|
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
|
|
|
|
git submodule status TMessagesProj/jni/libvpx > libvpx_status
|
|
|
|
- name: FFmpeg Cache
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/jni/ffmpeg/build
|
|
|
|
TMessagesProj/jni/libvpx/build
|
|
|
|
key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }}
|
2024-02-09 07:52:22 +00:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
2024-01-30 09:14:24 +00:00
|
|
|
- name: Setup Android SDK Tools
|
2024-02-09 07:52:22 +00:00
|
|
|
uses: android-actions/setup-android@v3
|
2024-01-30 09:14:24 +00:00
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
- name: Install NDK
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" > local.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
|
|
|
|
- name: Native Build
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install yasm -y
|
|
|
|
./run init libs libvpx
|
|
|
|
./run init libs ffmpeg
|
|
|
|
boringssl:
|
|
|
|
name: Native Build (BoringSSL)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: check
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Fetch Status
|
|
|
|
run: |
|
|
|
|
sed -i 's/\/\///g' settings.gradle
|
|
|
|
git submodule status TMessagesProj/jni/boringssl > boringssl_status
|
|
|
|
- name: BoringSSL Cache
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/jni/boringssl/build
|
|
|
|
key: ${{ hashFiles('boringssl_status') }}
|
2024-02-09 07:52:22 +00:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
2024-01-30 09:14:24 +00:00
|
|
|
- name: Setup Android SDK Tools
|
2024-02-09 07:52:22 +00:00
|
|
|
uses: android-actions/setup-android@v3
|
2024-01-30 09:14:24 +00:00
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
- name: Install NDK
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" > local.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
|
|
|
|
- name: Native Build
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
./run init action boringssl
|
|
|
|
./run init libs boringssl
|
|
|
|
native:
|
|
|
|
name: Native Build (Telegram)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- ffmpeg
|
|
|
|
- boringssl
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
flavor:
|
|
|
|
- armeabi-v7a
|
|
|
|
- arm64-v8a
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Fetch Status
|
|
|
|
run: |
|
|
|
|
sed -i 's/\/\///g' settings.gradle
|
|
|
|
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
|
|
|
|
git submodule status TMessagesProj/jni/libvpx > libvpx_status
|
|
|
|
git submodule status TMessagesProj/jni/boringssl > boringssl_status
|
|
|
|
- name: Native Cache
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/src/main/libs
|
|
|
|
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-${{ matrix.flavor }}
|
|
|
|
- name: Checkout Library
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
git submodule update --init 'TMessagesProj/jni/*'
|
|
|
|
- name: FFmpeg Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/jni/ffmpeg/build
|
|
|
|
TMessagesProj/jni/libvpx/build
|
|
|
|
key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }}
|
|
|
|
- name: BoringSSL Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/jni/boringssl/build
|
|
|
|
key: ${{ hashFiles('boringssl_status') }}
|
2024-02-09 07:52:22 +00:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
2024-01-30 09:14:24 +00:00
|
|
|
- name: Setup Android SDK Tools
|
2024-02-09 07:52:22 +00:00
|
|
|
uses: android-actions/setup-android@v3
|
2024-01-30 09:14:24 +00:00
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
- name: Install NDK
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" > local.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
|
|
|
|
- name: Fix BoringSSL
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd TMessagesProj/jni
|
|
|
|
./patch_boringssl.sh
|
|
|
|
- name: Native Build
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
export NATIVE_TARGET="${{ matrix.flavor }}"
|
|
|
|
./run libs native
|
|
|
|
build:
|
|
|
|
name: Gradle Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- native
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2024-02-09 07:52:22 +00:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
2024-01-30 09:14:24 +00:00
|
|
|
- name: Setup Android SDK Tools
|
2024-02-09 07:52:22 +00:00
|
|
|
uses: android-actions/setup-android@v3
|
2024-01-30 09:14:24 +00:00
|
|
|
- name: Install NDK
|
|
|
|
run: |
|
|
|
|
echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" > local.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
|
|
|
|
- name: Fetch Status
|
|
|
|
run: |
|
|
|
|
sed -i 's/\/\///g' settings.gradle
|
|
|
|
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
|
|
|
|
git submodule status TMessagesProj/jni/boringssl > boringssl_status
|
|
|
|
- name: Native Cache (armeabi-v7a)
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/src/main/libs
|
|
|
|
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a
|
|
|
|
- name: Native Cache (arm64-v8a)
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/src/main/libs
|
|
|
|
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a
|
|
|
|
- name: Configure Gradle
|
|
|
|
run: |
|
|
|
|
sed -i -e "s/16384/6144/g" gradle.properties
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" >> local.properties
|
|
|
|
- name: Gradle cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle
|
|
|
|
key: gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
- name: Debug Build
|
|
|
|
run: |
|
|
|
|
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
|
|
|
|
export DEBUG_BUILD=true
|
2024-02-09 07:52:22 +00:00
|
|
|
sed -i 's/signingConfig signingConfigs.release//g' TMessagesProj/build.gradle
|
2024-03-16 11:08:46 +00:00
|
|
|
./gradlew TMessagesProj:assembleRelease
|
2024-01-30 09:14:24 +00:00
|
|
|
|
|
|
|
APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')
|
|
|
|
APK=$(dirname $APK)
|
|
|
|
echo "APK=$APK" >> $GITHUB_ENV
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2024-03-16 11:08:46 +00:00
|
|
|
name: Debug
|
2024-01-30 09:14:24 +00:00
|
|
|
path: ${{ env.APK }}
|