Skip to content

Commit 8a940a2

Browse files
committed
Update workflows from templates.
1 parent 0033702 commit 8a940a2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/bump-version.get.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
# Find the version files in this directory or its descendants, but don't recurse too deep.
2222
# This line must be kept in sync with "bump-version.set.sh".
23-
VERSFILES=$(find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E '.*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt)$')
23+
VERSFILES=$(find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E '.*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt|build.gradle.kts)$')
2424

2525
# Do we have at least one?
2626
if [ -z "${VERSFILES}" ] ; then
@@ -72,6 +72,9 @@ for FILE in ${VERSFILES} ; do
7272
version.sbt)
7373
VERS=$(sed -e 's/^[^"]*"//' -e 's/"$//' < "${FILE}")
7474
;;
75+
build.gradle.kts)
76+
VERS=$(grep "^version.*=" < "${FILE}" | sed -e 's/^[^"]*"//' -e 's/"$//')
77+
;;
7578
*)
7679
echo "Can't parse '${FILE}' for version" 1>&2
7780
exit 1

.github/bump-version.set.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535

3636
# Find the version files in this directory or its descendants, but don't recurse too deep.
3737
# This line must be kept in sync with "bump-version.get.sh".
38-
VERSFILES=$(find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E '.*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt)$')
38+
VERSFILES=$(find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E '.*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt|build.gradle.kts)$')
3939

4040
# Edit the version files.
4141
for FILE in ${VERSFILES} ; do
@@ -100,6 +100,13 @@ for FILE in ${VERSFILES} ; do
100100
rm "${FILE}.tmp"
101101
;;
102102

103+
build.gradle.kts)
104+
# Replace -foo with -SNAPSHOT to be compatible with Java conventions.
105+
JAVAVERS="${NEWVERS/-*/-SNAPSHOT}"
106+
sed 's/^version = ".*"$/version = "'"${JAVAVERS}"'"/' "${FILE}" > "${FILE}.tmp"
107+
mv "${FILE}.tmp" "${FILE}"
108+
;;
109+
103110
*)
104111
echo "Can't edit '${FILE}' with new version" 1>&2
105112
exit 1

0 commit comments

Comments
 (0)