| 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') }} |
| 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.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 38 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 39 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> 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.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 66 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 67 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> 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 | steps: |
| 80 | - name: Checkout |
| 81 | uses: actions/checkout@v2 |
| 82 | - name: Fetch Status |
| 83 | run: | |
| 84 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 85 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 86 | - name: Native Cache |
| 87 | id: cache |
| 88 | uses: actions/cache@v2 |
| 89 | with: |
| 90 | path: | |
| 91 | TMessagesProj/src/main/libs |
| 92 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }} |
| 93 | - name: Checkout Library |
| 94 | if: steps.cache.outputs.cache-hit != 'true' |
| 95 | run: | |
| 96 | git submodule update --init 'TMessagesProj/jni/*' |
| 97 | - name: FFmpeg Cache |
| 98 | uses: actions/cache@v2 |
| 99 | if: steps.cache.outputs.cache-hit != 'true' |
| 100 | with: |
| 101 | path: | |
| 102 | TMessagesProj/jni/ffmpeg/build |
| 103 | key: ${{ hashFiles('ffmpeg_status') }} |
| 104 | - name: BoringSSL Cache |
| 105 | uses: actions/cache@v2 |
| 106 | if: steps.cache.outputs.cache-hit != 'true' |
| 107 | with: |
| 108 | path: | |
| 109 | TMessagesProj/jni/boringssl/build |
| 110 | key: ${{ hashFiles('boringssl_status') }} |
| 111 | - name: Setup Android SDK Tools |
| 112 | uses: android-actions/setup-android@v2 |
| 113 | if: steps.cache.outputs.cache-hit != 'true' |
| 114 | - name: Install NDK |
| 115 | if: steps.cache.outputs.cache-hit != 'true' |
| 116 | run: | |
| 117 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 118 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 119 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> local.properties |
| 120 | - name: Fix BoringSSL |
| 121 | if: steps.cache.outputs.cache-hit != 'true' |
| 122 | run: | |
| 123 | cd TMessagesProj/jni |
| 124 | ./patch_boringssl.sh |
| 125 | - name: Native Build |
| 126 | if: steps.cache.outputs.cache-hit != 'true' |
| 127 | run: | |
| 128 | ./run libs native |
| 129 | v2ray: |
| 130 | name: Native Build (V2ray) |
| 131 | runs-on: ubuntu-latest |
| 132 | steps: |
| 133 | - name: Checkout |
| 134 | uses: actions/checkout@v2 |
| 135 | - name: V2ray Cache |
| 136 | id: cache |
| 137 | uses: actions/cache@v2 |
| 138 | with: |
| 139 | path: | |
| 140 | TMessagesProj/libs/libv2ray.aar |
| 141 | key: ${{ hashFiles('bin/libs/v2ray.sh') }} |
| 142 | - name: Setup Android SDK Tools |
| 143 | uses: android-actions/setup-android@v2 |
| 144 | if: steps.cache.outputs.cache-hit != 'true' |
| 145 | - name: Install NDK |
| 146 | if: steps.cache.outputs.cache-hit != 'true' |
| 147 | run: | |
| 148 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 149 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 150 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> local.properties |
| 151 | - name: Install Golang |
| 152 | uses: actions/setup-go@v2 |
| 153 | if: steps.cache.outputs.cache-hit != 'true' |
| 154 | with: |
| 155 | go-version: 1.15 |
| 156 | - name: Native Build |
| 157 | if: steps.cache.outputs.cache-hit != 'true' |
| 158 | run: ./run libs v2ray |
| 159 | shadowsocks: |
| 160 | name: Native Build (Shadowsocks) |
| 161 | runs-on: ubuntu-latest |
| 162 | steps: |
| 163 | - name: Checkout |
| 164 | uses: actions/checkout@v2 |
| 165 | - name: Fetch Status |
| 166 | run: git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 167 | - name: Shadowsocks Cache |
| 168 | id: cache |
| 169 | uses: actions/cache@v2 |
| 170 | with: |
| 171 | path: | |
| 172 | TMessagesProj/libs/ss-rust-release.aar |
| 173 | key: ${{ hashFiles('shadowsocks_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.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 181 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 182 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> local.properties |
| 183 | - name: Install Rust |
| 184 | if: steps.cache.outputs.cache-hit != 'true' |
| 185 | run: ./run init action shadowsocks |
| 186 | - name: Native Build |
| 187 | if: steps.cache.outputs.cache-hit != 'true' |
| 188 | run: ./run libs shadowsocks |
| 189 | shadowsocksr: |
| 190 | name: Native Build (ShadowsocksR) |
| 191 | runs-on: ubuntu-latest |
| 192 | steps: |
| 193 | - name: Checkout |
| 194 | uses: actions/checkout@v2 |
| 195 | - name: Fetch Status |
| 196 | run: git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 197 | - name: ShadowsocksR Cache |
| 198 | id: cache |
| 199 | uses: actions/cache@v2 |
| 200 | with: |
| 201 | path: | |
| 202 | TMessagesProj/libs/ssr-libev-release.aar |
| 203 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 204 | - name: Setup Android SDK Tools |
| 205 | uses: android-actions/setup-android@v2 |
| 206 | if: steps.cache.outputs.cache-hit != 'true' |
| 207 | - name: Install NDK |
| 208 | if: steps.cache.outputs.cache-hit != 'true' |
| 209 | run: | |
| 210 | echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null |
| 211 | echo "sdk.dir=${ANDROID_HOME}" > local.properties |
| 212 | echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> local.properties |
| 213 | - name: Native Build |
| 214 | if: steps.cache.outputs.cache-hit != 'true' |
| 215 | run: ./run libs ssr |
| 216 | debug: |
| 217 | name: Debug Build |
| 218 | runs-on: ubuntu-latest |
| 219 | needs: |
| 220 | - native |
| 221 | - v2ray |
| 222 | - shadowsocks |
| 223 | - shadowsocksr |
| 224 | strategy: |
| 225 | matrix: |
| 226 | flavor: |
| 227 | - FullRelease |
| 228 | - FullReleaseNoGcm |
| 229 | - FullAppleEmojiRelease |
| 230 | - FullAppleEmojiReleaseNoGcm |
| 231 | - MiniRelease |
| 232 | - MiniReleaseNoGcm |
| 233 | - MiniAppleEmojiRelease |
| 234 | - MiniAppleEmojiReleaseNoGcm |
| 235 | steps: |
| 236 | - name: Checkout |
| 237 | uses: actions/checkout@v2 |
| 238 | - name: Setup Android SDK Tools |
| 239 | uses: android-actions/setup-android@v2 |
| 240 | - name: Fetch Status |
| 241 | run: | |
| 242 | git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status |
| 243 | git submodule status TMessagesProj/jni/boringssl > boringssl_status |
| 244 | git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status |
| 245 | git submodule status 'ssr-libev/*' > shadowsocksr_status |
| 246 | - name: Native Cache |
| 247 | id: cache |
| 248 | uses: actions/cache@v2 |
| 249 | with: |
| 250 | path: | |
| 251 | TMessagesProj/src/main/libs |
| 252 | key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }} |
| 253 | - name: V2ray Cache |
| 254 | uses: actions/cache@v2 |
| 255 | with: |
| 256 | path: | |
| 257 | TMessagesProj/libs/libv2ray.aar |
| 258 | key: ${{ hashFiles('bin/libs/v2ray.sh') }} |
| 259 | - name: Shadowsocks Cache |
| 260 | uses: actions/cache@v2 |
| 261 | with: |
| 262 | path: | |
| 263 | TMessagesProj/libs/ss-rust-release.aar |
| 264 | key: ${{ hashFiles('shadowsocks_status') }} |
| 265 | - name: ShadowsocksR Cache |
| 266 | uses: actions/cache@v2 |
| 267 | with: |
| 268 | path: | |
| 269 | TMessagesProj/libs/ssr-libev-release.aar |
| 270 | key: ${{ hashFiles('shadowsocksr_status') }} |
| 271 | - name: Fix Gradle Memoery |
| 272 | run: | |
| 273 | sed -i -e "s/16384/6144/g" gradle.properties |
| 274 | echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" > local.properties |
| 275 | - name: Gradle cache |
| 276 | uses: actions/cache@v2 |
| 277 | with: |
| 278 | path: ~/.gradle |
| 279 | key: gradle-${{ hashFiles('**/*.gradle') }} |
| 280 | - name: Debug Build |
| 281 | run: | |
| 282 | export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" |
| 283 | export DEBUG_BUILD=true |
| 284 | ./gradlew TMessagesProj:assemble${{ matrix.flavor }} |
| 285 |
| 286 | echo "APK_FILE=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')" >> $GITHUB_ENV |
| 287 | echo "APK_FILE_ARMV7=$(find TMessagesProj/build/outputs/apk -name '*armeabi*.apk')" >> $GITHUB_ENV |
| 288 | echo "APK_FILE_X86=$(find TMessagesProj/build/outputs/apk -name '*x86-*.apk')" >> $GITHUB_ENV |
| 289 | echo "APK_FILE_X64=$(find TMessagesProj/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV |
| 290 | - uses: actions/upload-artifact@v2 |
| 291 | name: Upload apk (arm64-v8a) |
| 292 | with: |
| 293 | name: NekoX-${{ matrix.flavor }}-arm64-v8a |
| 294 | path: ${{ env.APK_FILE }} |
| 295 | - uses: actions/upload-artifact@v2 |
| 296 | name: Upload apk (armeabi-v7a) |
| 297 | with: |
| 298 | name: NekoX-${{ matrix.flavor }}-armeabi-v7a |
| 299 | path: ${{ env.APK_FILE_ARMV7 }} |
| 300 | - uses: actions/upload-artifact@v2 |
| 301 | name: Upload apk (x86_64) |
| 302 | with: |
| 303 | name: NekoX-${{ matrix.flavor }}-x86_64 |
| 304 | path: ${{ env.APK_FILE_X64 }} |
| 305 | - uses: actions/upload-artifact@v2 |
| 306 | name: Upload apk (x86) |
| 307 | with: |
| 308 | name: NekoX-${{ matrix.flavor }}-x86 |
| 309 | path: ${{ env.APK_FILE_X86 }} |