Skip to content

[RUN-4638] Migrate publishing from Maven Central to PackageCloud#128

Open
Jesus-Osuna-M wants to merge 2 commits into
mainfrom
RUN-4638-publish-to-packagecloud
Open

[RUN-4638] Migrate publishing from Maven Central to PackageCloud#128
Jesus-Osuna-M wants to merge 2 commits into
mainfrom
RUN-4638-publish-to-packagecloud

Conversation

@Jesus-Osuna-M

Copy link
Copy Markdown
Contributor

Jira ticket

RUN-4638 (subtask of RUN-4570)

Description

Migrate py-winrm-plugin publishing from Maven Central (Sonatype) to PackageCloud, applying the same design already validated on rundeck-plugins/sshj-plugin#136, rundeck-plugins/http-step#60, and rundeck-plugins/ansible-plugin#456. Part of the RUN-4570 Maven Central publishing limits resolution — plugins account for the bulk of the file/release count on Maven Central, but no external project depends on them as Maven dependencies.

  • Removed nexusPublish/nexusPublishing (Sonatype-specific, dead once release.yml stops calling publishToSonatype).
  • Point the existing PackageCloud maven repo at the configurable PKGCLD_REPO_URL env var (trimmed, and guarded so plain builds/CI without the var don't fail at Gradle configuration time), replacing the hardcoded rundeckpro-test URL left over from an earlier test.
  • Dropped GPG signing: PackageCloud's Maven endpoint rejects the checksum Gradle auto-generates for .asc signature files (422 Unprocessable Entity on *.jar.asc.sha1), and neither the OSS rundeck WAR nor rundeckpro-enterprise WAR carry .asc signatures on PackageCloud either — only RPM/DEB packages are signed there, natively, via the separately-published BUILD-GPG-KEY.
  • release.yml: replaced the "Publish to Maven Central" step with "Publish to PackageCloud".

Testing instructions

  • Merge this PR.
  • Tag a test version to trigger the release workflow (this exact flow — build, sign-free publish, checksums — was validated end-to-end on sshj-plugin 1.0.4: jar/pom/sources/javadoc all publish successfully to PackageCloud). Note this repo publishes a zip renamed to .jar (mavenZip publication) — the same flow applies.
  • Verify the artifact appears under org/rundeck/plugins/py-winrm-plugin/<version>/ at whatever repo PKGCLD_REPO_URL points to.
  • Verify ./gradlew build still succeeds without PKGCLD_REPO_URL set (e.g. in gradle.yml CI) — the PackageCloud repo registration is guarded and should not affect plain builds.

Part of RUN-4570: Maven Central publishing limits resolution, applying
the same design validated on rundeck-plugins/sshj-plugin (PR #136),
rundeck-plugins/http-step (PR #60), and rundeck-plugins/ansible-plugin
(PR #456).

- Remove nexusPublish plugin/nexusPublishing block (Sonatype-specific,
  dead once release.yml stops calling publishToSonatype).
- Point the PackageCloud maven repo at the configurable PKGCLD_REPO_URL
  (trimmed, guarded so plain builds/CI without the var don't fail at
  configuration time) instead of the hardcoded rundeckpro-test URL left
  over from an earlier manual test.
- Drop GPG signing: PackageCloud's Maven endpoint rejects the checksum
  Gradle auto-generates for .asc signature files (422 Unprocessable
  Entity), and neither the OSS rundeck WAR nor rundeckpro-enterprise
  carry .asc signatures on PackageCloud either - only RPM/DEB packages
  are signed there natively.
- release.yml: replace the Sonatype publish step with PackageCloud.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates py-winrm-plugin release publishing from Sonatype/Maven Central to PackageCloud, aligning with the org’s newer publishing approach and removing Sonatype-specific build/release configuration.

Changes:

  • Removed the Gradle Nexus Publish (Sonatype) plugin/configuration from build.gradle.
  • Updated Gradle publishing configuration to target a PackageCloud Maven repo via PKGCLD_REPO_URL and header auth.
  • Updated the GitHub release workflow to publish artifacts to PackageCloud instead of Maven Central.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
gradle/publishing.gradle Removes signing and switches publishing repository configuration to a configurable PackageCloud URL + header auth.
build.gradle Drops Sonatype/Nexus publishing plugin and nexusPublishing {} configuration.
.github/workflows/release.yml Replaces the Maven Central publish step with a PackageCloud publish step and wires in PKGCLD_REPO_URL/token env.

Comment on lines +38 to +41
- name: Publish to PackageCloud
run: ./gradlew publishAllPublicationsToPackageCloudRepository
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_B64: ${{ secrets.SIGNING_KEY_B64 }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
PKGCLD_WRITE_TOKEN: ${{ secrets.PKGCLD_WRITE_TOKEN }}
Comment thread gradle/publishing.gradle
Comment on lines 62 to 65
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "Bearer " + pkgcldWriteToken
value = "Bearer " + (System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken"))
}
Addresses GitHub Copilot review feedback on the PackageCloud migration
PRs: without this, a missing PKGCLD_REPO_URL makes the publish task
not exist at all (confusing "task not found"), and a missing
PKGCLD_WRITE_TOKEN with the URL present produces a "Bearer null"
Authorization header that PackageCloud rejects with a non-obvious
401/422. Validate both upfront in the one step that actually needs
them, instead of leaving the Gradle-side guard (which exists to keep
unrelated CI like gradle.yml working without these vars) to surface
the failure indirectly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants