Skip to content

Commit 4da6cce

Browse files
authored
Fix version replace (#174)
* Add debugging message * Fix replacement command * Try mvn version set command
1 parent 0ecc529 commit 4da6cce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/shared-publish-java-to-docker-versioned.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ jobs:
115115
pushd ${{ inputs.working_dir }}
116116
current_version=$(grep -o '<version>.*</version>' pom.xml | head -1 | sed 's/<version>\(.*\)<\/version>/\1/')
117117
new_version=${{ steps.version.outputs.new_version }}
118-
sed -i "0,/$current_version/s/$current_version/$new_version/" pom.xml
118+
mvn versions:set versions:commit -DnewVersion="$new_version"
119119
echo "Version number updated from $current_version to $new_version"
120120
echo "image_tag=${{ steps.version.outputs.new_version }}" >> $GITHUB_OUTPUT
121121
popd
122122
123123
- name: Package JAR
124124
id: package
125125
run: |
126+
cat pom.xml
126127
pushd ${{ inputs.working_dir }}
127128
if [[ "${{ inputs.skip_tests }}" == "false" ]]; then
128129
mvn -B package -P default

0 commit comments

Comments
 (0)