Repository navigation
Conversation
4a24a12 to
f8ab9b0
Compare
f8ab9b0 to
7eb2b27
Compare
…om a GitHub release OSSRH (oss.sonatype.org), which uploadArchives published to, was shut down in June 2025. The signed artifacts are now built with maven-publish into a bundle that upload-to-central.sh uploads to the Central Portal API, waiting until it is published. Publishing a GitHub release whose tag is the version runs it in the maven-central environment, which holds the Portal token and signing key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7eb2b27 to
ad850c5
Compare
augustak
left a comment
There was a problem hiding this comment.
Looks good overall. One change I'd make before merging (polling retries, inline), plus two README additions about how releases interact with the tag-based version check from #39.
What I checked
- Built the bundle on JDK 8 with a throwaway GPG key (
make bundle). It has 51 files: the jar, sources, javadoc, POM and module, each with a.ascsignature and md5/sha1/sha256/sha512 checksums, all underai/lucidtech/las-sdk-java/4.0.1/.maven-metadata.xmlis correctly left out of the zip. - Compared the generated POM with the published 4.0.0 POM. The only differences are the dependency versions from #36, the
commons-iogroupId fix, the test dependencies that are no longer listed, and the Gradle-metadata marker comment. The dependency scopes are stillruntime, as in 4.0.0. - There is no settings.gradle, so
project.nameis the checkout directory's name. SettingartifactId = archivesBaseNameexplicitly is what keeps the POM and module coordinateslas-sdk-javawhen the checkout directory has another name (mine did). Good. - The upload and status endpoints, the bearer-token format and the
deploymentStatevalues match the Central Portal API docs.
The description is out of date
- "the 'Check that version is updated' check fails on purpose": since #38/#39 it passes. build.gradle changes, but no
v4.0.1tag exists yet. - "the removed
mavenplugin": Gradle 6.3 still has it (deprecated). It was removed in 7.0. Replacing it is still right, since OSSRH is gone.
FYI, not for this PR
- The repo has no tags at all, including none for 4.0.0 and earlier. So until the first release made through this workflow, the #39 check treats every version as unreleased. Pushing
v4.0.0on the commit that was released would make the check trustworthy right away. - The public API returns and takes
JSONObject(and theHttpClienttypes), but the dependencies are published withruntimescope, exactly as in 4.0.0. Maven users have to declare org.json themselves. Switching tojava-librarywithapidependencies would fix that. It's an existing problem, so it belongs in a separate change.
augustak
left a comment
There was a problem hiding this comment.
Both PR checks passed. I built the 4.0.1 bundle offline on Java 8 and verified all five signatures, the checksums, and the Java 8 bytecode. I reproduced the polling failure with a stubbed Portal response. Live Portal acceptance remains unverified.
… master - upload-to-central.sh keeps polling the accepted deployment until the deadline when a status check fails, as the Portal goes on publishing it and rejects uploading the same version again. The token is passed to curl through a file descriptor instead of its command line, and a failed upload prints the Portal's error. - The Publish workflow refuses a release tag on a commit that isn't on master. - The README says how to recover from a failed release, and to tag a release published from a local machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Follow-up to the review summary: Out-of-date description: fixed. It now says the version check passes, since #38/#39 and 4.0.1 has no tag yet, and that the Missing tags for 4.0.0 and earlier: agreed. Pushing
|
make publishuploaded to OSSRH (oss.sonatype.org), which Sonatype shut down in June 2025, so no new version can be released until publishing goes through the Central Portal. This PR moves publishing there and runs it from GitHub Actions, so a release no longer depends on one person's machine and credentials.How a release works
versionin gradle.properties.v<version>, such asv4.0.1.master. It then builds and signs the jar, sources, javadoc and POM into a bundle (make bundle), uploads it to the Central Portal API, and waits until Maven Central reports it as published (upload-to-central.sh).make publishruns the same steps from a local machine, given the same secrets as environment variables. Afterwards, push thev<version>tag by hand.If a release fails, the README says how to recover: check the Portal first, then delete the release and its tag, merge the fix, and publish again.
Why not trusted publishing
Maven Central has no OIDC trusted publishing like PyPI's or npm's. The Central Portal's only credential is a user token. Instead, the token and signing key are stored only in a
maven-centralGitHub environment, the publish job is the only one that uses that environment, and it has read-only repository permissions. Adding required reviewers on the environment would also make every release wait for approval.Changes
build.gradle: themavenplugin (deprecated in Gradle 6, removed in 7) anduploadArchivesare replaced withmaven-publish, which writes the signed artifacts tobuild/staging-deploy. The signing key can be passed in memory (ORG_GRADLE_PROJECT_signingKey/signingPassword), and the oldsigning.*properties in~/.gradle/gradle.propertiesstill work. The POM matches 4.0.0, except that test dependencies are no longer listed and it now points to the Gradle module metadata.upload-to-central.sh: uploads once withpublishingType=AUTOMATIC, then polls the deployment status until it isPUBLISHED(exit 0) orFAILED(exit 1, printing the Portal's errors), giving up after an hour. A failed status check (a timeout, a 5xx, or a body that isn't JSON) is retried until that deadline, since the Portal goes on with the deployment anyway and would reject a second upload of the same version. The token reaches curl through a file descriptor, so it never appears in the process list..github/workflows/publish.yml,Makefileand the README's publishing section.The release job doesn't run the tests, since they need the mock API in Docker and already run in CI on every PR.
Setup needed before the first release
ai.lucidtechon OSSRH and check that the namespace is listed. OSSRH accounts were migrated to the Portal.maven-centralenvironment in this repo's settings, ideally with required reviewers and limited to tags matchingv*. Add the secretsCENTRAL_USERNAMEandCENTRAL_PASSWORD(the token), plusSIGNING_KEY(ASCII-armored private key) andSIGNING_PASSWORD. 4.0.0 was signed with keyE614123FE64036D2, which is still on keyserver.ubuntu.com and keys.openpgp.org, so it can be reused if anyone still has the private key. Otherwise, generate a new key and upload its public key to a keyserver.Testing
make bundlebuilt the 4.0.1 bundle containing the jar, sources, javadoc, POM and module. Each has a.ascsignature that verifies, plus md5/sha1/sha256/sha512 checksums that match. The jar is still Java 8 bytecode.upload-to-central.shagainst a stubbedcurland checked:FAILEDexits 1 with the Portal's errors.masterand refuses one on a branch.Relation to other PRs and checks
v4.0.1GitHub release releases it.build.gradle, but 4.0.1 has no release tag yet.🤖 Generated with Claude Code