Skip to content

Publish to Central Portal #2539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NEXUS_USER
# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java
# CENTRAL_PORTAL_USER
# CENTRAL_PORTAL_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java
# byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8);
# String encoded = new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8);
# System.out.println(encoded);
Expand Down Expand Up @@ -32,8 +32,8 @@ jobs:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
ORG_GRADLE_PROJECT_nexus_pass64: ${{ secrets.NEXUS_PASS64 }}
ORG_GRADLE_PROJECT_central_portal_user: ${{ secrets.CENTRAL_PORTAL_USER }}
ORG_GRADLE_PROJECT_central_portal_pass64: ${{ secrets.CENTRAL_PORTAL_PASS64 }}
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
Comment on lines -35 to +36
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worthwhile to add new secrets and remove the old ones to clearly distinguish between them.

e.g. GradleUp/shadow#1414.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are correct that this is the good thing to do. But because DiffPlug has a central repository where all the rest of our builds pull from

it saves me a bit of time to keep the old names. Just FYI, I reverted to the old cred names (with updated values) in the commit referenced at the bottom of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either.

ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }}
steps:
Expand Down
10 changes: 5 additions & 5 deletions gradle/java-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def decode64(String varName) {

if (project.parent == null) {
group = 'com.diffplug.spotless'
def pass = System.env['ORG_GRADLE_PROJECT_nexus_pass64']
def pass = System.env['ORG_GRADLE_PROJECT_central_portal_pass64']
if (pass != null) {
pass = pass.decodeBase64()
}
Expand All @@ -20,10 +20,10 @@ if (project.parent == null) {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.env['ORG_GRADLE_PROJECT_nexus_user']
password = decode64('ORG_GRADLE_PROJECT_nexus_pass64')
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username = System.env['ORG_GRADLE_PROJECT_central_portal_user']
password = decode64('ORG_GRADLE_PROJECT_central_portal_pass64')
}
}
}
Expand Down
Loading