From 0624066a4c9ee7dd362752597cd9c8fe05d51d9f Mon Sep 17 00:00:00 2001 From: Leandro Beretta Date: Fri, 18 Oct 2024 11:31:53 -0300 Subject: [PATCH] Add the possiblity to do a major release and disabling automations for (#292) now --- .github/workflows/release.yml | 52 ++++++++++++++++++++++++----------- Makefile | 2 +- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c89fcc5..10ef79e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ name: Release on: - schedule: + #schedule: # Every Monday at 08:00 (UTC) - try to make sure it happens after all Kiali-related images are released - - cron: '00 8 * * MON' + #- cron: '00 8 * * MON' workflow_dispatch: inputs: release_type: @@ -11,6 +11,7 @@ on: required: true type: choice options: + - major - minor - patch release_branch: @@ -104,6 +105,9 @@ jobs: then RELEASE_VERSION=$(python bump.py $RELEASE_TYPE $RELEASE_VERSION) elif [[ $RELEASE_TYPE == "minor" ]] + then + RELEASE_VERSION=$RELEASE_VERSION + elif [[ $RELEASE_TYPE == "major" ]] then RELEASE_VERSION=$RELEASE_VERSION fi @@ -122,7 +126,10 @@ jobs: NEXT_VERSION=$(python bump.py $RELEASE_TYPE $RELEASE_VERSION) elif [[ $RELEASE_TYPE == "minor" ]] then - NEXT_VERSION=$(python bump.py $RELEASE_TYPE $RELEASE_VERSION) + NEXT_VERSION=$(python bump.py $RELEASE_TYPE $RELEASE_VERSION) + elif [[ $RELEASE_TYPE == "major" ]] + then + NEXT_VERSION=$(python bump.py "minor" $RELEASE_VERSION) fi echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT @@ -202,11 +209,12 @@ jobs: env: BUILD_TAG: helm-charts-release-${{ github.run_number }}-main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} run: | - # If we did a minor release, we need to create the vX.Y branch, so that it can + # If we did a minor or major release, we need to create the vX.Y branch, so that it can # be used as a base for a patch release. # Also, we create a vX.Y.Z tag. - if [[ $RELEASE_TYPE == "minor" ]] + if [[ $RELEASE_TYPE == "minor" || $RELEASE_TYPE == "major" ]] then git push origin $(git rev-parse HEAD):refs/heads/$BRANCH_VERSION @@ -220,13 +228,19 @@ jobs: git commit -m "Prepare for next version" git push origin $(git rev-parse HEAD):refs/heads/$BUILD_TAG - - if hack/smoke-test-release-branch.sh --release-branch $BUILD_TAG; then - prtitle="Prepare for next version (smoke test passed)" - prmsg="The smoke test has passed. Please merge to update version numbers and prepare for release $NEXT_VERSION" + + if [[ $GITHUB_REPOSITORY == 'kiali/helm-charts' ]] + then + if hack/smoke-test-release-branch.sh --release-branch $BUILD_TAG; then + prtitle="Prepare for next version (smoke test passed)" + prmsg="The smoke test has passed. Please merge to update version numbers and prepare for release $NEXT_VERSION" + else + prtitle="[DO NOT MERGE YET] Prepare for next version" + prmsg="DO NOT MERGE YET! The smoke test failed. Please fix the problem before merging this PR which updates version numbers and prepares for release $NEXT_VERSION" + fi else - prtitle="[DO NOT MERGE YET] Prepare for next version" - prmsg="DO NOT MERGE YET! The smoke test failed. Please fix the problem before merging this PR which updates version numbers and prepares for release $NEXT_VERSION" + prtitle="Prepare for next version (smoke test does not run on this repository)" + prmsg="The smoke test does not run on this repository. Please merge to update version numbers and prepare for release $NEXT_VERSION" fi gh pr create -t "$prtitle" -b "$prmsg" -H $BUILD_TAG -B $RELEASE_BRANCH @@ -237,12 +251,18 @@ jobs: then git push origin $(git rev-parse HEAD):refs/heads/$BUILD_TAG - if hack/smoke-test-release-branch.sh --release-branch $BUILD_TAG; then - prtitle="Prepare for next version (smoke test passed)" - prmsg="The smoke test has passed. Please merge to update version numbers and prepare for release $NEXT_VERSION" + if [[ $GITHUB_REPOSITORY == 'kiali/helm-charts' ]] + then + if hack/smoke-test-release-branch.sh --release-branch $BUILD_TAG; then + prtitle="Prepare for next version (smoke test passed)" + prmsg="The smoke test has passed. Please merge to update version numbers and prepare for release $NEXT_VERSION" + else + prtitle="[DO NOT MERGE YET] Prepare for next version" + prmsg="DO NOT MERGE YET! The smoke test failed. Please fix the problem before merging this PR which updates version numbers and prepares for release $NEXT_VERSION" + fi else - prtitle="[DO NOT MERGE YET] Prepare for next version" - prmsg="DO NOT MERGE YET! The smoke test failed. Please fix the problem before merging this PR which updates version numbers and prepares for release $NEXT_VERSION" + prtitle="Prepare for next version (smoke test does not run on this repository)" + prmsg="The smoke test does not run on this repository. Please merge to update version numbers and prepare for release $NEXT_VERSION" fi gh pr create -t "$prtitle" -b "$prmsg" -H $BUILD_TAG -B master diff --git a/Makefile b/Makefile index 1a980d6..4e83fd7 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ROOTDIR=$(CURDIR) OUTDIR=${ROOTDIR}/_output # Identifies the current build. -VERSION ?= v1.90.0-SNAPSHOT +VERSION ?= v2.0.0-SNAPSHOT SEMVER ?= $(shell echo ${VERSION} | sed 's/^v//g') COMMIT_HASH ?= $(shell git rev-parse HEAD)