File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 29
29
env :
30
30
gh_token : ${{ secrets.GH_TOKEN }}
31
31
ORG_GRADLE_PROJECT_nexus_user : ${{ secrets.NEXUS_USER }}
32
- ORG_GRADLE_PROJECT_nexus_pass : ${{ secrets.NEXUS_PASS }}
32
+ ORG_GRADLE_PROJECT_nexus_pass64 : ${{ secrets.NEXUS_PASS64 }}
33
33
ORG_GRADLE_PROJECT_gpg_passphrase : ${{ secrets.GPG_PASSPHRASE }}
34
34
ORG_GRADLE_PROJECT_gpg_key64 : ${{ secrets.GPG_KEY64 }}
35
35
steps :
Original file line number Diff line number Diff line change
1
+ import java.nio.charset.StandardCharsets
2
+
3
+ def decode64 (String varNam ) {
4
+ String envValue = System . env[' ORG_GRADLE_PROJECT_nexus_user' ]
5
+ if (envValue == null ) {
6
+ return " "
7
+ } else {
8
+ return new String (envValue. decodeBase64(), " UTF-8" )
9
+ }
10
+ }
1
11
2
12
if (project. parent == null ) {
3
13
group = ' com.diffplug.spotless'
14
+ def pass = System . env[' ORG_GRADLE_PROJECT_nexus_pass64' ]
15
+ if (pass != null ) {
16
+ pass = pass. decodeBase64()
17
+ }
4
18
// it's the root project
5
19
apply plugin : ' io.github.gradle-nexus.publish-plugin'
6
20
nexusPublishing {
@@ -9,7 +23,7 @@ if (project.parent == null) {
9
23
nexusUrl. set(uri(" https://s01.oss.sonatype.org/service/local/" ))
10
24
snapshotRepositoryUrl. set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
11
25
username = System . env[' ORG_GRADLE_PROJECT_nexus_user' ]
12
- password = System . env[ ' ORG_GRADLE_PROJECT_nexus_pass ' ]
26
+ password = decode64( ' ORG_GRADLE_PROJECT_nexus_pass64 ' )
13
27
}
14
28
}
15
29
}
@@ -158,7 +172,7 @@ model {
158
172
159
173
if (! version. endsWith(' -SNAPSHOT' )) {
160
174
signing {
161
- String gpg_key = new String ( System . env[ ' ORG_GRADLE_PROJECT_gpg_key64' ] . decodeBase64() )
175
+ String gpg_key = decode64( ' ORG_GRADLE_PROJECT_gpg_key64' )
162
176
useInMemoryPgpKeys(gpg_key, System . env[' ORG_GRADLE_PROJECT_gpg_passphrase' ])
163
177
sign(publishing. publications)
164
178
}
You can’t perform that action at this time.
0 commit comments