Skip to content

Commit

Permalink
fix: ci sdkmanager install
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYi0526 authored Jan 14, 2024
1 parent d6d271e commit 7531680
Showing 1 changed file with 107 additions and 114 deletions.
221 changes: 107 additions & 114 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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
Expand Down Expand Up @@ -176,22 +176,14 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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: Install Golang
uses: actions/setup-go@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
go-version: 1.21
- name: Install Gomobile
if: steps.cache.outputs.cache-hit != 'true'
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latest
env:
GOPROXY: https://proxy.golang.org,direct
GO111MODULE: "on"
go-version: 1.16
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs v2ray
Expand Down Expand Up @@ -219,7 +211,7 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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: Install Rust
Expand Down Expand Up @@ -252,7 +244,7 @@ jobs:
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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
Expand All @@ -269,91 +261,8 @@ jobs:
strategy:
matrix:
flavor:
- FullRelease
# - FullRelease
- MiniRelease
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
- name: Install NDK
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/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 }}
build-nogcm:
name: Gradle Build (nogcm)
runs-on: ubuntu-latest
needs:
- native
- v2ray
- shadowsocks
- shadowsocksr
- build
strategy:
matrix:
flavor:
- FullReleaseNoGcm
- MiniReleaseNoGcm
steps:
- name: Checkout
Expand All @@ -362,7 +271,7 @@ jobs:
uses: android-actions/setup-android@v2
- name: Install NDK
run: |
echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
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
Expand Down Expand Up @@ -425,13 +334,97 @@ jobs:
with:
name: ${{ matrix.flavor }}
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
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'bump version') }}
needs:
- build
- build-nogcm
# - build-nogcm
- telegram-bot-api
steps:
- name: Donwload Artifacts
Expand All @@ -454,25 +447,25 @@ jobs:
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 "*mini-arm64-v8a-unsigned.apk")
export mini32=$(find artifacts -name "*mini-armeabi-v7a-unsigned.apk")
export full64=$(find artifacts -name "*full-arm64-v8a-unsigned.apk")
export full32=$(find artifacts -name "*full-armeabi-v7a-unsigned.apk")
export mini64nogcm=$(find artifacts -name "*mini-arm64-v8aNoGcm-unsigned.apk")
export mini32nogcm=$(find artifacts -name "*mini-armeabi-v7aNoGcm-unsigned.apk")
export full64nogcm=$(find artifacts -name "*full-arm64-v8aNoGcm-unsigned.apk")
export full32nogcm=$(find artifacts -name "*full-armeabi-v7aNoGcm-unsigned.apk")
export mini64=$(find artifacts -name "*mini-arm64-v8a.apk")
export mini32=$(find artifacts -name "*mini-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 "*mini-arm64-v8aNoGcm.apk")
export mini32nogcm=$(find artifacts -name "*mini-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 $full64
# echo $full32
echo $mini64nogcm
echo $mini32nogcm
echo $full64nogcm
echo $full32nogcm
# 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=@"${full64}" --form apk4=@"${full32}" --form apk5=@"${mini64nogcm}" --form apk6=@"${mini32nogcm}" --form apk7=@"${full64nogcm}" --form apk8=@"${full32nogcm}" --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\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk5\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk6\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk7\",\"caption\": \"\",\"parse_mode\": \"Markdown\"},{\"type\": \"document\",\"media\": \"attach://apk8\",\"caption\": \"Test version, ${{ github.event.head_commit.message }}\",\"parse_mode\": \"Markdown\"}]" --verbose >/dev/null
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:
Expand Down

0 comments on commit 7531680

Please sign in to comment.