| branches: |
| 6 | - dev |
| 7 | paths-ignore: |
| 8 | - '**.md' |
| 9 | - '.github/**' |
| 10 | - '!.github/workflows/debug.yml' |
| 11 |
| 12 | jobs: |
| 13 | check: |
| 14 | name: Check Access |
| 15 | runs-on: ubuntu-latest |
| 16 | steps: |
| 17 | - name: "Check access" |
| 18 | uses: "lannonbr/repo-permission-check-action@2.0.0" |
| 19 | with: |
| 20 | permission: "write" |
| 21 | env: |
| 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 23 | ffmpeg: |
| 24 | name: Native Build (FFmpeg) |
| 25 | runs-on: ubuntu-latest |
| 26 | needs: check |
| 27 | steps: |
| 28 | - name: Checkout |
| 29 | uses: actions/checkout@v2 |
| 30 | - name: Fetch Status |
| 31 | run: | |
| 32 | sed -i 's/\/\///g' settings.gradle |
| 33 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 34 | git submodule status TMessagesProj/jni/libvpx > libvpx_status |
| 35 | - name: FFmpeg Cache |
| 36 | id: cache |
| 37 | uses: actions/cache@v2 |
| 38 | with: |
| 39 | path: | |
| 40 | TMessagesProj/jni/ffmpeg/build |
| 41 | TMessagesProj/jni/libvpx/build |
| 42 | key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }} |
| 43 | - name: Set up JDK 17 |
| 44 | uses: actions/setup-java@v3 |
| 45 | if: steps.cache.outputs.cache-hit != 'true' |
| 46 | with: |
| 47 | java-version: '17' |
| 48 | distribution: 'temurin' |
| 49 | - name: Setup Android SDK Tools |
| 50 | uses: android-actions/setup-android@v3 |
| 51 | if: steps.cache.outputs.cache-hit != 'true' |
| 52 | - name: Install NDK |
| 53 | if: steps.cache.outputs.cache-hit != 'true' |
| 54 | run: | |
| 55 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 56 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 57 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 58 | - name: Native Build |
| 59 | if: steps.cache.outputs.cache-hit != 'true' |
| 60 | run: | |
| 61 | sudo apt-get install yasm -y |
| 62 | ./run init libs libvpx |
| 63 | ./run init libs ffmpeg |
| 64 | boringssl: |
| 65 | name: Native Build (BoringSSL) |
| 66 | runs-on: ubuntu-latest |
| 67 | needs: check |
| 68 | steps: |
| 69 | - name: Checkout |
| 70 | uses: actions/checkout@v2 |
| 71 | - name: Fetch Status |
| 72 | run: | |
| 73 | sed -i 's/\/\///g' settings.gradle |
| 74 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 75 | - name: BoringSSL Cache |
| 76 | id: cache |
| 77 | uses: actions/cache@v2 |
| 78 | with: |
| 79 | path: | |
| 80 | TMessagesProj/jni/boringssl/build |
| 81 | key: ${{ hashFiles('boringssl_status') }} |
| 82 | - name: Set up JDK 17 |
| 83 | uses: actions/setup-java@v3 |
| 84 | if: steps.cache.outputs.cache-hit != 'true' |
| 85 | with: |
| 86 | java-version: '17' |
| 87 | distribution: 'temurin' |
| 88 | - name: Setup Android SDK Tools |
| 89 | uses: android-actions/setup-android@v3 |
| 90 | if: steps.cache.outputs.cache-hit != 'true' |
| 91 | - name: Install NDK |
| 92 | if: steps.cache.outputs.cache-hit != 'true' |
| 93 | run: | |
| 94 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 95 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 96 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 97 | - name: Native Build |
| 98 | if: steps.cache.outputs.cache-hit != 'true' |
| 99 | run: | |
| 100 | ./run init action boringssl |
| 101 | ./run init libs boringssl |
| 102 | native: |
| 103 | name: Native Build (Telegram) |
| 104 | runs-on: ubuntu-latest |
| 105 | needs: |
| 106 | - ffmpeg |
| 107 | - boringssl |
| 108 | strategy: |
| 109 | matrix: |
| 110 | flavor: |
| 111 | - armeabi-v7a |
| 112 | - arm64-v8a |
| 113 | steps: |
| 114 | - name: Checkout |
| 115 | uses: actions/checkout@v2 |
| 116 | - name: Fetch Status |
| 117 | run: | |
| 118 | sed -i 's/\/\///g' settings.gradle |
| 119 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 120 | git submodule status TMessagesProj/jni/libvpx > libvpx_status |
| 121 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 122 | - name: Native Cache |
| 123 | id: cache |
| 124 | uses: actions/cache@v2 |
| 125 | with: |
| 126 | path: | |
| 127 | TMessagesProj/src/main/libs |
| 128 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-${{ matrix.flavor }} |
| 129 | - name: Checkout Library |
| 130 | if: steps.cache.outputs.cache-hit != 'true' |
| 131 | run: | |
| 132 | git submodule update --init 'TMessagesProj/jni/*' |
| 133 | - name: FFmpeg Cache |
| 134 | uses: actions/cache@v2 |
| 135 | if: steps.cache.outputs.cache-hit != 'true' |
| 136 | with: |
| 137 | path: | |
| 138 | TMessagesProj/jni/ffmpeg/build |
| 139 | TMessagesProj/jni/libvpx/build |
| 140 | key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }} |
| 141 | - name: BoringSSL Cache |
| 142 | uses: actions/cache@v2 |
| 143 | if: steps.cache.outputs.cache-hit != 'true' |
| 144 | with: |
| 145 | path: | |
| 146 | TMessagesProj/jni/boringssl/build |
| 147 | key: ${{ hashFiles('boringssl_status') }} |
| 148 | - name: Set up JDK 17 |
| 149 | uses: actions/setup-java@v3 |
| 150 | if: steps.cache.outputs.cache-hit != 'true' |
| 151 | with: |
| 152 | java-version: '17' |
| 153 | distribution: 'temurin' |
| 154 | - name: Setup Android SDK Tools |
| 155 | uses: android-actions/setup-android@v3 |
| 156 | if: steps.cache.outputs.cache-hit != 'true' |
| 157 | - name: Install NDK |
| 158 | if: steps.cache.outputs.cache-hit != 'true' |
| 159 | run: | |
| 160 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 161 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 162 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 163 | - name: Fix BoringSSL |
| 164 | if: steps.cache.outputs.cache-hit != 'true' |
| 165 | run: | |
| 166 | cd TMessagesProj/jni |
| 167 | ./patch_boringssl.sh |
| 168 | - name: Native Build |
| 169 | if: steps.cache.outputs.cache-hit != 'true' |
| 170 | run: | |
| 171 | export NATIVE_TARGET="${{ matrix.flavor }}" |
| 172 | ./run libs native |
| 173 | v2ray: |
| 174 | name: Native Build (V2ray) |
| 175 | runs-on: ubuntu-latest |
| 176 | needs: check |
| 177 | steps: |
| 178 | - name: Checkout |
| 179 | uses: actions/checkout@v2 |
| 180 | - name: Fetch Status |
| 181 | run: | |
| 182 | sed -i 's/\/\///g' settings.gradle |
| 183 | git submodule status v2ray > v2ray_status |
| 184 | - name: V2ray Cache |
| 185 | id: cache |
| 186 | uses: actions/cache@v2 |
| 187 | with: |
| 188 | path: | |
| 189 | TMessagesProj/libs/libv2ray.aar |
| 190 | key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} |
| 191 | - name: Set up JDK 17 |
| 192 | uses: actions/setup-java@v3 |
| 193 | if: steps.cache.outputs.cache-hit != 'true' |
| 194 | with: |
| 195 | java-version: '17' |
| 196 | distribution: 'temurin' |
| 197 | - name: Setup Android SDK Tools |
| 198 | uses: android-actions/setup-android@v3 |
| 199 | if: steps.cache.outputs.cache-hit != 'true' |
| 200 | - name: Install NDK |
| 201 | if: steps.cache.outputs.cache-hit != 'true' |
| 202 | run: | |
| 203 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 204 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 205 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 206 | - name: Install Golang |
| 207 | uses: actions/setup-go@v2 |
| 208 | if: steps.cache.outputs.cache-hit != 'true' |
| 209 | with: |
| 210 | go-version: 1.16 |
| 211 | - name: Native Build |
| 212 | if: steps.cache.outputs.cache-hit != 'true' |
| 213 | run: ./run libs v2ray |
| 214 | shadowsocks: |
| 215 | name: Native Build (Shadowsocks) |
| 216 | runs-on: ubuntu-latest |
| 217 | needs: check |
| 218 | steps: |
| 219 | - name: Checkout |
| 220 | uses: actions/checkout@v2 |
| 221 | - name: Fetch Status |
| 222 | run: | |
| 223 | sed -i 's/\/\///g' settings.gradle |
| 224 | git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 225 | - name: Shadowsocks Cache |
| 226 | id: cache |
| 227 | uses: actions/cache@v2 |
| 228 | with: |
| 229 | path: | |
| 230 | TMessagesProj/libs/ss-rust-release.aar |
| 231 | key: ${{ hashFiles('shadowsocks_status') }} |
| 232 | - name: Set up JDK 17 |
| 233 | uses: actions/setup-java@v3 |
| 234 | if: steps.cache.outputs.cache-hit != 'true' |
| 235 | with: |
| 236 | java-version: '17' |
| 237 | distribution: 'temurin' |
| 238 | - name: Setup Android SDK Tools |
| 239 | uses: android-actions/setup-android@v3 |
| 240 | if: steps.cache.outputs.cache-hit != 'true' |
| 241 | - name: Install NDK |
| 242 | if: steps.cache.outputs.cache-hit != 'true' |
| 243 | run: | |
| 244 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 245 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 246 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 247 | - name: Install Rust |
| 248 | if: steps.cache.outputs.cache-hit != 'true' |
| 249 | run: ./run init action shadowsocks |
| 250 | - name: Native Build |
| 251 | if: steps.cache.outputs.cache-hit != 'true' |
| 252 | run: ./run libs shadowsocks |
| 253 | shadowsocksr: |
| 254 | name: Native Build (ShadowsocksR) |
| 255 | runs-on: ubuntu-latest |
| 256 | needs: check |
| 257 | steps: |
| 258 | - name: Checkout |
| 259 | uses: actions/checkout@v2 |
| 260 | - name: Fetch Status |
| 261 | run: | |
| 262 | sed -i 's/\/\///g' settings.gradle |
| 263 | git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 264 | - name: ShadowsocksR Cache |
| 265 | id: cache |
| 266 | uses: actions/cache@v2 |
| 267 | with: |
| 268 | path: | |
| 269 | TMessagesProj/libs/ssr-libev-release.aar |
| 270 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 271 | - name: Set up JDK 17 |
| 272 | uses: actions/setup-java@v3 |
| 273 | if: steps.cache.outputs.cache-hit != 'true' |
| 274 | with: |
| 275 | java-version: '17' |
| 276 | distribution: 'temurin' |
| 277 | - name: Setup Android SDK Tools |
| 278 | uses: android-actions/setup-android@v3 |
| 279 | if: steps.cache.outputs.cache-hit != 'true' |
| 280 | - name: Install NDK |
| 281 | if: steps.cache.outputs.cache-hit != 'true' |
| 282 | run: | |
| 283 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 284 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 285 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 286 | - name: Native Build |
| 287 | if: steps.cache.outputs.cache-hit != 'true' |
| 288 | run: ./run libs ssr |
| 289 | build: |
| 290 | name: Gradle Build |
| 291 | runs-on: ubuntu-latest |
| 292 | needs: |
| 293 | - native |
| 294 | - v2ray |
| 295 | - shadowsocks |
| 296 | - shadowsocksr |
| 297 | strategy: |
| 298 | matrix: |
| 299 | flavor: |
| 300 | # - FullRelease |
| 301 | - MiniRelease |
| 302 | - MiniReleaseNoGcm |
| 303 | steps: |
| 304 | - name: Checkout |
| 305 | uses: actions/checkout@v2 |
| 306 | - name: Set up JDK 17 |
| 307 | uses: actions/setup-java@v3 |
| 308 | with: |
| 309 | java-version: '17' |
| 310 | distribution: 'temurin' |
| 311 | - name: Setup Android SDK Tools |
| 312 | uses: android-actions/setup-android@v3 |
| 313 | - name: Install NDK |
| 314 | run: | |
| 315 | echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 316 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 317 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 318 | - name: Fetch Status |
| 319 | run: | |
| 320 | sed -i 's/\/\///g' settings.gradle |
| 321 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 322 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 323 | git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 324 | git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 325 | git submodule status v2ray > v2ray_status |
| 326 | - name: Native Cache (armeabi-v7a) |
| 327 | uses: actions/cache@v2 |
| 328 | with: |
| 329 | path: | |
| 330 | TMessagesProj/src/main/libs |
| 331 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a |
| 332 | - name: Native Cache (arm64-v8a) |
| 333 | uses: actions/cache@v2 |
| 334 | with: |
| 335 | path: | |
| 336 | TMessagesProj/src/main/libs |
| 337 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a |
| 338 | - name: V2ray Cache |
| 339 | uses: actions/cache@v2 |
| 340 | with: |
| 341 | path: | |
| 342 | TMessagesProj/libs/libv2ray.aar |
| 343 | key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} |
| 344 | - name: Shadowsocks Cache |
| 345 | uses: actions/cache@v2 |
| 346 | with: |
| 347 | path: | |
| 348 | TMessagesProj/libs/ss-rust-release.aar |
| 349 | key: ${{ hashFiles('shadowsocks_status') }} |
| 350 | - name: ShadowsocksR Cache |
| 351 | uses: actions/cache@v2 |
| 352 | with: |
| 353 | path: | |
| 354 | TMessagesProj/libs/ssr-libev-release.aar |
| 355 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 356 | - name: Configure Gradle |
| 357 | run: | |
| 358 | sed -i -e "s/16384/6144/g" gradle.properties |
| 359 | echo "sdk.dir=${ANDROID_HOME}" >> local.properties |
| 360 | - name: Gradle cache |
| 361 | uses: actions/cache@v2 |
| 362 | with: |
| 363 | path: ~/.gradle |
| 364 | key: gradle-${{ hashFiles('**/*.gradle') }} |
| 365 | - name: Debug Build |
| 366 | run: | |
| 367 | export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" |
| 368 | export DEBUG_BUILD=true |
| 369 | ./gradlew TMessagesProj:assemble${{ matrix.flavor }} |
| 370 |
| 371 | APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk') |
| 372 | APK=$(dirname $APK) |
| 373 | echo "APK=$APK" >> $GITHUB_ENV |
| 374 | - uses: actions/upload-artifact@v2 |
| 375 | with: |
| 376 | name: ${{ matrix.flavor }} |
| 377 | path: ${{ env.APK }} |
| 378 | # build-nogcm: |
| 379 | # name: Gradle Build (nogcm) |
| 380 | # runs-on: ubuntu-latest |
| 381 | # needs: |
| 382 | # - native |
| 383 | # - v2ray |
| 384 | # - shadowsocks |
| 385 | # - shadowsocksr |
| 386 | # - build |
| 387 | # strategy: |
| 388 | # matrix: |
| 389 | # flavor: |
| 390 | # - FullReleaseNoGcm |
| 391 | # - MiniReleaseNoGcm |
| 392 | # steps: |
| 393 | # - name: Checkout |
| 394 | # uses: actions/checkout@v2 |
| 395 | # - name: Setup Android SDK Tools |
| 396 | # uses: android-actions/setup-android@v2 |
| 397 | # - name: Install NDK |
| 398 | # run: | |
| 399 | # echo "y" | sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 400 | # echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 401 | # echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 402 | # - name: Fetch Status |
| 403 | # run: | |
| 404 | # sed -i 's/\/\///g' settings.gradle |
| 405 | # git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 406 | # git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 407 | # git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 408 | # git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 409 | # git submodule status v2ray > v2ray_status |
| 410 | # - name: Native Cache (armeabi-v7a) |
| 411 | # uses: actions/cache@v2 |
| 412 | # with: |
| 413 | # path: | |
| 414 | # TMessagesProj/src/main/libs |
| 415 | # key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a |
| 416 | # - name: Native Cache (arm64-v8a) |
| 417 | # uses: actions/cache@v2 |
| 418 | # with: |
| 419 | # path: | |
| 420 | # TMessagesProj/src/main/libs |
| 421 | # key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a |
| 422 | # - name: V2ray Cache |
| 423 | # uses: actions/cache@v2 |
| 424 | # with: |
| 425 | # path: | |
| 426 | # TMessagesProj/libs/libv2ray.aar |
| 427 | # key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} |
| 428 | # - name: Shadowsocks Cache |
| 429 | # uses: actions/cache@v2 |
| 430 | # with: |
| 431 | # path: | |
| 432 | # TMessagesProj/libs/ss-rust-release.aar |
| 433 | # key: ${{ hashFiles('shadowsocks_status') }} |
| 434 | # - name: ShadowsocksR Cache |
| 435 | # uses: actions/cache@v2 |
| 436 | # with: |
| 437 | # path: | |
| 438 | # TMessagesProj/libs/ssr-libev-release.aar |
| 439 | # key: ${{ hashFiles('shadowsocksr_status') }} |
| 440 | # - name: Configure Gradle |
| 441 | # run: | |
| 442 | # sed -i -e "s/16384/6144/g" gradle.properties |
| 443 | # echo "sdk.dir=${ANDROID_HOME}" >> local.properties |
| 444 | # - name: Gradle cache |
| 445 | # uses: actions/cache@v2 |
| 446 | # with: |
| 447 | # path: ~/.gradle |
| 448 | # key: gradle-${{ hashFiles('**/*.gradle') }} |
| 449 | # - name: Debug Build |
| 450 | # run: | |
| 451 | # export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" |
| 452 | # export DEBUG_BUILD=true |
| 453 | # ./gradlew TMessagesProj:assemble${{ matrix.flavor }} |
| 454 | # |
| 455 | # APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk') |
| 456 | # APK=$(dirname $APK) |
| 457 | # echo "APK=$APK" >> $GITHUB_ENV |
| 458 | # - uses: actions/upload-artifact@v2 |
| 459 | # with: |
| 460 | # name: ${{ matrix.flavor }} |
| 461 | # path: ${{ env.APK }} |
| 462 | upload: |
| 463 | name: Upload debug |
| 464 | runs-on: ubuntu-latest |
| 465 | if: ${{ !contains(github.event.head_commit.message, 'bump version') }} |
| 466 | needs: |
| 467 | - build |
| 468 | # - build-nogcm |
| 469 | - telegram-bot-api |
| 470 | steps: |
| 471 | - name: Donwload Artifacts |
| 472 | uses: actions/download-artifact@v2 |
| 473 | with: |
| 474 | path: artifacts |
| 475 | - name: Download Telegram Bot API Binary |
| 476 | uses: actions/download-artifact@master |
| 477 | with: |
| 478 | name: telegram-bot-api-binary |
| 479 | path: . |
| 480 | - name: Send to Telegram |
| 481 | run: | |
| 482 | chmod +x telegram-bot-api-binary |
| 483 | function start() { |
| 484 | ./telegram-bot-api-binary --api-id=11535358 --api-hash=33d372962fadb01df47e6ceed4e33cd6 --local 2>&1 > /dev/null & |
| 485 | } |
| 486 | start |
| 487 | curl http://127.0.0.1:8081/ || start |
| 488 | curl http://127.0.0.1:8081/ || start |
| 489 | curl http://127.0.0.1:8081/ || start |
| 490 | # send release via telegram bot api |
| 491 | export mini64=$(find artifacts -name "*mini-arm64-v8a.apk") |
| 492 | export mini32=$(find artifacts -name "*mini-armeabi-v7a.apk") |
| 493 | # export full64=$(find artifacts -name "*full-arm64-v8a.apk") |
| 494 | # export full32=$(find artifacts -name "*full-armeabi-v7a.apk") |
| 495 | export mini64nogcm=$(find artifacts -name "*mini-arm64-v8aNoGcm.apk") |
| 496 | export mini32nogcm=$(find artifacts -name "*mini-armeabi-v7aNoGcm.apk") |
| 497 | # export full64nogcm=$(find artifacts -name "*full-arm64-v8aNoGcm.apk") |
| 498 | # export full32nogcm=$(find artifacts -name "*full-armeabi-v7aNoGcm.apk") |
| 499 |
| 500 | echo $mini64 |
| 501 | echo $mini32 |
| 502 | # echo $full64 |
| 503 | # echo $full32 |
| 504 | echo $mini64nogcm |
| 505 | echo $mini32nogcm |
| 506 | # echo $full64nogcm |
| 507 | # echo $full32nogcm |
| 508 |
| 509 | 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 |
| 510 |
| 511 | pkill telegram-bot |
| 512 | telegram-bot-api: |
| 513 | name: Telegram Bot API |
| 514 | runs-on: ubuntu-latest |
| 515 | steps: |
| 516 | - name: Checkout |
| 517 | uses: actions/checkout@v2 |
| 518 | - name: Clone Telegram Bot API |
| 519 | run: | |
| 520 | git clone --recursive https://github.com/tdlib/telegram-bot-api.git |
| 521 | git status telegram-bot-api >> telegram-bot-api-status |
| 522 | - name: Cache Bot API Binary |
| 523 | id: cache-bot-api |
| 524 | uses: actions/cache@v2 |
| 525 | with: |
| 526 | path: telegram-bot-api-binary |
| 527 | key: CI-telegram-bot-api-${{ hashFiles('telegram-bot-api-status') }} |
| 528 | - name: Compile Telegram Bot API |
| 529 | if: steps.cache-bot-api.outputs.cache-hit != 'true' |
| 530 | run: | |
| 531 | sudo apt-get update |
| 532 | sudo apt-get install make git zlib1g-dev libssl-dev gperf cmake g++ |
| 533 | cd telegram-bot-api |
| 534 | rm -rf build |
| 535 | mkdir build |
| 536 | cd build |
| 537 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. .. |
| 538 | cmake --build . --target install -j$(nproc) |
| 539 | cd ../.. |
| 540 | ls -l telegram-bot-api/bin/telegram-bot-api* |
| 541 | cp telegram-bot-api/bin/telegram-bot-api telegram-bot-api-binary |
| 542 | - name: Upload Binary |
| 543 | uses: actions/upload-artifact@master |
| 544 | with: |
| 545 | name: telegram-bot-api-binary |
| 546 | path: telegram-bot-api-binary |
| 547 |