Skip to content

Commit d14ade2

Browse files
committed
fix: inline set-version logic in build-release.sh
The set-version.sh task was deleted in 4b7cca3 but build-release.sh still called it, breaking `mise run build-release` and CI. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 9a9f843 commit d14ade2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.mise/tasks/build-release.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55

66
set -euo pipefail
77

8-
# shellcheck disable=SC2154 # is set by mise
9-
if [[ -z "${usage_tag:-}" ]]; then
10-
PARENT_POM="prometheus-metrics-parent/pom.xml"
11-
usage_tag=$(sed -n 's/.*<version>\(.*-SNAPSHOT\)<\/version>.*/\1/p' "$PARENT_POM" | head -1)
12-
if [[ -z "$usage_tag" ]]; then
13-
echo "ERROR: could not find SNAPSHOT version in $PARENT_POM" >&2
14-
exit 1
15-
fi
8+
PARENT_POM="prometheus-metrics-parent/pom.xml"
9+
CURRENT_VERSION=$(sed -n 's/.*<version>\(.*-SNAPSHOT\)<\/version>.*/\1/p' "$PARENT_POM" | head -1)
10+
11+
if [[ -z "$CURRENT_VERSION" ]]; then
12+
echo "ERROR: could not find SNAPSHOT version in $PARENT_POM" >&2
13+
exit 1
1614
fi
1715

18-
VERSION=${usage_tag#v}
16+
# shellcheck disable=SC2154 # is set by mise
17+
VERSION=${usage_tag:-$CURRENT_VERSION}
18+
VERSION=${VERSION#v}
1919

20-
mise run set-version "$VERSION"
20+
find . -name 'pom.xml' -exec \
21+
sed -i "s/<version>${CURRENT_VERSION}<\/version>/<version>${VERSION}<\/version>/g" {} +
2122
mvn -B package -P 'release,!default,!examples-and-integration-tests' -Dmaven.test.skip=true -Dgpg.skip=true

0 commit comments

Comments
 (0)