Every Java module that applies buildlogic.publish-conventions is published to Maven Central
(Central Portal) under com.codeheadsystems, in one deployment, at one shared version. Today that
is:
config-bomconfig-modelconfig-datastoreconfig-datastore-sqlconfig-datastore-dynamodbconfig-datastore-s3config-datastore-testkitconfig-libraryconfig-client(its generated HTTP layer is compiled into its jar and sources jar)
./gradlew verifyPublishConfig lists them. A module joins by applying the plugin and adding a
constraint to config-bom. config-server, config-integ, config-test-oidc and the
config-datastore-etcd placeholder are never published. The Rust crates are not published either.
The workflows below only run when a tag is pushed or a release is started by hand. Each release needs an entry in CHANGELOG.md; see "Before releasing".
gradle.propertiesholds the next version as a SNAPSHOT (0.1.0-SNAPSHOT).- A
vX.Y.ZorvX.Y.Z-suffixtag onHEADoverrides it (settings.gradle.kts), so a tagged build isX.Y.Z. Without a tag, builds stay SNAPSHOT and are never signed.
- Sign in at https://central.sonatype.com. The
com.codeheadsystemsnamespace is already verified (hofmann-elimination publishes under it), so the same account works. - Account page, Generate User Token. Save the token's username and password. They are not your login credentials.
The hofmann-elimination key can be reused. To make a new one:
gpg --gen-key # RSA, 4096 bits
gpg --list-secret-keys --keyid-format=long # sec rsa4096/ABCD1234EFGH5678
gpg --export-secret-keys ABCD1234EFGH5678 | base64 -w 0 > private-key.txt
gpg --keyserver keyserver.ubuntu.com --send-keys ABCD1234EFGH5678
gpg --keyserver keys.openpgp.org --send-keys ABCD1234EFGH5678These are organization secrets of codeheadsystems, shared with its other publishing repos
and already set (https://github.com/organizations/codeheadsystems/settings/secrets/actions). A
repository secret of the same name would override one. gh secret list shows only repository
secrets, so it lists none here; gh api repos/codeheadsystems/config/actions/organization-secrets
lists the ones this repo can use.
| Secret | Value |
|---|---|
CENTRAL_PORTAL_USERNAME |
User token username |
CENTRAL_PORTAL_PASSWORD |
User token password |
GPG_PRIVATE_KEY |
Contents of private-key.txt (base64) |
GPG_PASSPHRASE |
The key's passphrase |
GPG_KEY_ID |
The key ID, such as EFGH5678 |
Delete private-key.txt once it is uploaded.
- In CHANGELOG.md, rename
## [Unreleased]to## [X.Y.Z] - YYYY-MM-DD(the release day), add a new empty## [Unreleased]above it, and update the compare links at the bottom. A pre-release such asX.Y.Z-rc.1uses theX.Y.Zentry unless it has its own. - Check the entry the release notes will use:
.github/scripts/changelog-section.sh X.Y.Z. - Commit that to
main.
Both release paths refuse a version without an entry: manual release before it tags, and
publish.yml before it builds.
Releases are published only from commits on main; publish.yml refuses anything else.
git checkout main && git pull
./gradlew clean build
git tag -a v0.1.0 -m "Release 0.1.0" # or v0.1.0-rc.1 for a pre-release
git push origin v0.1.0release.yml runs on the tag.
Run manual release. It tags the head of main with the next patch version (the latest
vX.Y.Z plus one; for the first release, gradle.properties' version without -SNAPSHOT), then
publishes it.
Both paths run .github/workflows/publish.yml:
- Checks the tag format, that
CHANGELOG.mdhas an entry for the version, and that the tagged commit is onmain. - Checks that Gradle's version equals the tag's.
./gradlew clean build: all tests, including the backend and end-to-end tests in Docker and the Rust client scenarios (cargo comes preinstalled on GitHub's Ubuntu runners).CIis set there, so a missing Docker or cargo fails the release instead of skipping tests.- Imports the GPG key and runs
./gradlew publishAggregationToCentralPortal, which signs and uploads every module as one deployment. - Removes the signing material from the runner.
- Creates the GitHub release: the changelog entry, then how to depend on it, the module list and jars, then GitHub's generated list of merged pull requests. A tag with a suffix is marked as a pre-release.
Artifacts reach Maven Central in 15 to 120 minutes. Check https://repo1.maven.org/maven2/com/codeheadsystems/config-bom/ and the Deployments page at https://central.sonatype.com.
After a release, raise version in gradle.properties to the next SNAPSHOT, and record changes
under ## [Unreleased] in CHANGELOG.md as they land.
Nothing here uploads.
./gradlew verifyPublishConfig # coordinates of every published module
./gradlew -Pversion=0.1.0 nmcpZipAggregation # the exact bundle a release uploads
unzip -l build/nmcp/zip/aggregation.zip
./gradlew -Pversion=0.1.0 nmcpCheckAggregationFilesThe bundle is signed if ~/.gradle/gradle.properties has signing.gnupg.keyName (and
signing.gnupg.passphrase); otherwise the .asc files are missing, which is fine for checking
everything else.
To try the tag-to-version logic:
git tag v0.0.0-test && ./gradlew properties -q | grep '^version:' # version: 0.0.0-test
git tag -d v0.0.0-test- "CHANGELOG.md has no entry for X.Y.Z": add the section (see "Before releasing") and commit
it. With a pushed tag, delete the tag (
git push --delete origin vX.Y.Z) and tag the new commit. Manual release tags the latestvX.Y.Zplus one patch, so its entry must be for that version. - "Gradle version does not match the tag": the tag is not on the checked-out commit, or is not
vX.Y.Z[-suffix]. Checkgit describe --tags --exact-match HEAD. - "is not on main": the tag points at a commit that has not landed on
main. Delete the tag (git push --delete origin vX.Y.Z) and tag a commit onmain. - GPG errors ("No secret key", "Inappropriate ioctl"): check
GPG_PRIVATE_KEYis base64,GPG_KEY_IDmatches it, and the public key is on the keyservers. - 401 from the Central Portal: the secrets must be the user token, not the login. Regenerate it on the Account page.
- Deployment fails validation: see its errors under Deployments at https://central.sonatype.com, fix, delete the tag, and release again.
A published version cannot be removed from Maven Central. Fix a bad release with a new patch version.