Skip to content

Commit 2c1a8a0

Browse files
authored
chore: Trigger automatic release for minor version (#584)
1 parent 22cecba commit 2c1a8a0

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ preview-version:
4444
.PHONY: update-version
4545
update-version:
4646
## When manually updating major version
47-
./releaser/scripts/update-version.sh
47+
./releaser/scripts/update-major-version.sh
4848

4949
.PHONY: generate_mocks
5050
generate_mocks:

tools/releaser/scripts/new-version.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ if [ "$NEW_RESOURCE_VERSION" == "$SDK_RESOURCE_VERSION" ]; then
2424
if [ -n "$BREAKING_CHANGES" ]; then
2525
echo "BREAKING CHANGES DETECTED FOR NON MAJOR VERSION BUMP"
2626
# shellcheck source=/dev/null
27-
source "$script_path/update-version.sh"
27+
source "$script_path/update-major-version.sh"
28+
exit 0;
29+
elif [ -n "$NON_BREAKING_CHANGES" ]; then
30+
echo "NON BREAKING CHANGES DETECTED FOR NON MAJOR VERSION BUMP"
31+
# shellcheck source=/dev/null
32+
source "$script_path/update-minor-version.sh"
2833
exit 0;
2934
fi
3035
else
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -ueo pipefail
3+
4+
script_path=$(dirname "$0")
5+
# shellcheck source=/dev/null
6+
source "$script_path/extract-version.sh"
7+
# shellcheck source=/dev/null
8+
source "$script_path/version-paths.sh"
9+
10+
# Display the extracted version
11+
echo "Current Resource Version: $NEW_RESOURCE_VERSION"
12+
13+
# Increment minor version
14+
new_minor=$((SDK_MINOR_VERSION + 1))
15+
16+
# Create new version string
17+
BUMPED_VERSION="${SDK_MAJOR_VERSION}.${new_minor}.0"
18+
19+
echo "Modifying $SDK_MAJOR_VERSION.$SDK_MINOR_VERSION.0 to $BUMPED_VERSION across the repository."
20+
npm install
21+
npm exec -c "replace-in-file /$SDK_MAJOR_VERSION\.$SDK_MINOR_VERSION\.0/g $BUMPED_VERSION $VERSION_UPDATE_PATHS --isRegex"
22+
23+
## Explicitly update version.go file
24+
export SDK_VERSION="${BUMPED_VERSION}"
25+
26+
echo "Updating version.go file: $SDK_VERSION"
27+
target_file_path="$script_path/../../../internal/core/version.go"
28+
envsubst < "$script_path/../templates/VERSION.tmpl" > "$target_file_path"

0 commit comments

Comments
 (0)