Skip to content

Commit

Permalink
Update release workflow to support major version release (prebid#3235)
Browse files Browse the repository at this point in the history
  • Loading branch information
onkarvhanumante authored and svamiftah committed Nov 21, 2023
1 parent 528a968 commit 0a5d645
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:
releaseType:
type: choice
options:
- major
- minor
- patch
default: minor
required: true
description: 'minor: v0.X.0, patch: v0.0.X'
description: 'major: vX.0.0, minor: v0.X.0, patch: v0.0.X'
debug:
type: boolean
default: true
Expand Down Expand Up @@ -78,11 +79,18 @@ jobs:
nextTag=''
releaseType=${{ inputs.releaseType }}
if [ $releaseType == "minor" ]; then
# increment minor version and reset patch version
nextTag=$(echo "${currentTag}" | awk -F. '{OFS="."; $2+=1; $3=0; print $0}')
if [ $releaseType == "major" ]; then
# PBS-GO skipped the v1.0.0 major release - https://github.com/prebid/prebid-server/issues/3068
# If the current tag is v0.x.x, the script sets the next release tag to v2.0.0
# Otherwise, the script increments the major version by 1 and sets the minor and patch versions to zero
# For example, v2.x.x will be incremented to v3.0.0
major=$(echo "${currentTag}" | awk -F. '{gsub(/^v/, "", $1); if($1 == 0) $1=2; else $1+=1; print $1}')
nextTag="v${major}.0.0"
elif [ $releaseType == "minor" ]; then
# Increment minor version and reset patch version
nextTag=$(echo "${currentTag}" | awk -F. '{OFS="."; $2+=1; $3=0; print $0}')
else
# increment patch version
# Increment patch version
nextTag=$(echo "${currentTag}" | awk -F. '{OFS="."; $3+=1; print $0}')
fi
Expand Down

0 comments on commit 0a5d645

Please sign in to comment.