From a037b5857bed9cf3d9132b71227eb18739680d9c Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:09:18 +0800 Subject: [PATCH 1/7] ci: fix rc release Signed-off-by: Curtis Wan --- .github/workflows/docker-release.yml | 8 ++++++++ .github/workflows/github-release.yml | 8 ++++++++ tests/kafkatest/version.py | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 63663901d4..68ea13cdf7 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -16,6 +16,10 @@ jobs: permissions: contents: write steps: + - name: Get real Kafka version + id: get_real_version + run: | + echo "kafka_version=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} @@ -29,6 +33,10 @@ jobs: - name: Build TarGz run: | ./gradlew --build-cache --refresh-dependencies clean releaseTarGz + - name: Rename TarGz + run: | + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz # docker image release - name: Cp TarGz to Docker Path diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 0216dcb614..cbeb1628ba 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -16,6 +16,10 @@ jobs: permissions: contents: write steps: + - name: Get real Kafka version + id: get_real_version + run: | + echo "kafka_version=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} @@ -29,6 +33,10 @@ jobs: - name: Build TarGz run: | ./gradlew --build-cache --refresh-dependencies clean releaseTarGz + - name: Rename TarGz + run: | + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz - name: GitHub Release uses: softprops/action-gh-release@v1 diff --git a/tests/kafkatest/version.py b/tests/kafkatest/version.py index 1f558c3a3b..83d5755556 100644 --- a/tests/kafkatest/version.py +++ b/tests/kafkatest/version.py @@ -119,7 +119,7 @@ def get_version(node=None): return DEV_BRANCH DEV_BRANCH = KafkaVersion("dev") -DEV_VERSION = KafkaVersion("1.0.0") +DEV_VERSION = KafkaVersion("1.0.0-SNAPSHOT") LATEST_METADATA_VERSION = "3.3" From 8e70d15073977b12ee70569b1c09c241c7fc5070 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:18:52 +0800 Subject: [PATCH 2/7] test Signed-off-by: Curtis Wan --- .github/workflows/github-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index cbeb1628ba..cdc357bca4 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,7 +19,8 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "kafka_version=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "version is $(grep "version=" "gradle.properties" | awk -F= '{print $2}')" + echo "KAFKA_VERSION=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} @@ -35,8 +36,8 @@ jobs: ./gradlew --build-cache --refresh-dependencies clean releaseTarGz - name: Rename TarGz run: | - mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz - mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.KAFKA_VERSION }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.KAFKA_VERSION }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz - name: GitHub Release uses: softprops/action-gh-release@v1 From 18055d50439b961d5329de569e5c64dc4b3516e6 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:21:07 +0800 Subject: [PATCH 3/7] test2 Signed-off-by: Curtis Wan --- .github/workflows/docker-release.yml | 6 +++--- .github/workflows/github-release.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 68ea13cdf7..903267f508 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -19,7 +19,7 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "kafka_version=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "KAFKA_VERSION=$(grep "version=" ./gradle.properties | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} @@ -35,8 +35,8 @@ jobs: ./gradlew --build-cache --refresh-dependencies clean releaseTarGz - name: Rename TarGz run: | - mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz - mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.kafka_version }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.KAFKA_VERSION }}.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}.tgz + mv ./core/build/distributions/kafka_2.13-${{ steps.get_real_version.outputs.KAFKA_VERSION }}-site-docs.tgz ./core/build/distributions/kafka_2.13-${{ github.ref_name }}-site-docs.tgz # docker image release - name: Cp TarGz to Docker Path diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index cdc357bca4..3cab22ea50 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,8 +19,8 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "version is $(grep "version=" "gradle.properties" | awk -F= '{print $2}')" - echo "KAFKA_VERSION=$(grep "version=" "gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "version is $(grep "version=" ./gradle.properties | awk -F= '{print $2}')" + echo "KAFKA_VERSION=$(grep "version=" ./gradle.properties | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} From ad64427fcdf533ce724de8b8918dd1fe01b80332 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:23:05 +0800 Subject: [PATCH 4/7] test3 Signed-off-by: Curtis Wan --- .github/workflows/github-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 3cab22ea50..5fe106debb 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,6 +19,7 @@ jobs: - name: Get real Kafka version id: get_real_version run: | + echo "current path is $(pwd)" echo "version is $(grep "version=" ./gradle.properties | awk -F= '{print $2}')" echo "KAFKA_VERSION=$(grep "version=" ./gradle.properties | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code From 62960ff358bcd815a2c66ed71b9ab6a1a00c3994 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:25:45 +0800 Subject: [PATCH 5/7] test4 Signed-off-by: Curtis Wan --- .github/workflows/github-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 5fe106debb..897750f137 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,9 +19,8 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "current path is $(pwd)" - echo "version is $(grep "version=" ./gradle.properties | awk -F= '{print $2}')" - echo "KAFKA_VERSION=$(grep "version=" ./gradle.properties | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "version is $(grep "version=" "$(pwd)/gradle.properties" | awk -F= '{print $2}')" + echo "KAFKA_VERSION=$(grep "version=" "$(pwd)/gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} From 3ae90ade43243b22d656b762bd2e3e9750a16010 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 17:27:46 +0800 Subject: [PATCH 6/7] test4 Signed-off-by: Curtis Wan --- .github/workflows/github-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 897750f137..567724c368 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,8 +19,8 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "version is $(grep "version=" "$(pwd)/gradle.properties" | awk -F= '{print $2}')" - echo "KAFKA_VERSION=$(grep "version=" "$(pwd)/gradle.properties" | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "version is $(echo ${{ github.ref_name }} | cut -d'-' -f1)" + echo "KAFKA_VERSION=$(echo ${{ github.ref_name }} | cut -d'-' -f1)" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} From cb4da44ace352caed5fcd716b8d9ebdc3562de4a Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 18 Dec 2023 18:00:13 +0800 Subject: [PATCH 7/7] fix: get release version Signed-off-by: Curtis Wan --- .github/workflows/docker-release.yml | 2 +- .github/workflows/github-release.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 903267f508..18c83ec17a 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -19,7 +19,7 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "KAFKA_VERSION=$(grep "version=" ./gradle.properties | awk -F= '{print $2}')" >> $GITHUB_OUTPUT + echo "KAFKA_VERSION=$(echo ${{ github.ref_name }} | cut -d'-' -f1)" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 567724c368..25a2243732 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -19,7 +19,6 @@ jobs: - name: Get real Kafka version id: get_real_version run: | - echo "version is $(echo ${{ github.ref_name }} | cut -d'-' -f1)" echo "KAFKA_VERSION=$(echo ${{ github.ref_name }} | cut -d'-' -f1)" >> $GITHUB_OUTPUT - name: Checkout Code uses: actions/checkout@v4