Android Build CI #5114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android Build CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'debugci/android_ci/*' | |
| paths-ignore: | |
| - 'landing/**' | |
| - 'web/**' | |
| - 'docs/**' | |
| - 'keyserver/**' | |
| - 'desktop/**' | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| workflow_dispatch: | |
| inputs: | |
| harbormaster_build_target_phid: | |
| required: true | |
| type: string | |
| phabricator_diff_id: | |
| required: true | |
| type: string | |
| phabricator_revision_id: | |
| required: true | |
| type: string | |
| staging_base_ref: | |
| required: true | |
| type: string | |
| staging_diff_ref: | |
| required: true | |
| type: string | |
| jobs: | |
| build: | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout staged diff | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ inputs.staging_diff_ref }} | |
| fetch-depth: 0 | |
| - name: Checkout normal ref | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| uses: actions/checkout@v3 | |
| - name: Clear unused NDKs | |
| run: | | |
| ls -1 "$ANDROID_SDK_ROOT/ndk" | | |
| awk '{ | |
| if (system("git grep " $0 " > /dev/null")) { | |
| system("rm -rf '"$ANDROID_SDK_ROOT/ndk/"'" $0); | |
| } | |
| }' | |
| - name: Delete all iOS simulators | |
| run: xcrun simctl delete all | |
| - name: Delete iOS simulator caches | |
| run: sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* | |
| - name: rustup target add aarch64-linux-android arm-linux-androideabi x86_64-linux-android | |
| run: rustup target add aarch64-linux-android arm-linux-androideabi x86_64-linux-android | |
| - name: Install Protobuf compiler | |
| working-directory: ./scripts | |
| run: sudo ./install_protobuf.sh | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.19.5' | |
| cache: 'yarn' | |
| - name: Install CMake | |
| run: | | |
| yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.18.1" | |
| - name: yarn ci-cleaninstall | |
| run: yarn ci-cleaninstall | |
| - name: Save ANDROID_KEY_STORE_B64 to file | |
| env: | |
| ANDROID_KEY_STORE_B64: ${{secrets.ANDROID_KEY_STORE_B64}} | |
| run: echo "$ANDROID_KEY_STORE_B64" > ANDROID_KEY_STORE_B64.b64 | |
| - name: Save ANDROID_KEY_STORE to file | |
| run: base64 -d -i ANDROID_KEY_STORE_B64.b64 -o android_key_store.keystore | |
| - name: Configure gradle.properties | |
| run: | | |
| mkdir -p ~/.gradle | |
| touch ~/.gradle/gradle.properties | |
| echo "COMM_UPLOAD_STORE_FILE=$(pwd)/android_key_store.keystore" >> ~/.gradle/gradle.properties | |
| echo "COMM_UPLOAD_KEY_ALIAS=AndroidSigningKey" >> ~/.gradle/gradle.properties | |
| - name: Build with Gradle | |
| working-directory: ./native/android | |
| env: | |
| ANDROID_SIGNING_PASSWORD: ${{secrets.ANDROID_SIGNING_PASSWORD}} | |
| COMM_ANDROID_SINGLE_ABI_BUILD: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: JAVA_HOME=${JAVA_HOME_17_arm64} ./gradlew bundleRelease |