Release for every supported Jackson line - #446
Merged
Merged
Conversation
Jackson 2.x currently maintains two LTS lines, 2.21 and 2.22. This project is based on 2.21, so a release only ever covers that line. Add a workflow that derives the same source for the other lines on every published release. It rewrites only the Jackson version in the version catalog, tags the result as <latest patch of the line>-<same beta number>, and lets JitPack build it. Releasing 2.21.5-beta38 therefore also produces 2.22.1-beta38, and the shared beta number shows that the two are built from identical source. The tag is pushed only after lint and test pass, so a line that is incompatible with the current source is simply not released. Also allow the Jackson version to be overridden by JACKSON_VERSION, so that such a failure can be reproduced locally without editing the catalog. Co-Authored-By: Claude Opus 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.
Problem
Jackson 2.x currently maintains two LTS lines, 2.21 and 2.22. This project is based on 2.21, so a release only ever covers that line.
Approach
The version scheme already encodes the Jackson version (
<jackson version>-beta<N>), so the two lines never collide:2.21.5-beta38and2.22.1-beta38are distinct coordinates, and the shared beta number shows at a glance that they are built from identical source.JitPack builds a git tag, so the tag itself has to carry the right Jackson version. On every published release, the workflow creates a commit on top of the released tag that rewrites only the
jacksonline of the version catalog, and tags it for the other line. No branch is maintained; the derived commit is reachable from its tag and its parent is the released tag, so it stays traceable.Per line, the job:
<latest patch>-<same beta number>.gradle/libs.versions.toml.The tag is pushed only after lint and test pass, so a line that is incompatible with the current source is simply not released.
fail-fast: falsekeeps one line from taking the others down. In practice only the 2.22 job does work, since 2.21 skips on the existing tag.Adding or dropping a line is a single edit to the matrix.
About the JACKSON_VERSION override
settings.gradle.ktsgains aJACKSON_VERSIONoverride, mirroring the existingKOTLIN_VERSIONone. CI does not use it — the release path has to rewrite the catalog, because JitPack builds the tag content and no environment variable reaches it.It is there so that a failure reported by this workflow can be reproduced locally with
JACKSON_VERSION=2.22.1 ./gradlew test, without editing the catalog. Since there is no pre-release check, that reproduction path is the only thing standing between a red release run and hand-editing files. Drop it if that does not seem worth an unused-by-CI mechanism.Verification
Confirmed locally:
./gradlew testagainst Jackson 2.22.1jackson-databind 2.22.1,jackson-annotations 2.22— correct, since annotations has no patch component and must come from the BOM2.21 -> 2.21.5-beta38(skipped, tag exists),2.22 -> 2.22.1-beta382.22.1-beta38and matches the tagJACKSON_VERSION=2.22.1 ./gradlew properties2.22.1-beta38The workflow itself has not run on GitHub yet.
workflow_dispatchtakes a tag, so it can be exercised against an existing release without cutting a new one.Trade-off
There is no pre-release check against 2.22, so an incompatibility surfaces when the release runs rather than before. The 2.21 release is unaffected, but the decision of whether to fix 2.22 or skip it lands in the middle of the release.
🤖 Generated with Claude Code