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