Update 10.6.4 #58
Workflow file for this run
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: YATGram | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
tags: '[0-9]+.[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
merge_group: | |
jobs: | |
linux: | |
name: Build | |
runs-on: ubuntu-latest | |
environment: release | |
env: | |
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" | |
CCACHE_NOHASHDIR: "true" | |
CCACHE_HARDLINK: "true" | |
CCACHE_BASEDIR: "${{ github.workspace }}" | |
strategy: | |
matrix: | |
# type: [debug, release] | |
type: [release] | |
include: | |
# - type: debug | |
# afat: assembleAfatDebug | |
# name: "" | |
# updates: 1 | |
- type: release | |
afat: assembleAfatRelease | |
name: "" | |
updates: 0 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "11" | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Setup NDK | |
uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r21e | |
link-to-sdk: true | |
- name: Set up ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
max-size: 2G | |
key: ${{ runner.os }} | |
restore-keys: ${{ runner.os }} | |
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
- name: Prepare additional build number. | |
env: | |
ADDITIONAL_BUILD: ${{ secrets.ADDITIONAL_BUILD_NUMBER }} | |
run: | | |
result=$((ADDITIONAL_BUILD / 10000)) | |
echo "ADDITIONAL_BUILD_NUMBER = $result should be between 0 and 10!" | |
echo "ADDITIONAL_BUILD_NUMBER=$result" >> $GITHUB_ENV | |
# used for check updates | |
echo "USER_REPO=forkgram/TelegramAndroid" >> $GITHUB_ENV | |
echo "CHECK_UPDATES=${{ matrix.updates }}" >> $GITHUB_ENV | |
- name: Build. | |
run: | | |
vars=gradle.properties | |
echo ${{ secrets.KEY_STORE }} | base64 --decode > TMessagesProj/config/release.keystore | |
echo "DUMMY_CONST=0" >> $vars | |
echo "org.gradle.workers.max=1" >> $vars | |
echo "APP_ID=${{ secrets.APP_ID }}" >> $vars | |
echo "APP_HASH=${{ secrets.APP_HASH }}" >> $vars | |
echo "RELEASE_KEY_PASSWORD=${{ secrets.RELEASE_KEY_PASSWORD }}" >> $vars | |
echo "RELEASE_KEY_ALIAS=${{ secrets.RELEASE_KEY_ALIAS }}" >> $vars | |
echo "RELEASE_STORE_PASSWORD=${{ secrets.RELEASE_STORE_PASSWORD }}" >> $vars | |
echo "ADDITIONAL_BUILD_NUMBER=$ADDITIONAL_BUILD_NUMBER" >> $vars | |
echo "USER_REPO=$USER_REPO" >> $vars | |
echo "CHECK_UPDATES=${{ matrix.updates }}" >> $vars | |
echo $ADDITIONAL_BUILD_NUMBER | |
sudo apt update | |
sudo apt install ninja-build | |
./gradlew :TMessagesProj_AppFork:${{ matrix.afat }} | |
grep VERSION_NAME TMessagesProj/build/generated/source/buildConfig/${{ matrix.type }}/org/telegram/messenger/BuildConfig.java | cut -d'"' -f 2 > ver.txt | |
mkdir artifact | |
mv TMessagesProj_AppFork/build/outputs/apk/afat/${{ matrix.type }}/app.apk app.apk | |
cp app.apk "artifact/YATGram_$(cat ver.txt)${{ matrix.name }}.apk" | |
mkdir tag_asset | |
cp app.apk "tag_asset/YATGram_$(cat ver.txt)${{ matrix.name }}.apk" | |
echo "NEW_TAG_TEXT=$(cat ver.txt)" >> $GITHUB_ENV | |
tempVer=$(cat ver.txt) | |
tempVer=${tempVer::-2} | |
echo "NEW_OFFICIAL_TAG_TEXT=$tempVer" >> $GITHUB_ENV | |
versionCode=$(grep VERSION_CODE TMessagesProj_AppFork/build/generated/source/buildConfig/afat/${{ matrix.type }}/org/telegram/messenger/regular/BuildConfig.java | cut -d' ' -f 9 | sed 's/;//') | |
echo "VERSION_CODE=$versionCode" >> $GITHUB_ENV | |
- name: Draft release. | |
uses: softprops/action-gh-release@v1 | |
if: ${{ matrix.type == 'release' && startsWith(github.ref, 'refs/tags/') }} | |
with: | |
token: ${{ secrets.TOKEN_RELEASE }} | |
draft: true | |
files: tag_asset/* | |
tag_name: ${{ env.NEW_TAG_TEXT }} | |
name: "${{ env.NEW_TAG_TEXT }}" | |
body: "- Updated to ${{ env.NEW_OFFICIAL_TAG_TEXT }} build of the official Telegram.\nVersion code: ${{ env.VERSION_CODE }}\n" | |
- uses: actions/upload-artifact@master | |
name: Upload artifact. | |
with: | |
name: YATGram-${{ matrix.type }} | |
path: artifact/ |