Skip to content

Commit

Permalink
Detect project version for rel drafter
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jan 28, 2025
1 parent 2c3ebd8 commit a8d2ae3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,27 @@ jobs:
with:
persist-credentials: 'false'

- id: has-pom
run: |
if [ -f pom.xml ]; then
echo "status=true" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT
- uses: actions/setup-java@v4
if: steps.has-pom.outputs.status == 'true'
with:
java-version: '21'
distribution: 'zulu'
cache: 'maven'

- id: version
if: steps.has-pom.outputs.status == 'true'
run: |
if [ -f pom.xml ]; then
mvn --batch-mode --non-recursive help:evaluate -Dexpression=project.version -Doutput=target/version.txt
V=$(cat target/version.txt)
echo "version=${V%-SNAPSHOT}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
fi
mvn --batch-mode --non-recursive help:evaluate -Dexpression=project.version -Doutput=target/version.txt
V=$(cat target/version.txt)
echo "version=${V%-SNAPSHOT}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
update_release_draft:
name: Update Release Draft
Expand Down

0 comments on commit a8d2ae3

Please sign in to comment.