Skip to content

Commit 0508963

Browse files
AsCressmarcnause
authored andcommitted
chore: selectively update versioning data
1 parent ef6b10f commit 0508963

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/push-event.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,24 @@ jobs:
3434
3535
# Read and increment version name
3636
IFS='.' read -r major minor patch < versionName.txt
37-
current_patch_version_name="$major.$minor.$patch"
38-
echo "VERSION_NAME=$current_patch_version_name" >> $GITHUB_OUTPUT
37+
38+
if [[ "$commit_message" =~ ^feat: ]]; then
39+
next_minor=$((minor + 1))
40+
next_patch=0
41+
else
42+
next_minor=$((minor))
43+
next_patch=$((patch + 1))
44+
fi
45+
next_version_name="$major.$next_minor.$next_patch"
46+
echo "VERSION_NAME=$next_version_name" >> $GITHUB_OUTPUT
47+
echo "$next_version_name" > versionName.txt
48+
49+
# Read and increment version code
50+
read -r version_code < versionCode.txt
3951
40-
next_patch=$((patch + 1))
41-
next_patch_version_name="$major.$minor.$next_patch"
42-
echo "$next_patch_version_name" > versionName.txt
52+
new_version_code=$((version_code + 1))
53+
echo "VERSION_CODE=$new_version_code" >> $GITHUB_OUTPUT
54+
echo "$new_version_code" > versionCode.txt
4355
4456
# Read and increment version code
4557
read -r version_code < versionCode.txt

0 commit comments

Comments
 (0)