Skip to content

Commit 2cbb4b2

Browse files
authored
*: fix prepare minor full release (#4193)
Fix two issues with `prepare-minor-full-release.yml`: - typo at the end of summary - missing update to supported versions in `version.go` category: bug ticket: none
1 parent 11b1a88 commit 2cbb4b2

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/prepare-minor-full-release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,28 @@ jobs:
133133
# Replace v<MAJOR>.<MINOR>-rc with v<MAJOR>.<MINOR>
134134
sed -i -E "s/^(var version = )\"v${MAJOR}\.${MINOR}-rc\"/\1\"${VERSION_IN_CODE}\"/" "$VERSION_FILE"
135135
136-
# Verify the change was successful
136+
# Verify the version change was successful
137137
if ! grep -q "var version = \"${VERSION_IN_CODE}\"" "$VERSION_FILE"; then
138138
echo "::error::Failed to update version to ${VERSION_IN_CODE} in $VERSION_FILE"
139139
exit 1
140140
fi
141141
142-
# Display the change
142+
# Add new version to the top of the Supported() list
143+
# Find the line with "return []SemVer{" and add the new version on the next line
144+
sed -i "/return \[\]SemVer{/a\\
145+
\\t\\t{major: ${MAJOR}, minor: ${MINOR}}," "$VERSION_FILE"
146+
147+
# Verify the supported version was added
148+
if ! grep -q "{major: ${MAJOR}, minor: ${MINOR}}" "$VERSION_FILE"; then
149+
echo "::error::Failed to add version to Supported() in $VERSION_FILE"
150+
exit 1
151+
fi
152+
153+
# Display the changes
143154
echo "::notice::Updated $VERSION_FILE:"
144155
grep "var version" "$VERSION_FILE"
156+
echo "::notice::Added to Supported():"
157+
grep -A 2 "return \[\]SemVer{" "$VERSION_FILE"
145158
146159
echo "WORK_BRANCH=${WORK_BRANCH}" >> $GITHUB_OUTPUT
147160
echo "::notice::Prepared changes for: ${WORK_BRANCH}"
@@ -299,4 +312,4 @@ jobs:
299312
300313
**Note:** This workflow is for minor releases (vX.Y.0). Patch releases (vX.Y.Z) use a separate workflow.
301314
EOF
302-
fi<
315+
fi

0 commit comments

Comments
 (0)