Skip to content

Commit 6a2c1cb

Browse files
committed
ci: fix
1 parent aa5d39c commit 6a2c1cb

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ jobs:
6161
- name: Publish to Maven Central
6262
env:
6363
# TRAVIS_TAG: ${{ github.event.release.tag_name }} # for setMavenVersion
64-
TRAVIS_TAG: ${GITHUB_REF##*/} # for setMavenVersion
64+
GHA_TAG: ${{ github.ref }} # non PR only need to get last part
6565
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} # for .travis.settings.xml
6666
OSSRH_PASSWORD: ${{ secrets.OSSRH_USERNAME }}
6767
run: |
6868
build/setupSigning.sh
69-
build/setMavenVersion.sh
69+
build/setMavenVersion_gha.sh
7070
mvn deploy --settings build/.travis.settings.xml -DskipITs -Dskip.unit.tests -P central $MVN_ARGS
7171
7272
- name: Publish Java docs
@@ -79,9 +79,8 @@ jobs:
7979
GHA_BUILD_NUMBER: ${{ github.run_number }}
8080
GHA_JOB_NUMBER: ${{ github.job_number }}
8181
GHA_COMMIT: ${{ github.sha }}
82-
GHA_TAG: ${{ github.event.release.tag_name }}
83-
TRAVIS_TAG: ${{ github.event.release.tag_name }} # for setMavenVersion
82+
GHA_TAG: ${{ github.ref }} # for setMavenVersion_gha
8483
run: |
85-
build/setMavenVersion.sh
84+
build/setMavenVersion_gha.sh
8685
mvn clean javadoc:aggregate $MVN_ARGS
8786
build/publish_gha.sh

build/setMavenVersion.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# This script will check $TRAVIS_TAG to see if we need to run maven to
44
# set the artifact version #'s.
5-
printf "\n>>>>> WWW Setting artifact version #'s to: %s\n" ${TRAVIS_TAG:1}
65

76
if [[ -n "${TRAVIS_TAG}" ]]; then
87
printf "\n>>>>> Setting artifact version #'s to: %s\n" ${TRAVIS_TAG:1}

build/setMavenVersion_gha.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# This script will check $GHA_TAG to see if we need to run maven to
4+
# set the artifact version #'s.
5+
export GHA_TAG=${GHA_TAG##*/} # Get the last part for true tag name - "refs/heads/9260_gha"
6+
7+
if [[ -n "${GHA_TAG}" ]]; then
8+
printf "\n>>>>> Setting artifact version #'s to: %s\n" ${GHA_TAG:1}
9+
mvn versions:set -DnewVersion=${GHA_TAG:1} -DgenerateBackupPoms=false
10+
else
11+
printf "\n>>>>> Bypassing artifact version setting for non-tagged build %s\n" ${GHA_TAG:1}
12+
fi
13+

0 commit comments

Comments
 (0)