We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 825fbee commit 8fd9fc7Copy full SHA for 8fd9fc7
scripts/bump-version.sh
@@ -0,0 +1,26 @@
1
+#!/bin/bash
2
+set -e
3
+
4
+version=$(grep 'version=' version.properties | cut -d'=' -f2)
5
+IFS='.' read -r major minor patch <<< "$version"
6
7
+if git log -1 --pretty=%B | grep -q "^feat:"; then
8
+ minor=$((minor + 1))
9
+ patch=0
10
+elif git log -1 --pretty=%B | grep -q "^fix:"; then
11
+ patch=$((patch + 1))
12
+else
13
+ echo "No version bump needed."
14
+ exit 0
15
+fi
16
17
+new_version="$major.$minor.$patch"
18
+echo "Bumping version to $new_version"
19
20
+echo "version=$new_version" > version.properties
21
22
+git config user.name "github-actions"
23
+git config user.email "github-actions@github.com"
24
+git commit -am "chore: bump version to $new_version"
25
+git tag "v$new_version"
26
+git push origin HEAD --tags
0 commit comments