From 3bf412140c37527483a1d764e4884e63eaaedc1d Mon Sep 17 00:00:00 2001 From: benjobs Date: Wed, 10 Sep 2025 11:02:02 +0800 Subject: [PATCH 1/2] [INFRA] Build and push docker images for historical versions --- .github/workflows/docker-push.yml | 36 +++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 59b6f9f258..b28c1db0b4 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -19,10 +19,8 @@ name: "Build Docker Image" on: schedule: - - cron: '30 02 * * *' + - cron: '30 03 * * *' push: - branches: - - release-* tags: - 'v[2-9]+.[0-9]+.[0-9]+' @@ -31,12 +29,41 @@ concurrency: cancel-in-progress: true jobs: + get-tags: + runs-on: ubuntu-latest + if: ${{ github.repository == 'apache/streampark' && github.event_name == 'schedule' }} + outputs: + tags: ${{ steps.get-tags.outputs.tags }} + steps: + - name: Check out the repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get all matching tags + id: get-tags + run: | + # 获取所有符合规则的标签 + TAGS=$(git tag -l | grep -E '^v[2-9]+\.[0-9]+\.[0-9]+$' | sort -V) + echo "Found tags: $TAGS" + + # 将标签转换为 JSON 数组格式 + TAGS_JSON=$(echo "$TAGS" | jq -R -s -c 'split("\n")[:-1]') + echo "tags=$TAGS_JSON" >> $GITHUB_OUTPUT + echo "Found $TAGS_JSON" + build_image: runs-on: ubuntu-latest - if: ${{ github.repository == 'apache/streampark' }} + if: ${{ github.repository == 'apache/streampark' && (github.event_name == 'push' || (github.event_name == 'schedule' && needs.get-tags.outputs.tags != '[]')) }} + needs: get-tags + strategy: + matrix: + tag: ${{ fromJson(needs.get-tags.outputs.tags) }} steps: - name: Check out the repo uses: actions/checkout@v3 + with: + ref: ${{ matrix.tag }} - name: Setup Java and Scala uses: olafurpg/setup-scala@v13 @@ -79,6 +106,7 @@ jobs: tags: | type=ref,event=tag type=ref,event=branch + type=raw,value=${{ matrix.tag }} - name: Build and push streampark uses: docker/build-push-action@v3 From 536baf9b835efcd842a2455a7de292564873180c Mon Sep 17 00:00:00 2001 From: benjobs Date: Wed, 10 Sep 2025 11:30:53 +0800 Subject: [PATCH 2/2] Update cron schedule for Docker image build --- .github/workflows/docker-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index b28c1db0b4..f3a172eb5d 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -19,7 +19,7 @@ name: "Build Docker Image" on: schedule: - - cron: '30 03 * * *' + - cron: '20 04 * * *' push: tags: - 'v[2-9]+.[0-9]+.[0-9]+'