| branches: |
| 6 | - dev |
| 7 | paths-ignore: |
| 8 | - '**.md' |
| 9 | - '.github/**' |
| 10 | - '!.github/workflows/debug.yml' |
| 11 | pull_request: |
| 12 | branches: |
| 13 | - dev |
| 14 |
| 15 | jobs: |
| 16 | ffmpeg: |
| 17 | name: Native Build (FFmpeg) |
| 18 | runs-on: ubuntu-latest |
| 19 | steps: |
| 20 | - name: Checkout |
| 21 | uses: actions/checkout@v2 |
| 22 | - name: Fetch Status |
| 23 | run: git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 24 | - name: FFmpeg Cache |
| 25 | id: cache |
| 26 | uses: actions/cache@v2 |
| 27 | with: |
| 28 | path: | |
| 29 | TMessagesProj/jni/ffmpeg/build |
| 30 | key: ${{ hashFiles('ffmpeg_status', 'TMessagesProj/jni/*_ffmpeg.sh') }} |
| 31 | - name: Setup Android SDK Tools |
| 32 | uses: android-actions/setup-android@v2 |
| 33 | if: steps.cache.outputs.cache-hit != 'true' |
| 34 | - name: Install NDK |
| 35 | if: steps.cache.outputs.cache-hit != 'true' |
| 36 | run: | |
| 37 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 38 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 39 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 40 | - name: Native Build |
| 41 | if: steps.cache.outputs.cache-hit != 'true' |
| 42 | run: | |
| 43 | ./run init libs ffmpeg |
| 44 | boringssl: |
| 45 | name: Native Build (BoringSSL) |
| 46 | runs-on: ubuntu-latest |
| 47 | steps: |
| 48 | - name: Checkout |
| 49 | uses: actions/checkout@v2 |
| 50 | - name: Fetch Status |
| 51 | run: git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 52 | - name: BoringSSL Cache |
| 53 | id: cache |
| 54 | uses: actions/cache@v2 |
| 55 | with: |
| 56 | path: | |
| 57 | TMessagesProj/jni/boringssl/build |
| 58 | key: ${{ hashFiles('boringssl_status') }} |
| 59 | - name: Setup Android SDK Tools |
| 60 | uses: android-actions/setup-android@v2 |
| 61 | if: steps.cache.outputs.cache-hit != 'true' |
| 62 | - name: Install NDK |
| 63 | if: steps.cache.outputs.cache-hit != 'true' |
| 64 | run: | |
| 65 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 66 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 67 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 68 | - name: Native Build |
| 69 | if: steps.cache.outputs.cache-hit != 'true' |
| 70 | run: | |
| 71 | ./run init action boringssl |
| 72 | ./run init libs boringssl |
| 73 | native: |
| 74 | name: Native Build (Telegram) |
| 75 | runs-on: ubuntu-latest |
| 76 | needs: |
| 77 | - ffmpeg |
| 78 | - boringssl |
| 79 | strategy: |
| 80 | matrix: |
| 81 | flavor: |
| 82 | - armeabi-v7a |
| 83 | - arm64-v8a |
| 84 | - x86 |
| 85 | - x86_64 |
| 86 | steps: |
| 87 | - name: Checkout |
| 88 | uses: actions/checkout@v2 |
| 89 | - name: Fetch Status |
| 90 | run: | |
| 91 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 92 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 93 | - name: Native Cache |
| 94 | id: cache |
| 95 | uses: actions/cache@v2 |
| 96 | with: |
| 97 | path: | |
| 98 | TMessagesProj/src/main/libs |
| 99 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-${{ matrix.flavor }} |
| 100 | - name: Checkout Library |
| 101 | if: steps.cache.outputs.cache-hit != 'true' |
| 102 | run: | |
| 103 | git submodule update --init 'TMessagesProj/jni/*' |
| 104 | - name: FFmpeg Cache |
| 105 | uses: actions/cache@v2 |
| 106 | if: steps.cache.outputs.cache-hit != 'true' |
| 107 | with: |
| 108 | path: | |
| 109 | TMessagesProj/jni/ffmpeg/build |
| 110 | key: ${{ hashFiles('ffmpeg_status', 'TMessagesProj/jni/*_ffmpeg.sh') }} |
| 111 | - name: BoringSSL Cache |
| 112 | uses: actions/cache@v2 |
| 113 | if: steps.cache.outputs.cache-hit != 'true' |
| 114 | with: |
| 115 | path: | |
| 116 | TMessagesProj/jni/boringssl/build |
| 117 | key: ${{ hashFiles('boringssl_status') }} |
| 118 | - name: Setup Android SDK Tools |
| 119 | uses: android-actions/setup-android@v2 |
| 120 | if: steps.cache.outputs.cache-hit != 'true' |
| 121 | - name: Install NDK |
| 122 | if: steps.cache.outputs.cache-hit != 'true' |
| 123 | run: | |
| 124 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 125 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 126 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 127 | - name: Fix BoringSSL |
| 128 | if: steps.cache.outputs.cache-hit != 'true' |
| 129 | run: | |
| 130 | cd TMessagesProj/jni |
| 131 | ./patch_boringssl.sh |
| 132 | - name: Native Build |
| 133 | if: steps.cache.outputs.cache-hit != 'true' |
| 134 | run: | |
| 135 | export NATIVE_TARGET="${{ matrix.flavor }}" |
| 136 | ./run libs native |
| 137 | v2ray: |
| 138 | name: Native Build (V2ray) |
| 139 | runs-on: ubuntu-latest |
| 140 | steps: |
| 141 | - name: Checkout |
| 142 | uses: actions/checkout@v2 |
| 143 | - name: Fetch Status |
| 144 | run: git submodule status v2ray > v2ray_status |
| 145 | - name: V2ray Cache |
| 146 | id: cache |
| 147 | uses: actions/cache@v2 |
| 148 | with: |
| 149 | path: | |
| 150 | TMessagesProj/libs/libv2ray.aar |
| 151 | key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} |
| 152 | - name: Setup Android SDK Tools |
| 153 | uses: android-actions/setup-android@v2 |
| 154 | if: steps.cache.outputs.cache-hit != 'true' |
| 155 | - name: Install NDK |
| 156 | if: steps.cache.outputs.cache-hit != 'true' |
| 157 | run: | |
| 158 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 159 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 160 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 161 | - name: Install Golang |
| 162 | uses: actions/setup-go@v2 |
| 163 | if: steps.cache.outputs.cache-hit != 'true' |
| 164 | with: |
| 165 | go-version: 1.16 |
| 166 | - name: Native Build |
| 167 | if: steps.cache.outputs.cache-hit != 'true' |
| 168 | run: ./run libs v2ray |
| 169 | shadowsocks: |
| 170 | name: Native Build (Shadowsocks) |
| 171 | runs-on: ubuntu-latest |
| 172 | steps: |
| 173 | - name: Checkout |
| 174 | uses: actions/checkout@v2 |
| 175 | - name: Fetch Status |
| 176 | run: git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 177 | - name: Shadowsocks Cache |
| 178 | id: cache |
| 179 | uses: actions/cache@v2 |
| 180 | with: |
| 181 | path: | |
| 182 | TMessagesProj/libs/ss-rust-release.aar |
| 183 | key: ${{ hashFiles('shadowsocks_status') }} |
| 184 | - name: Setup Android SDK Tools |
| 185 | uses: android-actions/setup-android@v2 |
| 186 | if: steps.cache.outputs.cache-hit != 'true' |
| 187 | - name: Install NDK |
| 188 | if: steps.cache.outputs.cache-hit != 'true' |
| 189 | run: | |
| 190 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 191 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 192 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 193 | - name: Install Rust |
| 194 | if: steps.cache.outputs.cache-hit != 'true' |
| 195 | run: ./run init action shadowsocks |
| 196 | - name: Native Build |
| 197 | if: steps.cache.outputs.cache-hit != 'true' |
| 198 | run: ./run libs shadowsocks |
| 199 | shadowsocksr: |
| 200 | name: Native Build (ShadowsocksR) |
| 201 | runs-on: ubuntu-latest |
| 202 | steps: |
| 203 | - name: Checkout |
| 204 | uses: actions/checkout@v2 |
| 205 | - name: Fetch Status |
| 206 | run: git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 207 | - name: ShadowsocksR Cache |
| 208 | id: cache |
| 209 | uses: actions/cache@v2 |
| 210 | with: |
| 211 | path: | |
| 212 | TMessagesProj/libs/ssr-libev-release.aar |
| 213 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 214 | - name: Setup Android SDK Tools |
| 215 | uses: android-actions/setup-android@v2 |
| 216 | if: steps.cache.outputs.cache-hit != 'true' |
| 217 | - name: Install NDK |
| 218 | if: steps.cache.outputs.cache-hit != 'true' |
| 219 | run: | |
| 220 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 221 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 222 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties |
| 223 | - name: Native Build |
| 224 | if: steps.cache.outputs.cache-hit != 'true' |
| 225 | run: ./run libs ssr |
| 226 | build: |
| 227 | name: Gradle Build |
| 228 | runs-on: ubuntu-latest |
| 229 | needs: |
| 230 | - native |
| 231 | - v2ray |
| 232 | - shadowsocks |
| 233 | - shadowsocksr |
| 234 | strategy: |
| 235 | matrix: |
| 236 | flavor: |
| 237 | - MiniRelease |
| 238 | - MiniReleaseNoGcm |
| 239 | - MiniAppleEmojiRelease |
| 240 | - MiniAppleEmojiReleaseNoGcm |
| 241 | - FullRelease |
| 242 | - FullReleaseNoGcm |
| 243 | - FullAppleEmojiRelease |
| 244 | - FullAppleEmojiReleaseNoGcm |
| 245 | steps: |
| 246 | - name: Checkout |
| 247 | uses: actions/checkout@v2 |
| 248 | - name: Setup Android SDK Tools |
| 249 | uses: android-actions/setup-android@v2 |
| 250 | - name: Fetch Status |
| 251 | run: | |
| 252 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 253 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 254 | git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 255 | git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 256 | git submodule status v2ray > v2ray_status |
| 257 | - name: Native Cache (armeabi-v7a) |
| 258 | uses: actions/cache@v2 |
| 259 | with: |
| 260 | path: | |
| 261 | TMessagesProj/src/main/libs |
| 262 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a |
| 263 | - name: Native Cache (arm64-v8a) |
| 264 | uses: actions/cache@v2 |
| 265 | with: |
| 266 | path: | |
| 267 | TMessagesProj/src/main/libs |
| 268 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a |
| 269 | - name: Native Cache (x86) |
| 270 | uses: actions/cache@v2 |
| 271 | with: |
| 272 | path: | |
| 273 | TMessagesProj/src/main/libs |
| 274 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86 |
| 275 | - name: Native Cache (x86_64) |
| 276 | uses: actions/cache@v2 |
| 277 | with: |
| 278 | path: | |
| 279 | TMessagesProj/src/main/libs |
| 280 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86_64 |
| 281 | - name: V2ray Cache |
| 282 | uses: actions/cache@v2 |
| 283 | with: |
| 284 | path: | |
| 285 | TMessagesProj/libs/libv2ray.aar |
| 286 | key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} |
| 287 | - name: Shadowsocks Cache |
| 288 | uses: actions/cache@v2 |
| 289 | with: |
| 290 | path: | |
| 291 | TMessagesProj/libs/ss-rust-release.aar |
| 292 | key: ${{ hashFiles('shadowsocks_status') }} |
| 293 | - name: ShadowsocksR Cache |
| 294 | uses: actions/cache@v2 |
| 295 | with: |
| 296 | path: | |
| 297 | TMessagesProj/libs/ssr-libev-release.aar |
| 298 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 299 | - name: Configure Gradle |
| 300 | run: | |
| 301 | sed -i -e "s/16384/6144/g" gradle.properties |
| 302 | echo "sdk.dir=${ANDROID_HOME}" >> local.properties |
| 303 | echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties |
| 304 | - name: Gradle cache |
| 305 | uses: actions/cache@v2 |
| 306 | with: |
| 307 | path: ~/.gradle |
| 308 | key: gradle-${{ hashFiles('**/*.gradle') }} |
| 309 | - name: Debug Build |
| 310 | run: | |
| 311 | export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" |
| 312 | export DEBUG_BUILD=true |
| 313 | ./gradlew TMessagesProj:assemble${{ matrix.flavor }} |
| 314 |
| 315 | # echo "APK_FILE=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')" >> $GITHUB_ENV |
| 316 | # echo "APK_FILE_ARMV7=$(find TMessagesProj/build/outputs/apk -name '*armeabi*.apk')" >> $GITHUB_ENV |
| 317 | # echo "APK_FILE_X86=$(find TMessagesProj/build/outputs/apk -name '*x86-*.apk')" >> $GITHUB_ENV |
| 318 | # echo "APK_FILE_X64=$(find TMessagesProj/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV |
| 319 | # - uses: actions/upload-artifact@v2 |
| 320 | # name: Upload apk (arm64-v8a) |
| 321 | # with: |
| 322 | # name: NekoX-${{ matrix.flavor }}-arm64-v8a |
| 323 | # path: ${{ env.APK_FILE }} |
| 324 | # - uses: actions/upload-artifact@v2 |
| 325 | # name: Upload apk (armeabi-v7a) |
| 326 | # with: |
| 327 | # name: NekoX-${{ matrix.flavor }}-armeabi-v7a |
| 328 | # path: ${{ env.APK_FILE_ARMV7 }} |
| 329 | # - uses: actions/upload-artifact@v2 |
| 330 | # name: Upload apk (x86_64) |
| 331 | # with: |
| 332 | # name: NekoX-${{ matrix.flavor }}-x86_64 |
| 333 | # path: ${{ env.APK_FILE_X64 }} |
| 334 | # - uses: actions/upload-artifact@v2 |
| 335 | # name: Upload apk (x86) |
| 336 | # with: |
| 337 | # name: NekoX-${{ matrix.flavor }}-x86 |
| 338 | # path: ${{ env.APK_FILE_X86 }} |