Skip to content

Commit

Permalink
Add the ability to do major releases (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroberetta authored Oct 18, 2024
1 parent eaf4e87 commit 2633307
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 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 07:00 (UTC)
- cron: '00 7 * * MON'
#- cron: '00 7 * * MON'
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
type: choice
options:
- major
- minor
- patch
release_branch:
Expand Down Expand Up @@ -109,6 +110,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 @@ -128,6 +132,9 @@ jobs:
elif [[ $RELEASE_TYPE == "minor" ]]
then
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 @@ -209,7 +216,7 @@ jobs:
- name: Create tag
run: |
# Skip OLM metadata for patch releases
if [[ $RELEASE_TYPE == "minor" ]]
if [[ $RELEASE_TYPE == "minor" || $RELEASE_TYPE == "major" ]]
then
VERSION_TO_RELEASE=${RELEASE_VERSION:1}
DATETIME_NOW="$(date --utc +'%FT%TZ')"
Expand Down Expand Up @@ -245,15 +252,15 @@ jobs:
run: git push origin $(git rev-parse HEAD):refs/heads/$BRANCH_VERSION

- name: Configure Operator SDK
if: ${{ needs.initialize.outputs.release_type == 'minor' }}
if: ${{ needs.initialize.outputs.release_type == 'minor' || needs.initialize.outputs.release_type == 'major' }}
run: |
make get-operator-sdk
- name: Create a PR to prepare for next version
env:
BUILD_TAG: kiali-operator-release-${{ github.run_number }}-main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ needs.initialize.outputs.release_type == 'minor' }}
if: ${{ needs.initialize.outputs.release_type == 'minor' || needs.initialize.outputs.release_type == 'major' }}
run: |
export PATH="$PATH:$GITHUB_WORKSPACE/_output/operator-sdk-install"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OUTDIR=${ROOTDIR}/_output
TARGET_ARCHS ?= amd64 arm64 s390x ppc64le

# Identifies the current build.
VERSION ?= v1.90.0-SNAPSHOT
VERSION ?= v2.0.0-SNAPSHOT
COMMIT_HASH ?= $(shell git rev-parse HEAD)

# Identifies the Kiali operator container image that will be built
Expand Down

0 comments on commit 2633307

Please sign in to comment.