diff --git a/.github/actions/build-dev-builder-image/action.yml b/.github/actions/build-dev-builder-image/action.yml index f15d2996fcff..3a6b10313cec 100644 --- a/.github/actions/build-dev-builder-image/action.yml +++ b/.github/actions/build-dev-builder-image/action.yml @@ -67,7 +67,6 @@ runs: run: make dev-builder \ BASE_IMAGE=android \ - BUILDX_MULTI_PLATFORM_BUILD=true \ IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ IMAGE_TAG=${{ inputs.version }} diff --git a/.github/actions/build-greptime-binary/action.yml b/.github/actions/build-greptime-binary/action.yml index d03498d78906..a55601c17708 100644 --- a/.github/actions/build-greptime-binary/action.yml +++ b/.github/actions/build-greptime-binary/action.yml @@ -36,6 +36,10 @@ inputs: description: Upload the latest artifacts to S3 required: false default: 'true' + build-android-artifacts: + description: Build android artifacts + required: false + default: 'false' working-dir: description: Working directory to build the artifacts required: false @@ -45,6 +49,7 @@ runs: steps: - name: Build greptime binary shell: bash + if: ${{ inputs.build-android-artifacts == 'false' }} run: | cd ${{ inputs.working-dir }} && \ make build-by-dev-builder \ @@ -54,6 +59,7 @@ runs: - name: Upload artifacts uses: ./.github/actions/upload-artifacts + if: ${{ inputs.build-android-artifacts == 'false' }} with: artifacts-dir: ${{ inputs.artifacts-dir }} target-file: ./target/${{ inputs.cargo-profile }}/greptime @@ -65,3 +71,25 @@ runs: upload-to-s3: ${{ inputs.upload-to-s3 }} upload-latest-artifacts: ${{ inputs.upload-latest-artifacts }} working-dir: ${{ inputs.working-dir }} + + # TODO(zyy17): We can remove build-android-artifacts flag in the future. + - name: Build greptime binary + shell: bash + if: ${{ inputs.build-android-artifacts == 'true' }} + run: | + cd ${{ inputs.working-dir }} && make strip-android-bin + + - name: Upload android artifacts + uses: ./.github/actions/upload-artifacts + if: ${{ inputs.build-android-artifacts == 'true' }} + with: + artifacts-dir: ${{ inputs.artifacts-dir }} + target-file: ./target/aarch64-linux-android/release/greptime + version: ${{ inputs.version }} + release-to-s3-bucket: ${{ inputs.release-to-s3-bucket }} + aws-access-key-id: ${{ inputs.aws-access-key-id }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + aws-region: ${{ inputs.aws-region }} + upload-to-s3: ${{ inputs.upload-to-s3 }} + upload-latest-artifacts: ${{ inputs.upload-latest-artifacts }} + working-dir: ${{ inputs.working-dir }} diff --git a/.github/actions/build-linux-artifacts/action.yml b/.github/actions/build-linux-artifacts/action.yml index 003790e41264..54362ef29554 100644 --- a/.github/actions/build-linux-artifacts/action.yml +++ b/.github/actions/build-linux-artifacts/action.yml @@ -114,3 +114,19 @@ runs: upload-to-s3: ${{ inputs.upload-to-s3 }} upload-latest-artifacts: ${{ inputs.upload-latest-artifacts }} working-dir: ${{ inputs.working-dir }} + + - name: Build greptime on android base image + uses: ./.github/actions/build-greptime-binary + if: ${{ inputs.arch == 'amd64' && inputs.dev-mode == 'false' }} # Only build android base image on amd64. + with: + base-image: android + artifacts-dir: greptime-android-arm64-${{ inputs.version }} + version: ${{ inputs.version }} + release-to-s3-bucket: ${{ inputs.release-to-s3-bucket }} + aws-access-key-id: ${{ inputs.aws-access-key-id }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + aws-region: ${{ inputs.aws-region }} + upload-to-s3: ${{ inputs.upload-to-s3 }} + upload-latest-artifacts: ${{ inputs.upload-latest-artifacts }} + working-dir: ${{ inputs.working-dir }} + build-android-artifacts: true diff --git a/Makefile b/Makefile index c0ef6cb65a6e..2c54c19411d1 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,7 @@ build-android-bin: ## Build greptime binary for android. CARGO_BUILD_EXTRA_OPTS="--bin greptime --no-default-features" .PHONY: strip-android-bin -strip-android-bin: ## Strip greptime binary for android. +strip-android-bin: build-android-bin ## Strip greptime binary for android. docker run --network=host \ -v ${PWD}:/greptimedb \ -w /greptimedb ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/dev-builder-android:latest \