Repository navigation
ci(publish): publish the compiler plugin only when it changes - #5
Merged
Merged
Conversation
The compiler plugin gets its own version in the catalog (`compiler-plugin`), which the Gradle plugin resolves. Each publish matrix entry builds the plugin, compares it with the jar Maven Central holds under that version, and skips the upload when the contents match. A plugin that changed without a version bump fails the release before anything is uploaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Maven Central now caps how many files an organization publishes per month, and every file counts: each artifact goes up with its
.asc,.md5and.sha1. A Kolibri release uploads about 288 files. 220 of them are the compiler plugin (11 Kotlin builds × jar/sources/javadoc/module/pom × 4). The plugin hasn't changed since 0.2.0, but 0.2.1 through 0.2.4 each uploaded it again.What
gradle/libs.versions.tomlgets acompiler-pluginversion, starting at0.2.4(what's on Central now).:compiler-pluginpublishes as<compiler-plugin>-<kotlin>, and the Gradle plugin resolves that version through a newBuildConfig.KOTLIN_PLUGIN_VERSION, which replacesKOLIBRI_VERSION.stage-compilermatrix entry checks Central before staging. It builds the jar, andscripts/compare-with-maven-central.shcompares its entries with the jar Central holds at the same coordinates:The comparison works because the build is reproducible. Rebuilding the plugin locally for every Kotlin release in
gradle/kotlin-versions.txtgives jars identical, entry by entry, to the0.2.4-*jars on Central.Is an older plugin safe with a newer runtime?
The only mix a consumer can get is an older plugin with a newer runtime, and CI already tests that mix: the plugin built from the current source is what the runtime and JNI tests compile with. If that source builds the same bytes as the published plugin, the shipped pairing has been tested. A runtime change that needs a plugin change changes the plugin bytes, and the release then fails until
compiler-pluginis bumped.Releasing after this
kolibrionly. The release uploads 68 files.compiler-pluginto the new version. If you forget, the publish workflow fails and says so.One known edge case: repo1 can take ~30 min to serve a new upload. A release right after one that bumped the plugin may not find it there yet and try to upload it again. Central rejects the duplicate and the deployment fails as a whole; re-running later fixes it.
Testing
published(it would be skipped).:gradle-plugin:buildpasses; the generatedKOTLIN_PLUGIN_VERSIONis0.2.4.🤖 Generated with Claude Code