26
26
env :
27
27
# BUILD_SNAPSHOT: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
28
28
# (github.ref_name == 'develop' || startsWith(github.ref_name, 'release-')) }}
29
- BUILD_SNAPSHOT : false
29
+ BUILD_SNAPSHOT : true
30
+ DEPLOY_MAVEN_CENTRAL : false
30
31
steps :
31
32
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
32
33
with :
@@ -47,11 +48,10 @@ jobs:
47
48
java-version : 11
48
49
distribution : ' temurin'
49
50
cache : ' maven'
50
- server-id : ossrh # Value of the distributionManagement/repository/id field of the pom.xml
51
51
server-username : MAVEN_USERNAME # env variable for username in deploy
52
52
server-password : MAVEN_CENTRAL_TOKEN # env variable for token in deploy
53
- gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
54
- gpg-passphrase : MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
53
+ # gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
54
+ # gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
55
55
- name : Set up JDK 11 (build only)
56
56
if : ${{ steps.setup-java-deploy.outcome == 'skipped' }}
57
57
uses : actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
@@ -67,17 +67,16 @@ jobs:
67
67
# -------------------------
68
68
# Maven Build
69
69
# -------------------------
70
- - id : build-test-deploy
70
+ - id : build-test-deploy-github
71
71
name : Build, Test and DEPLOY SNAPSHOT Code
72
72
if : ${{ env.BUILD_SNAPSHOT == 'true' }}
73
73
run : |
74
74
mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
75
75
env :
76
- MAVEN_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
77
- MAVEN_CENTRAL_TOKEN : ${{ secrets.SONATYPE_PASSWORD }}
78
- MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
76
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77
+ # MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
79
78
- name : Build and Test Code
80
- if : ${{ steps.build-test-deploy.outcome == 'skipped' }}
79
+ if : ${{ steps.build-test-deploy-github .outcome == 'skipped' }}
81
80
run : |
82
81
mvn -B -e -Prelease -Preporting install
83
82
- name : Perform CodeQL Analysis
89
88
run : |
90
89
# this needs to be run as a second build to ensure source is fully generated by the previous step
91
90
mvn -B -e -Prelease -Preporting install site site:stage
91
+ - id : setup-java-deploy-maven-central
92
+ name : Set up JDK 11 (deploy)
93
+ if : ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }}
94
+ uses : actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
95
+ with :
96
+ java-version : 11
97
+ distribution : ' temurin'
98
+ cache : ' maven'
99
+ server-id : ossrh # Value of the distributionManagement/repository/id field of the pom.xml
100
+ server-username : MAVEN_USERNAME # env variable for username in deploy
101
+ server-password : MAVEN_CENTRAL_TOKEN # env variable for token in deploy
102
+ gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
103
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
104
+ - id : build-test-deploy-maven-central
105
+ name : Build, Test and DEPLOY SNAPSHOT Code
106
+ if : ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }}
107
+ run : |
108
+ mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
109
+ env :
110
+ MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
111
+ MAVEN_CENTRAL_TOKEN : ${{ secrets.OSSRH_TOKEN }}
112
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
0 commit comments