64
64
env :
65
65
GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
66
66
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]+")
68
78
69
79
- name : Publish to Git Releases and Tags
70
80
if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
@@ -74,18 +84,24 @@ jobs:
74
84
run : npx semantic-release # --dry-run --branches 9662_addcheck
75
85
76
86
- name : Publish to Maven Central
77
- if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
87
+ if : " startsWith(github.ref, 'refs/tags/v') "
78
88
env :
79
- GHA_TAG : ${{ github.ref }} # non PR only need to get last part
89
+ GHA_TAG : ${{ github.ref }} # for setMavenVersion_gha
80
90
OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }} # for .travis.settings.xml
81
91
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
82
95
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"
84
99
build/setMavenVersion_gha.sh
100
+ echo -e "\n\033[0;35mCommand: mvn deploy"
85
101
mvn deploy --settings build/.travis.settings.xml -DskipITs -Dskip.unit.tests -P central $MVN_ARGS
86
102
87
103
- name : Publish Java docs
88
- if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
104
+ if : " startsWith(github.ref, 'refs/tags/v') "
89
105
env :
90
106
GH_TOKEN : ${{ secrets.GH_TOKEN }}
91
107
GHA_REPO_SLUG : ${{ github.repository }}
@@ -104,3 +120,4 @@ jobs:
104
120
if : ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '0' }}
105
121
run : |
106
122
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