@@ -54,6 +54,24 @@ if [ -n "${VENDOR}" ]; then
54
54
echo " Setting packager: $VENDOR "
55
55
fi
56
56
57
+ function update_version {
58
+ local tag=$1
59
+ local major
60
+ local minor
61
+ local patch
62
+
63
+ # Extract major, minor, and patch from the tag
64
+ # We need to make sure to remove the "v" prefix from the tag and any characters after the patch version
65
+ tag=$( echo " $tag " | sed ' s/^v//g' | sed ' s/-.*//g' )
66
+ major=$( echo " $tag " | cut -d. -f1)
67
+ minor=$( echo " $tag " | cut -d. -f2)
68
+ patch=$( echo " $tag " | cut -d. -f3)
69
+
70
+ echo " Major: $major , Minor: $minor , Patch: $patch "
71
+
72
+ " ${SCRIPTS_DIR} /update-version.sh" " $major " " $minor " " $patch "
73
+ }
74
+
57
75
function get_file_size {
58
76
local file=" $1 "
59
77
if [[ " $OSTYPE " == " darwin" * ]]; then
@@ -202,6 +220,23 @@ mkdir -p "$OUTPUT_DIR"
202
220
PKG_DIR=" $OUTPUT_DIR /$PACKAGE_NAME "
203
221
PACKAGE_ZIP=" $PACKAGE_NAME .zip"
204
222
223
+ echo " Updating version..."
224
+ update_version " $RELEASE_TAG "
225
+ git config --global github.user " github-actions[bot]"
226
+ git config --global user.name " github-actions[bot]"
227
+ git config --global user.email " 41898282+github-actions[bot]@users.noreply.github.com"
228
+ git add .
229
+
230
+ # We should only commit if there are changes
231
+ need_update_commit=true
232
+ if git diff --cached --quiet; then
233
+ echo " Version already updated"
234
+ need_update_commit=false
235
+ else
236
+ echo " Creating version update commit..."
237
+ git commit -m " change(version): Update core version to $RELEASE_TAG "
238
+ fi
239
+
205
240
echo " Updating submodules ..."
206
241
git -C " $GITHUB_WORKSPACE " submodule update --init --recursive > /dev/null 2>&1
207
242
@@ -469,6 +504,17 @@ if [ "$RELEASE_PRE" == "false" ]; then
469
504
echo
470
505
fi
471
506
507
+ if [ " $need_update_commit " == " true" ]; then
508
+ echo " Pushing version update commit..."
509
+ git push
510
+ new_tag_commit=$( git rev-parse HEAD)
511
+ echo " New commit: $new_tag_commit "
512
+
513
+ echo " Moving tag $RELEASE_TAG to $new_tag_commit ..."
514
+ git tag -f " $RELEASE_TAG " " $new_tag_commit "
515
+ git push --force origin " $RELEASE_TAG "
516
+ fi
517
+
472
518
set +e
473
519
474
520
# #
0 commit comments