Repository navigation
ci: publish to Maven Central only when the libraries changed - #612
Merged
Merged
Conversation
Maven Central now limits how much an organization publishes each month, and every release tag published all 14 library modules, also for releases that changed only the apps. The publish job now compares the release with the tag of the last version on Maven Central (read from the api artifact's maven-metadata.xml) and publishes only when a published module changed outside its test source sets, or a root build file changed in a way that can affect the output (comments and the Gradle and Kotlin daemon settings in gradle.properties do not count). It publishes anyway when the version or the tag cannot be found. A skip leaves the job successful, so the release still runs, and the job summary says what it decided and why. Running the workflow on a tag publishes only that tag's libraries, with force-maven-central to publish them even if unchanged; the builds, the Docker image and the GitHub release run for tag pushes alone, so a manual run never moves the latest release or image.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Contributor
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.
Summary
Maven Central now limits how much an organization publishes each month (80 MB, 1,000 files, 7 releases). Every
v*tag published all 14 library modules (about 90 publications, ~1,450 files, ~19 MB), including releases that changed only the apps. Now thepublish-maven-centraljob publishes only when the published libraries changed since the last version on Maven Central..github/scripts/library-changes.pycom/linroid/ketch/api/maven-metadata.xml(<release>, else<latest>).com.vanniktech.maven.publishon either side. Test source sets (src/test/,src/*Test/) and*.mdare left out.build.gradle.kts,settings.gradle.kts,gradle.propertiesandgradle/libs.versions.toml. For these, comment-only edits are ignored, and so are the Gradle and Kotlin daemon settings ingradle.properties(org.gradle.*,kotlin.daemon.*). The version is passed with-PVERSION_NAME, and the group and POM come fromgradle.propertiesand each module's owngradle.properties, so both are covered.releasestill runs.workflow_dispatchinput,force-maven-central. A manual run on a tag publishes that tag's libraries and nothing else.if: github.event_name == 'push'), so their dependents skip too. A full re-run of an older tag would have pushed Dockerlatestand touched the GitHub release.if: !cancelled() && !failure(), so it runs on manual runs and still needs successful builds on tag pushes.docs/api.mdsays library versions skip app-only releases, so users should take the latest version on Maven Central.AGENTS.mdnotes the rule.Verification
I ran the script locally against each tag and the one before it:
org.gradle.parallelchanged)v0.1.0 publishes. It changed no published library, but it added real code to the root
build.gradle.kts: thecompilePublishedMetadataverification task. That script also sets the JVM target and compiler flags of every published module. A task like this can't be told apart from a compiler-option change without building both versions, so root-script code changes still publish. Across all 20 tag pairs, the root script changed without library changes only this once.Other checks:
--tag v0.10.1: skipped (already on Maven Central). With--tag v0.10.2againstmain: skipped (nothing published changed since v0.10.1).--forceeach publish.--depth 1clone, the base tag was fetched at depth 1 and diffed correctly.GITHUB_OUTPUTandGITHUB_STEP_SUMMARYare written as expected.actionlintis clean for this change. It still reports 12 SC2086 notes in other jobs; there were 13 before, and this change quotes one.Not covered: the workflow itself hasn't run on GitHub yet. The next tag push will be its first run.