1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 13:05:09 +00:00

chore: print pom_version

This commit is contained in:
Arnaud Roques 2023-05-12 20:19:00 +02:00
parent 871c298203
commit 11b9baa3ff

View File

@ -59,12 +59,14 @@ jobs:
]]; then ]]; then
echo "::notice title=::This run will release '${REF}'" echo "::notice title=::This run will release '${REF}'"
echo "do_release=true" >> $GITHUB_OUTPUT echo "do_release=true" >> $GITHUB_OUTPUT
echo "pom_version=${REF#v}"
echo "pom_version=${REF#v}" >> $GITHUB_OUTPUT # pom_version is the tag without the 'v' prefix echo "pom_version=${REF#v}" >> $GITHUB_OUTPUT # pom_version is the tag without the 'v' prefix
elif [[ "${GITHUB_EVENT_NAME}" =~ push|workflow_dispatch && "${REF}" == "refs/heads/master" && "${ACTOR}" == "arnaudroques" ]]; then elif [[ "${GITHUB_EVENT_NAME}" =~ push|workflow_dispatch && "${REF}" == "refs/heads/master" && "${ACTOR}" == "arnaudroques" ]]; then
echo "::notice title=::This run will release a snapshot" echo "::notice title=::This run will release a snapshot"
echo "do_snapshot_release=true" >> $GITHUB_OUTPUT echo "do_snapshot_release=true" >> $GITHUB_OUTPUT
V=$(perl -ne 'if (/return (\d{6,7});/) {$v=$1} if (/final int beta = (\d+);/) {$b=$1} END{print(substr($v, 0, 1),".", substr($v, 1, 4),"."); if ($b) {print(int(substr($v+1, 5)), "beta", $b);} else {print(int(substr($v, 5)))}}' src/net/sourceforge/plantuml/version/Version.java) V=$(perl -ne 'if (/return (\d{6,7});/) {$v=$1} if (/final int beta = (\d+);/) {$b=$1} END{print(substr($v, 0, 1),".", substr($v, 1, 4),"."); if ($b) {print(int(substr($v+1, 5)), "beta", $b);} else {print(int(substr($v, 5)))}}' src/net/sourceforge/plantuml/version/Version.java)
echo "pom_version=$V-SNAPSHOT"
echo "pom_version=$V-SNAPSHOT" >> $GITHUB_OUTPUT # pom_version is taken from Version.java echo "pom_version=$V-SNAPSHOT" >> $GITHUB_OUTPUT # pom_version is taken from Version.java
else else
@ -252,7 +254,9 @@ jobs:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
run: | run: |
echo "RELEASE_VERSION=$RELEASE_VERSION"
.github/scripts/release-snapshot.sh .github/scripts/release-snapshot.sh
gradle --debug publish
- name: Create release in GitHub and OSSRH - name: Create release in GitHub and OSSRH
if: needs.workflow_config.outputs.do_release == 'true' if: needs.workflow_config.outputs.do_release == 'true'
@ -266,6 +270,7 @@ jobs:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
run: | run: |
echo "RELEASE_VERSION=$RELEASE_VERSION"
.github/scripts/release.sh .github/scripts/release.sh
gradle --debug publish gradle --debug publish