diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89f7f13a6..30cd72d97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,12 +5,6 @@ on: tag: description: 'Release Tag' required: true - play: - description: 'Play: If want ignore' - required: false - upload: - description: 'Upload: If want ignore' - required: false publish: description: 'Publish: If want ignore' required: false @@ -258,9 +252,7 @@ jobs: strategy: matrix: flavor: - - FullRelease - FullReleaseNoGcm - - MiniRelease - MiniReleaseNoGcm steps: - name: Checkout @@ -362,165 +354,3 @@ jobs: mkdir apks find artifacts -name "*.apk" -exec cp {} apks \; ./ghr -delete -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks - upload: - name: Upload Release - if: github.event.inputs.upload != 'y' - runs-on: ubuntu-latest - needs: - - build - - telegram-bot-api - steps: - - name: Donwload Artifacts - uses: actions/download-artifact@v2 - with: - path: artifacts - - name: Download Telegram Bot API Binary - uses: actions/download-artifact@master - with: - name: telegram-bot-api-binary - path: . - - name: Release - run: | - chmod +x telegram-bot-api-binary - ./telegram-bot-api-binary --api-id=21724 --api-hash=3e0cb5efcd52300aec5994fdfc5bdc16 --local 2>&1 > /dev/null & - curl http://127.0.0.1:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage \ - -X POST \ - -F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ - -F text="==== ${{ github.event.inputs.tag }} ====" \ - --silent --show-error --fail >/dev/null - mkdir apks - find artifacts -name "*.apk" -exec cp {} apks \; - function upload() { - for apk in $@; do - echo ">> Uploading $apk" - curl http://127.0.0.1:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \ - -X POST \ - -F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ - -F document="@$apk" \ - --retry 5 \ - --retry-delay 5 \ - --silent --show-error --fail >/dev/null - sleep 1 - done - } - upload apks/NekoX-*-mini-*-release.apk - upload apks/NekoX-*-mini-*-releaseNoGcm.apk - upload apks/NekoX-*-full-*-release.apk - upload apks/NekoX-*-full-*-releaseNoGcm.apk - pkill telegram-bot - play: - name: Publish to Play Store - if: github.event.inputs.play != 'y' - runs-on: ubuntu-latest - needs: - - native - - v2ray - - shadowsocks - - shadowsocksr - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Android SDK Tools - uses: android-actions/setup-android@v2 - - name: Fetch Status - run: | - 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: Native Cache (x86) - uses: actions/cache@v2 - with: - path: | - TMessagesProj/src/main/libs - key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86 - - name: Native Cache (x86_64) - uses: actions/cache@v2 - with: - path: | - TMessagesProj/src/main/libs - key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86_64 - - 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: Fix Gradle Memoery - run: | - sed -i -e "s/16384/6144/g" gradle.properties -# echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" > local.properties - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle') }} - - name: Publish to Play Store - run: | - export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" - cat > service_account_credentials.json << EOF - ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}" - EOF - sed -i -e 's@@@g' TMessagesProj/src/main/AndroidManifest.xml - ./gradlew TMessagesProj:publishMiniPlayReleaseApk - - 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 \ No newline at end of file