From 1e108bef6ab6ba5f283ceb545f54f13c8fb47d8c Mon Sep 17 00:00:00 2001 From: Jorres Tarasov Date: Tue, 5 Nov 2024 21:40:41 +0100 Subject: [PATCH 1/2] wip --- .github/workflows/create-release-pr.yml | 20 ------------------- .github/workflows/run-tests.yml | 26 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index de6a1270..fb2f96cc 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -29,26 +29,6 @@ jobs: version: latest args: latest - - name: print the latest version without "v" - id: latest-no-v - uses: miniscruff/changie-action@v2 - with: - version: latest - args: latest --remove-prefix - - - name: check-chart-version - run: | - VERSION=${{ steps.latest-no-v.outputs.output }} - APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - - if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then - echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so." - exit 1 - else - echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION." - fi - - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 413a31a1..01e1089e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,6 +5,32 @@ on: - workflow_dispatch jobs: + check-chart-bumped: + concurrency: + group: check-chart-bumped-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: print the latest version without "v" + id: latest-no-v + uses: miniscruff/changie-action@v2 + with: + version: latest + args: latest --remove-prefix + - name: check-chart-version + run: | + VERSION=${{ steps.latest-no-v.outputs.output }} + APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') + CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') + + if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then + echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so." + exit 1 + else + echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION." + fi lint: concurrency: group: lint-golangci-${{ github.head_ref || github.ref_name }} From 315cb81874918913bb127bee1e73664a906d0b35 Mon Sep 17 00:00:00 2001 From: Jorres Tarasov Date: Tue, 5 Nov 2024 21:47:54 +0100 Subject: [PATCH 2/2] wip --- .github/workflows/create-release-pr.yml | 13 +++++++++++++ .github/workflows/run-tests.yml | 26 ------------------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index fb2f96cc..f8e6bba0 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -29,6 +29,19 @@ jobs: version: latest args: latest + - name: print the latest version without "v" + id: latest-no-v + uses: miniscruff/changie-action@v2 + with: + version: latest + args: latest --remove-prefix + + - name: bump-chart-version + run: | + VERSION=${{ steps.latest-no-v.outputs.output }} + sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" ./deploy/ydb-operator/Chart.yaml + sed -i "s/^version:.*/version: \"$VERSION\"/" ./deploy/ydb-operator/Chart.yaml + - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 01e1089e..413a31a1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,32 +5,6 @@ on: - workflow_dispatch jobs: - check-chart-bumped: - concurrency: - group: check-chart-bumped-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - name: print the latest version without "v" - id: latest-no-v - uses: miniscruff/changie-action@v2 - with: - version: latest - args: latest --remove-prefix - - name: check-chart-version - run: | - VERSION=${{ steps.latest-no-v.outputs.output }} - APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - - if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then - echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so." - exit 1 - else - echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION." - fi lint: concurrency: group: lint-golangci-${{ github.head_ref || github.ref_name }}