diff --git a/.github/actions/build-greptime-binary/action.yml b/.github/actions/build-greptime-binary/action.yml index a5eb4c9de949..aecd931f0eae 100644 --- a/.github/actions/build-greptime-binary/action.yml +++ b/.github/actions/build-greptime-binary/action.yml @@ -32,12 +32,17 @@ inputs: description: Upload to S3 required: false default: 'true' + working-dir: + description: Working directory to build the artifacts + required: false + default: . runs: using: composite steps: - name: Build greptime binary shell: bash run: | + cd ${{ inputs.working-dir }} && \ make build-greptime-by-buildx \ CARGO_PROFILE=${{ inputs.cargo-profile }} \ FEATURES=${{ inputs.features }} \ @@ -54,3 +59,4 @@ runs: aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: ${{ inputs.aws-region }} upload-to-s3: ${{ inputs.upload-to-s3 }} + working-dir: ${{ inputs.working-dir }} diff --git a/.github/actions/build-linux-artifacts/action.yml b/.github/actions/build-linux-artifacts/action.yml index 0944b8889e14..018ee191534e 100644 --- a/.github/actions/build-linux-artifacts/action.yml +++ b/.github/actions/build-linux-artifacts/action.yml @@ -33,6 +33,10 @@ inputs: description: Upload to S3 required: false default: 'true' + working-dir: + description: Working directory to build the artifacts + required: false + default: . runs: using: composite steps: @@ -41,6 +45,7 @@ runs: shell: bash # NOTE: If the BUILD_JOBS > 4, it's always OOM in EC2 instance. run: | + cd ${{ inputs.working-dir }} && \ make run-it-in-container BUILD_JOBS=4 - name: Upload sqlness logs @@ -64,6 +69,7 @@ runs: aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: ${{ inputs.aws-region }} upload-to-s3: ${{ inputs.upload-to-s3 }} + working-dir: ${{ inputs.working-dir }} - name: Build greptime without pyo3 if: ${{ inputs.dev-mode == 'false' }} @@ -79,6 +85,7 @@ runs: aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: ${{ inputs.aws-region }} upload-to-s3: ${{ inputs.upload-to-s3 }} + working-dir: ${{ inputs.working-dir }} - name: Build greptime on centos base image uses: ./.github/actions/build-greptime-binary @@ -94,3 +101,4 @@ runs: aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: ${{ inputs.aws-region }} upload-to-s3: ${{ inputs.upload-to-s3 }} + working-dir: ${{ inputs.working-dir }} diff --git a/.github/actions/upload-artifacts/action.yml b/.github/actions/upload-artifacts/action.yml index 2ef402f8d00b..f8a0fe5216fd 100644 --- a/.github/actions/upload-artifacts/action.yml +++ b/.github/actions/upload-artifacts/action.yml @@ -26,10 +26,15 @@ inputs: description: Upload to S3 required: false default: 'true' + working-dir: + description: Working directory to upload the artifacts + required: false + default: . runs: using: composite steps: - name: Create artifacts directory + working-directory: ${{ inputs.working-dir }} shell: bash run: | mkdir -p ${{ inputs.artifacts-dir }} && \ @@ -41,6 +46,7 @@ runs: # greptime-linux-amd64-pyo3-v0.3.0 # └── greptime - name: Compress artifacts and calculate checksum + working-directory: ${{ inputs.working-dir }} shell: bash run: | tar -zcvf ${{ inputs.artifacts-dir }}.tar.gz ${{ inputs.artifacts-dir }} && \ @@ -52,13 +58,13 @@ runs: uses: actions/upload-artifact@v3 with: name: ${{ inputs.artifacts-dir }} - path: ${{ inputs.artifacts-dir }}.tar.gz + path: ${{ inputs.working-dir }}/${{ inputs.artifacts-dir }}.tar.gz - name: Upload checksum uses: actions/upload-artifact@v3 with: name: ${{ inputs.artifacts-dir }}.sha256sum - path: ${{ inputs.artifacts-dir }}.sha256sum + path: ${{ inputs.working-dir }}/${{ inputs.artifacts-dir }}.sha256sum - name: Configure AWS credentials if: ${{ inputs.upload-to-s3 == 'true' }} @@ -70,6 +76,7 @@ runs: - name: Upload artifacts to S3 if: ${{ inputs.upload-to-s3 == 'true' }} + working-directory: ${{ inputs.working-dir }} shell: bash # The bucket layout will be: # releases/greptimedb diff --git a/.github/scripts/create-version.sh b/.github/scripts/create-version.sh index 458fa93ca3c7..e87c74cffbd1 100755 --- a/.github/scripts/create-version.sh +++ b/.github/scripts/create-version.sh @@ -38,7 +38,7 @@ function create_version() { echo "COMMIT_SHA is empty in dev build" exit 1 fi - echo "dev-$(date "+%Y%m%d%S")-$(echo "$COMMIT_SHA" | cut -c1-8)" + echo "dev-$(date "+%Y%m%d-%s")-$(echo "$COMMIT_SHA" | cut -c1-8)" exit 0 fi @@ -50,7 +50,7 @@ function create_version() { fi echo "$GITHUB_REF_NAME" elif [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then - echo "$NEXT_RELEASE_VERSION-$(git rev-parse --short HEAD)-$(date "+%Y%m%d%S")" + echo "$NEXT_RELEASE_VERSION-$(git rev-parse --short HEAD)-$(date "+%Y%m%d-%s")" elif [ "$GITHUB_EVENT_NAME" = schedule ]; then echo "$NEXT_RELEASE_VERSION-$NIGHTLY_RELEASE_PREFIX-$(date "+%Y%m%d")" else diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 68988f009308..c54fd889b6cc 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -159,7 +159,6 @@ jobs: path: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} - uses: ./.github/actions/build-linux-artifacts - working-directory: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} with: arch: amd64 cargo-profile: ${{ env.CARGO_PROFILE }} @@ -171,6 +170,7 @@ jobs: aws-region: ${{ vars.AWS_RELEASE_BUCKET_REGION }} dev-mode: true # Only build the standard greptime binary. upload-to-s3: false # No need to upload to S3. + working-dir: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} build-linux-arm64-artifacts: name: Build linux-arm64 artifacts @@ -193,7 +193,6 @@ jobs: path: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} - uses: ./.github/actions/build-linux-artifacts - working-directory: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} with: arch: arm64 cargo-profile: ${{ env.CARGO_PROFILE }} @@ -205,6 +204,7 @@ jobs: aws-region: ${{ vars.AWS_RELEASE_BUCKET_REGION }} dev-mode: true # Only build the standard greptime binary. upload-to-s3: false # No need to upload to S3. + working-dir: ${{ env.CHECKOUT_GREPTIMEDB_PATH }} release-images-to-dockerhub: name: Build and push images to DockerHub