Skip to content

Commit 6782c65

Browse files
committed
fix: remove version manipulation from build-release.sh
Release-please already sets the correct versions in pom.xml files at the tagged commit, so the sed-based SNAPSHOT replacement in build-release.sh is redundant and would fail (no SNAPSHOT to find). Remove the TAG argument/env and version manipulation logic, keeping only the Maven package command. Update release and test-release-build workflows to stop passing the TAG env var. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 1b8f56d commit 6782c65

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ jobs:
3030

3131
- name: Build release version
3232
run: mise run build-release
33-
env:
34-
TAG: ${{ github.ref_name }}
3533

3634
- name: Set up Apache Maven Central
3735
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5

.github/workflows/test-release-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,3 @@ jobs:
3232
BASE_URL: "/client_java"
3333
- name: Build release version
3434
run: mise run build-release
35-
env:
36-
# don't use the current snapshot version, to test a more realistic release
37-
TAG: ${{ github.run_number }}

.mise/tasks/build-release.sh

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
#!/usr/bin/env bash
22

33
#MISE description="Build release package"
4-
#USAGE arg "[tag]" env="TAG"
54

65
set -euo pipefail
76

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
14-
fi
15-
16-
# shellcheck disable=SC2154 # is set by mise
17-
VERSION=${usage_tag:-$CURRENT_VERSION}
18-
VERSION=${VERSION#v}
19-
20-
find . -name 'pom.xml' -exec \
21-
sed -i "s/<version>${CURRENT_VERSION}<\/version>/<version>${VERSION}<\/version>/g" {} +
22-
mvn -B package -P 'release,!default,!examples-and-integration-tests' -Dmaven.test.skip=true -Dgpg.skip=true
7+
mvn -B package -P 'release,!default,!examples-and-integration-tests' \
8+
-Dmaven.test.skip=true -Dgpg.skip=true

0 commit comments

Comments
 (0)