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