From 6a8b7e9d0cbd339b8d9e6c846c35606437ecfd11 Mon Sep 17 00:00:00 2001 From: "semih.cavdar" Date: Wed, 20 Mar 2024 11:14:55 +0300 Subject: [PATCH 1/3] #20 add version-check.yml --- .github/workflows/version-check.yml | 60 +++++++++++++++++++++++++++++ kafka-retry-job.sln | 1 + 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/version-check.yml diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 0000000..e38ae64 --- /dev/null +++ b/.github/workflows/version-check.yml @@ -0,0 +1,60 @@ +name: Version Check + +on: + push: + branches: + - '**' + +jobs: + verify-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Get version + id: version + run: | + version=$(git show HEAD:.github/workflows/publish.yml | awk '/tags/{print $2}' | sed 's/,$//') + echo "version=$version" >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: main + + - name: Get main version + id: main_version + run: | + main_version=$(git show HEAD:.github/workflows/publish.yml | awk '/tags/{print $2}' | sed 's/,$//') + echo "main_version=$main_version" >> $GITHUB_ENV + + - name: Use Output + id: output + run: | + echo "current_version : $version" + echo "main_version : $main_version" + + - name: Compare versions + id: compare_versions + run: | + IFS='.' read -ra version_parts <<< "$version" + IFS='.' read -ra main_version_parts <<< "$main_version" + for i in "${!version_parts[@]}"; do + if [ "${version_parts[i]}" -lt "${main_version_parts[i]}" ]; then + echo "$version is less than $main_version" + exit 1 + elif [ "${version_parts[i]}" -gt "${main_version_parts[i]}" ]; then + echo "$version is greater than $main_version" + exit 0 + fi + done + + if [ "${version_parts[@]}" != "${main_version_parts[@]}" ]; then + echo "Error: $main_version is greater than $version" + exit 1 + fi + + echo "Please update the version. Current version: $version is equal to previous version: $main_version" + exit 1 \ No newline at end of file diff --git a/kafka-retry-job.sln b/kafka-retry-job.sln index 7bf0a5c..38c69c2 100644 --- a/kafka-retry-job.sln +++ b/kafka-retry-job.sln @@ -10,6 +10,7 @@ ProjectSection(SolutionItems) = preProject version_check.sh = version_check.sh .github\workflows\publish.yml = .github\workflows\publish.yml .github\workflows\test.yml = .github\workflows\test.yml + .github\workflows\version-check.yml = .github\workflows\version-check.yml EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kafka.retry.job.tests", "tests\kafka.retry.job.tests.csproj", "{7C35FE3D-43A2-418D-8DF3-94383DE6FE2E}" From 4ce1032ea2ab61ac145cf93ea708c885347cb5cb Mon Sep 17 00:00:00 2001 From: "semih.cavdar" Date: Wed, 20 Mar 2024 11:17:02 +0300 Subject: [PATCH 2/3] #20 upgrade version --- .github/workflows/publish.yml | 2 +- .gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 76df587..c3172d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: name: Build & push Docker image with: image: kafka-retry-job - tags: 1.12.1, latest + tags: 1.12.2, latest registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} password: ${{ secrets.GHCR_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a166a27..d192d1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: - VERSION: "1.12.1" + VERSION: "1.12.2" DOCKER_IMAGE_VERSION: $GITLAB_REGISTRY_HOST/$CI_PROJECT_PATH:$VERSION DOCKER_IMAGE_LATEST: $GITLAB_REGISTRY_HOST/$CI_PROJECT_PATH From ccb9f71c7b9eb199ae32a436112a8cfa34cfeaaa Mon Sep 17 00:00:00 2001 From: "semih.cavdar" Date: Wed, 20 Mar 2024 11:21:28 +0300 Subject: [PATCH 3/3] #20 add CHANGELOG.MD --- CHANGELOG.MD | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 8504857..51998c5 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,15 @@ # Changelog +## [1.12.2](https://github.com/github-changelog-generator/github-changelog-generator/tree/1.16.4) (2024-03) + +**Closed issues:** + +- [\#20](https://github.com/Trendyol/kafka-retry-job/issues/36) Add version check workflow to compare main and current version + +**Merged pull requests:** + +- Pull Request for the issues #20 [\#40](https://github.com/Trendyol/kafka-retry-job/pull/40) ([semihcavdar](https://github.com/semihcavdar)) + ## [1.12.1](https://github.com/github-changelog-generator/github-changelog-generator/tree/1.16.4) (2024-02) **Closed issues:**