6464 env :
6565 GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
6666 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
67- run : echo ::set-output name=IS_NEW_RELEASE::$(npx semantic-release --dry-run | grep -c -i "Published release")
67+ run : |
68+ echo ::set-output name=IS_NEW_RELEASE::$(npx semantic-release --dry-run | grep -c -i "Published release")
69+ echo "The full TAG - ${{ github.ref }}"
70+
71+ - name : Get the nextRelease.version from semantic release
72+ if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
73+ id : next_release
74+ env :
75+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
76+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
77+ run : echo ::set-output name=NEXT_RELEASE::$(npx semantic-release --dry-run | grep -oP "Published release \K[0-9]+\.[0-9]+\.[0-9]+")
6878
6979 - name : Publish to Git Releases and Tags
7080 if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
@@ -74,18 +84,24 @@ jobs:
7484 run : npx semantic-release # --dry-run --branches 9662_addcheck
7585
7686 - name : Publish to Maven Central
77- if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
87+ if : " startsWith(github.ref, 'refs/tags/v') "
7888 env :
79- GHA_TAG : ${{ github.ref }} # non PR only need to get last part
89+ GHA_TAG : ${{ github.ref }} # for setMavenVersion_gha
8090 OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }} # for .travis.settings.xml
8191 OSSRH_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
92+ GPG_KEYNAME : ${{ secrets.SIGNING_KEY }}
93+ GPG_PASSPHRASE : ${{ secrets.SIGNING_PASSWORD }}
94+ SIGNING_PASSPHRASE : ${{ secrets.SIGNING_PASSPHRASE }} # for setupSigning_gha
8295 run : |
83- build/setupSigning.sh
96+ echo -e "\n\033[0;35mCommand: setupSigning"
97+ build/setupSigning_gha.sh
98+ echo -e "\n\033[0;35mCommand: setMavenVersion"
8499 build/setMavenVersion_gha.sh
100+ echo -e "\n\033[0;35mCommand: mvn deploy"
85101 mvn deploy --settings build/.travis.settings.xml -DskipITs -Dskip.unit.tests -P central $MVN_ARGS
86102
87103 - name : Publish Java docs
88- if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
104+ if : " startsWith(github.ref, 'refs/tags/v') "
89105 env :
90106 GH_TOKEN : ${{ secrets.GH_TOKEN }}
91107 GHA_REPO_SLUG : ${{ github.repository }}
@@ -104,3 +120,4 @@ jobs:
104120 if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '0' }}
105121 run : |
106122 echo -e "\n\033[0;35mCommand: Skipping the deployment because semantic release has determined there are no relevant changes that warrent a new release.\n"
123+ echo "The NEXT_RELEASE - ${{ steps.next_release.outputs.NEXT_RELEASE }}"
0 commit comments