File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 - test
1919 - preprod
2020 - prod
21+ release_type :
22+ description : " Version bump type (patch, minor, major)"
23+ required : false
24+ default : " patch"
25+ type : choice
26+ options :
27+ - patch
28+ - minor
29+ - major
2130
2231jobs :
2332 metadata :
@@ -124,7 +133,21 @@ jobs:
124133 else
125134 # Extract the version numbers
126135 IFS='.' read -r major minor patch <<< "${latest_tag#v}"
127- patch=$((patch + 1))
136+ case "${{ github.event.inputs.release_type }}" in
137+ major)
138+ major=$((major + 1))
139+ minor=0
140+ patch=0
141+ ;;
142+ minor)
143+ minor=$((minor + 1))
144+ patch=0
145+ ;;
146+ patch|*)
147+ patch=$((patch + 1))
148+ ;;
149+ esac
150+
128151 next_tag="v${major}.${minor}.${patch}"
129152 fi
130153
@@ -136,8 +159,8 @@ jobs:
136159 env :
137160 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
138161 with :
139- tag_name : ${{ steps.next_tag.outputs.next_tag }}
140- release_name : Release ${{ steps.next_tag.outputs.next_tag }}
162+ tag_name : ${{ steps.next_tag.outputs.tag }}
163+ release_name : Release ${{ steps.next_tag.outputs.tag }}
141164 body : |
142165 Auto-release created during deployment.
143166 draft : false
You can’t perform that action at this time.
0 commit comments