Skip to content

Commit

Permalink
Add the possiblity to do a major release and disabling automations for (
Browse files Browse the repository at this point in the history
#292)

now
  • Loading branch information
leandroberetta authored Oct 18, 2024
1 parent 947b55a commit 0624066
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
52 changes: 36 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
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:
description: Release type
required: true
type: choice
options:
- major
- minor
- patch
release_branch:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0624066

Please sign in to comment.