Repository navigation
ci: publish to Maven Central from version tags - #2
Merged
Merged
Conversation
Sets project.build.outputTimestamp and javadoc's notimestamp, so building the same commit twice produces identical jars.
The publish workflow signs and uploads releases, so mvn install no longer needs -Dgpg.skip.
There was a problem hiding this comment.
🔵 Needs a closer look
Release safety depends on external reviewer requirements, v* tag restrictions, and signing-key/Central credential configuration that a maintainer must verify outside the repository snapshot.
No open issues 🎉
What changed in this PR
Moves Maven Central publishing from Maven plugins to a version-tag-triggered GitHub Actions workflow, separating build and dependency execution from release credentials.
Changes:
- Validates release metadata, tests on Java 11 and 25, and prepares artifacts with dependency and secret scans.
- Adds gated signing, checksum verification, Maven Central publishing, and GitHub Release creation.
- Configures reproducible build timestamps and simplifies local build instructions.
| File | Description |
|---|---|
| README.md | Removes the signing-skip flag from local build instructions. |
| pom.xml | Adds reproducibility settings and removes signing and publishing plugins. |
| .github/workflows/publish.yml | Adds tag-driven validation, testing, scanning, signing, publishing, and release creation. |
Review effort: Balanced
Samy-O7
approved these changes
Nov 5, 2026
Samy-O7
left a comment
There was a problem hiding this comment.
Checked before approving by running the workflow's build steps locally (Temurin 25.0.5 and 11.0.32.1, Maven 3.9.15) and the publish job's Sign, verify and Bundle steps with a throwaway key:
- The check step passes for a
v1.0.0tag onceCHANGELOG.mdhas a dated## 1.0.0heading (com.spreedly:composer-sdk-server, 39-line notes). It fails for a wrong tag, the current(unreleased)heading, a commit that isn't on main and a mismatchedSDK_VERSION. - Tests pass on Java 11 and 25, and the package step builds the jar (Java 11 bytecode, with
LICENSE,NOTICEandTHIRD-PARTY-LICENSES), the sources and javadoc jars and the POM. A second build from another directory produced byte-identical files. - The SBOM is valid CycloneDX 1.6 with the 11 runtime dependencies. OSV-Scanner 2.7.0 reads all 11 and reports nothing, and it fails with GHSA-4jrv-ppp4-jm57 when gson is swapped for 2.8.8. gitleaks finds nothing in the unzipped jars and POM. Both pinned downloads match the official checksums.
- With a key that also has a signing subkey, the Sign step signs all four files with the primary key, the verify step accepts them, and the bundle has the repository layout with
.asc,.md5and.sha1files. A lowercase fingerprint, a wrong passphrase and a jar changed after signing each stop the job. - Only the publish job's Sign and Publish steps read the signing key and the token, and no Maven code runs in that job. The encoded token is masked and sent from a header file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
publish.yml: on av*tag, checks the tag matches thepom.xmlversion andSDK_VERSIONinConstants.java, the commit is onmain, andCHANGELOG.mdhas a released section for the versioncontents: read): runs the tests on Java 11 and 25, packages the jar, sources jar, javadoc jar and POM, writes a CycloneDX SBOM, audits runtime dependencies with OSV-Scanner, writes SHA-256 checksums and scans the package with gitleaksreleaseenvironment): verifies the checksums, fails if the version is already on Maven Central, signs with gpg, checks the signatures against the key on keyserver.ubuntu.com, and uploads with the Central Publisher API; no Maven or plugin code runs in this jobSHA256SUMSand the SBOMpom.xml: fixed build timestamps so release jars are reproducible; removesmaven-gpg-pluginandcentral-publishing-maven-plugin, which the workflow replacesmvn clean installno longer needs-Dgpg.skip