From 4cbd9dffc05cf8420d8850209d8849ad429a3d94 Mon Sep 17 00:00:00 2001 From: evenyag Date: Tue, 23 Apr 2024 21:04:00 +0800 Subject: [PATCH] build: only build amd64 for centos --- .github/actions/build-dev-builder-images/action.yml | 12 ++++++------ .github/actions/build-linux-artifacts/action.yml | 6 +++--- Makefile | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/actions/build-dev-builder-images/action.yml b/.github/actions/build-dev-builder-images/action.yml index 0ce97931654f..6bb14e14f44d 100644 --- a/.github/actions/build-dev-builder-images/action.yml +++ b/.github/actions/build-dev-builder-images/action.yml @@ -22,15 +22,15 @@ inputs: build-dev-builder-ubuntu: description: Build dev-builder-ubuntu image required: false - default: 'true' + default: "true" build-dev-builder-centos: description: Build dev-builder-centos image required: false - default: 'true' + default: "true" build-dev-builder-android: description: Build dev-builder-android image required: false - default: 'true' + default: "true" runs: using: composite steps: @@ -47,7 +47,7 @@ runs: run: | make dev-builder \ BASE_IMAGE=ubuntu \ - BUILDX_MULTI_PLATFORM_BUILD=true \ + BUILDX_MULTI_PLATFORM_BUILD=all \ IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ IMAGE_TAG=${{ inputs.version }} @@ -58,7 +58,7 @@ runs: run: | make dev-builder \ BASE_IMAGE=centos \ - BUILDX_MULTI_PLATFORM_BUILD=true \ + BUILDX_MULTI_PLATFORM_BUILD=amd64 \ IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ IMAGE_TAG=${{ inputs.version }} @@ -72,5 +72,5 @@ runs: IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ IMAGE_TAG=${{ inputs.version }} && \ - + docker push ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-android:${{ inputs.version }} diff --git a/.github/actions/build-linux-artifacts/action.yml b/.github/actions/build-linux-artifacts/action.yml index 26eb4c81c09f..8c5c0a6c4b36 100644 --- a/.github/actions/build-linux-artifacts/action.yml +++ b/.github/actions/build-linux-artifacts/action.yml @@ -16,7 +16,7 @@ inputs: dev-mode: description: Enable dev mode, only build standard greptime required: false - default: 'false' + default: "false" working-dir: description: Working directory to build the artifacts required: false @@ -68,7 +68,7 @@ runs: - name: Build greptime on centos base image uses: ./.github/actions/build-greptime-binary - if: ${{ inputs.arch == 'amd64' && inputs.dev-mode == 'false' }} # Only build centos7 base image for amd64. + if: ${{ inputs.arch == 'amd64' && inputs.dev-mode == 'false' }} # Builds greptime for centos if the host machine is amd64. with: base-image: centos features: servers/dashboard @@ -79,7 +79,7 @@ runs: - 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. + if: ${{ inputs.arch == 'amd64' && inputs.dev-mode == 'false' }} # Builds arm64 greptime binary for android if the host machine amd64. with: base-image: android artifacts-dir: greptime-android-arm64-${{ inputs.version }} diff --git a/Makefile b/Makefile index 4826bbb5dd76..cb8e0ce273bb 100644 --- a/Makefile +++ b/Makefile @@ -54,8 +54,10 @@ ifneq ($(strip $(RELEASE)),) CARGO_BUILD_OPTS += --release endif -ifeq ($(BUILDX_MULTI_PLATFORM_BUILD), true) +ifeq ($(BUILDX_MULTI_PLATFORM_BUILD), all) BUILDX_MULTI_PLATFORM_BUILD_OPTS := --platform linux/amd64,linux/arm64 --push +else ifeq ($(BUILDX_MULTI_PLATFORM_BUILD), amd64) + BUILDX_MULTI_PLATFORM_BUILD_OPTS := --platform linux/amd64 --push else BUILDX_MULTI_PLATFORM_BUILD_OPTS := -o type=docker endif