Skip to content

Commit

Permalink
Update workflows from templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
leeroy-travis committed Oct 2, 2023
1 parent 1802430 commit dc35d5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/bump-version.get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi

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

# Do we have at least one?
if [ -z "${VERSFILES}" ] ; then
Expand Down Expand Up @@ -72,6 +72,9 @@ for FILE in ${VERSFILES} ; do
version.sbt)
VERS=$(sed -e 's/^[^"]*"//' -e 's/"$//' < "${FILE}")
;;
build.gradle.kts)
VERS=$(grep "^version.*=" < "${FILE}" | sed -e 's/^[^"]*"//' -e 's/"$//')
;;
*)
echo "Can't parse '${FILE}' for version" 1>&2
exit 1
Expand Down
9 changes: 8 additions & 1 deletion .github/bump-version.set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi

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

# Edit the version files.
for FILE in ${VERSFILES} ; do
Expand Down Expand Up @@ -100,6 +100,13 @@ for FILE in ${VERSFILES} ; do
rm "${FILE}.tmp"
;;

build.gradle.kts)
# Replace -foo with -SNAPSHOT to be compatible with Java conventions.
JAVAVERS="${NEWVERS/-*/-SNAPSHOT}"
sed 's/^version = ".*"$/version = "'"${JAVAVERS}"'"/' "${FILE}" > "${FILE}.tmp"
mv "${FILE}.tmp" "${FILE}"
;;

*)
echo "Can't edit '${FILE}' with new version" 1>&2
exit 1
Expand Down

0 comments on commit dc35d5c

Please sign in to comment.