Skip to content

Commit

Permalink
chore: Update AGP and remove nogcm build
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Mar 16, 2024
1 parent 774ee4d commit 382f8df
Show file tree
Hide file tree
Showing 25 changed files with 247 additions and 490 deletions.
171 changes: 12 additions & 159 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- native
strategy:
matrix:
flavor:
# - FullRelease
- MiniRelease
- MiniReleaseNoGcm
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -225,182 +219,41 @@ jobs:
- name: Debug Build
run: |
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
export DEBUG_BUILD=true
./gradlew TMessagesProj:assemble${{ matrix.flavor }}
./gradlew TMessagesProj:assembleRelease
APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')
APK=$(dirname $APK)
echo "APK=$APK" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.flavor }}
name: Release
path: ${{ env.APK }}
# build-nogcm:
# name: Gradle Build (nogcm)
# runs-on: ubuntu-latest
# needs:
# - native
# - v2ray
# - shadowsocks
# - shadowsocksr
# - build
# strategy:
# matrix:
# flavor:
# - FullReleaseNoGcm
# - MiniReleaseNoGcm
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup Android SDK Tools
# uses: android-actions/setup-android@v2
# - 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
# git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status
# git submodule status 'ssr-libev/*' > shadowsocksr_status
# git submodule status v2ray > v2ray_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: V2ray Cache
# uses: actions/cache@v2
# with:
# path: |
# TMessagesProj/libs/libv2ray.aar
# key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }}
# - name: Shadowsocks Cache
# uses: actions/cache@v2
# with:
# path: |
# TMessagesProj/libs/ss-rust-release.aar
# key: ${{ hashFiles('shadowsocks_status') }}
# - name: ShadowsocksR Cache
# uses: actions/cache@v2
# with:
# path: |
# TMessagesProj/libs/ssr-libev-release.aar
# key: ${{ hashFiles('shadowsocksr_status') }}
# - 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
# ./gradlew TMessagesProj:assemble${{ matrix.flavor }}
#
# APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')
# APK=$(dirname $APK)
# echo "APK=$APK" >> $GITHUB_ENV
# - uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.flavor }}
# path: ${{ env.APK }}
upload:
name: Upload debug
name: Upload release
if: github.event.inputs.upload != 'y'
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'bump version') }}
needs:
- build
# - build-nogcm
- telegram-bot-api
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Donwload Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Download Telegram Bot API Binary
uses: actions/download-artifact@master
- name: Set up Python
uses: actions/setup-python@v5
with:
name: telegram-bot-api-binary
path: .
python-version: 3.12
- name: Send to Telegram
run: |
chmod +x telegram-bot-api-binary
function start() {
./telegram-bot-api-binary --api-id=11535358 --api-hash=33d372962fadb01df47e6ceed4e33cd6 --local 2>&1 > /dev/null &
}
start
curl http://127.0.0.1:8081/ || start
curl http://127.0.0.1:8081/ || start
curl http://127.0.0.1:8081/ || start
# send release via telegram bot api
export mini64=$(find artifacts -name "*arm64-v8a.apk")
export mini32=$(find artifacts -name "*armeabi-v7a.apk")
# export full64=$(find artifacts -name "*full-arm64-v8a.apk")
# export full32=$(find artifacts -name "*full-armeabi-v7a.apk")
export mini64nogcm=$(find artifacts -name "*arm64-v8aNoGcm.apk")
export mini32nogcm=$(find artifacts -name "*armeabi-v7aNoGcm.apk")
# export full64nogcm=$(find artifacts -name "*full-arm64-v8aNoGcm.apk")
# export full32nogcm=$(find artifacts -name "*full-armeabi-v7aNoGcm.apk")
echo $mini64
echo $mini32
# echo $full64
# echo $full32
echo $mini64nogcm
echo $mini32nogcm
# echo $full64nogcm
# echo $full32nogcm
curl --http0.9 http://127.0.0.1:8081/bot${{ secrets.HELPER_BOT_TOKEN }}/sendMediaGroup --form-string chat_id=${{ secrets.HELPER_BOT_TARGET }} --form apk1=@"${mini64}" --form apk2=@"${mini32}" --form apk3=@"${mini64nogcm}" --form apk4=@"${mini32nogcm}" --form-string media="[{\"type\": \"document\",\"media\": \"attach://apk1\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk2\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk3\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk4\",\"caption\": \"Test version, ${{ github.event.head_commit.message }}\",\"parse_mode\": \"Markdown\"}]" --verbose >/dev/null
pkill telegram-bot
telegram-bot-api:
name: Telegram Bot API
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clone Telegram Bot API
run: |
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
git status telegram-bot-api >> telegram-bot-api-status
- name: Cache Bot API Binary
id: cache-bot-api
uses: actions/cache@v2
with:
path: telegram-bot-api-binary
key: CI-telegram-bot-api-${{ hashFiles('telegram-bot-api-status') }}
- name: Compile Telegram Bot API
if: steps.cache-bot-api.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install make git zlib1g-dev libssl-dev gperf cmake g++
cd telegram-bot-api
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
cmake --build . --target install -j$(nproc)
cd ../..
ls -l telegram-bot-api/bin/telegram-bot-api*
cp telegram-bot-api/bin/telegram-bot-api telegram-bot-api-binary
- name: Upload Binary
uses: actions/upload-artifact@master
with:
name: telegram-bot-api-binary
path: telegram-bot-api-binary
python -m pip install -r bin/scripts/requirements.txt
git log -1 --pretty=format:"%s" > artifacts/caption.txt
python bin/scripts/upload.py ${{ secrets.HELPER_BOT_TOKEN }} ${{ secrets.HELPER_BOT_TARGET }} test
8 changes: 2 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- native
strategy:
matrix:
flavor:
- MiniRelease
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -223,12 +219,12 @@ jobs:
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
export DEBUG_BUILD=true
sed -i 's/signingConfig signingConfigs.release//g' TMessagesProj/build.gradle
./gradlew TMessagesProj:assemble${{ matrix.flavor }}
./gradlew TMessagesProj:assembleRelease
APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')
APK=$(dirname $APK)
echo "APK=$APK" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.flavor }}
name: Debug
path: ${{ env.APK }}
82 changes: 10 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- native
strategy:
matrix:
flavor:
# - FullRelease
- MiniRelease
# - FullReleaseNoGcm
- MiniReleaseNoGcm
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -229,96 +222,41 @@ jobs:
- name: Release Build
run: |
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
./gradlew TMessagesProj:assemble${{ matrix.flavor }}
./gradlew TMessagesProj:assembleRelease
APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')
APK=$(dirname $APK)
echo "APK=$APK" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.flavor }}
name: Release
path: ${{ env.APK }}
upload:
name: Upload release
if: github.event.inputs.upload != 'y'
runs-on: ubuntu-latest
needs:
- build
- telegram-bot-api
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Donwload Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Download Telegram Bot API Binary
uses: actions/download-artifact@master
- name: Set up Python
uses: actions/setup-python@v5
with:
name: telegram-bot-api-binary
path: .
python-version: 3.12
- name: Send to Telegram
run: |
chmod +x telegram-bot-api-binary
function start() {
./telegram-bot-api-binary --api-id=11535358 --api-hash=33d372962fadb01df47e6ceed4e33cd6 --local 2>&1 > /dev/null &
}
start
curl http://127.0.0.1:8081/ || start
curl http://127.0.0.1:8081/ || start
curl http://127.0.0.1:8081/ || start
# send release via telegram bot api
export mini64=$(find artifacts -name "*arm64-v8a.apk")
export mini32=$(find artifacts -name "*armeabi-v7a.apk")
# export full64=$(find artifacts -name "*full-arm64-v8a.apk")
# export full32=$(find artifacts -name "*full-armeabi-v7a.apk")
export mini64nogcm=$(find artifacts -name "*arm64-v8aNoGcm.apk")
export mini32nogcm=$(find artifacts -name "*armeabi-v7aNoGcm.apk")
# export full64nogcm=$(find artifacts -name "*full-arm64-v8aNoGcm.apk")
# export full32nogcm=$(find artifacts -name "*full-armeabi-v7aNoGcm.apk")
echo $mini64
echo $mini32
# echo $full64
# echo $full32
echo $mini64nogcm
echo $mini32nogcm
# echo $full64nogcm
# echo $full32nogcm
curl --http0.9 http://127.0.0.1:8081/bot${{ secrets.HELPER_BOT_TOKEN }}/sendMediaGroup --form-string chat_id=${{ secrets.HELPER_BOT_TARGET }} --form apk1=@"${mini64}" --form apk2=@"${mini32}" --form apk3=@"${mini64nogcm}" --form apk4=@"${mini32nogcm}" --form-string media="[{\"type\": \"document\",\"media\": \"attach://apk1\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk2\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk3\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk4\",\"caption\": \"${{ github.event.head_commit.message }}\",\"parse_mode\": \"Markdown\"}]" --verbose >/dev/null
pkill telegram-bot
telegram-bot-api:
name: Telegram Bot API
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clone Telegram Bot API
run: |
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
git status telegram-bot-api >> telegram-bot-api-status
- name: Cache Bot API Binary
id: cache-bot-api
uses: actions/cache@v2
with:
path: telegram-bot-api-binary
key: CI-telegram-bot-api-${{ hashFiles('telegram-bot-api-status') }}
- name: Compile Telegram Bot API
if: steps.cache-bot-api.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install make git zlib1g-dev libssl-dev gperf cmake g++
cd telegram-bot-api
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
cmake --build . --target install -j$(nproc)
cd ../..
ls -l telegram-bot-api/bin/telegram-bot-api*
cp telegram-bot-api/bin/telegram-bot-api telegram-bot-api-binary
- name: Upload Binary
uses: actions/upload-artifact@master
with:
name: telegram-bot-api-binary
path: telegram-bot-api-binary
python -m pip install -r bin/scripts/requirements.txt
git log -1 --pretty=format:"%s" > artifacts/caption.txt
python bin/scripts/upload.py ${{ secrets.HELPER_BOT_TOKEN }} ${{ secrets.HELPER_BOT_TARGET }} release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
build/
local.properties
obj/
service_account_credentials.json
service_account_credentials.json
__pycache__/
Loading

0 comments on commit 382f8df

Please sign in to comment.