Skip to content

Releases are built and served by JitPack from their GitHub release tag - #40

Draft
augustak wants to merge 1 commit into
masterfrom
jitpack-publishing
Draft

augustak wants to merge 1 commit into
masterfrom
jitpack-publishing

Conversation

@augustak

@augustak augustak commented Dec 3, 2026

Copy link
Copy Markdown
Member

This is an alternative to #37 that avoids Maven Central, where publishing may need the paid Publisher Pro tier. Only one of the two should be merged.

make publish uploaded to OSSRH (oss.sonatype.org), which Sonatype shut down in June 2025. With this PR, JitPack builds each release from its GitHub tag and serves it. JitPack needs no account, token or signing key for a public repository.

How a release works

  1. Merge a PR that bumps version in gradle.properties.
  2. Publish a GitHub release tagged v<version>, such as v4.0.1.
  3. The Publish workflow checks that the tag matches the version, then requests the release from JitPack. JitPack builds a version the first time it is requested, and that request returns once the build is done. If the build fails, the workflow fails and prints JitPack's build log. Without this step, the first user to request the version would trigger the build and be the one to find out it fails.

Users then depend on it like this:

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io'; content { includeGroup 'com.github.LucidtechAI' } }
}
dependencies {
    implementation 'com.github.LucidtechAI:las-sdk-java:v4.0.1'
}

What changes for users

  • Coordinates: ai.lucidtech:las-sdk-java:4.0.0 becomes com.github.LucidtechAI:las-sdk-java:v4.0.1, and users have to add the JitPack repository. 4.0.0 and earlier stay on Maven Central.
  • Custom domain (optional): JitPack can serve the artifacts under the group ai.lucidtech. This needs a DNS TXT record on git.lucidtech.ai that points to https://github.com/LucidtechAI (JitPack docs). The version would still be the tag, v4.0.1. I haven't tried it, as it needs the DNS record. If you want it, the README examples would change to ai.lucidtech.
  • Availability: JitPack is a free third-party service. If it's down, builds that need a version not yet in their cache fail. A built version can't be deleted by anyone other than us, and it's frozen after 7 days.

Changes

  • build.gradle: the deprecated maven plugin and the dead OSSRH uploadArchives are replaced with maven-publish. JitPack runs publishToMavenLocal and serves what it installs. Signing is gone, since JitPack doesn't use signatures. The POM keeps the 4.0.0 metadata (description, licence, SCM, developers). JitPack rewrites the group and version in the POM and in the Gradle module metadata to com.github.LucidtechAI and the tag.
  • jitpack.yml: builds with JDK 8 and runs ./gradlew publishToMavenLocal. JitPack's default command, build publishToMavenLocal, would run the tests, which need the mock API in Docker. The tests already run in CI on every PR.
  • .github/workflows/publish.yml: the tag check and the JitPack build. It needs no secrets, only contents: read.
  • Makefile: make publish is replaced with make install, which runs publishToMavenLocal.
  • README: an installation section, and a publishing section describing the steps above. CHANGELOG: a 4.0.1 entry for the move to JitPack.

Testing

  • JitPack built commits of this branch (b7e0aa0261, and 1e8943f7fb, the commit in this PR) with JDK 8. It served the jar, sources, javadoc, POM and module, with the coordinates rewritten to com.github.LucidtechAI:las-sdk-java:<commit>.
  • A Maven project and a Gradle project, with the JitPack repository added, both resolved com.github.LucidtechAI:las-sdk-java:1e8943f7fb together with org.json, httpclient and commons-io.
  • I ran the workflow's JitPack step locally against a successful build (exit 0) and against a commit whose build was made to fail on a temporary branch, since deleted (exit 1, printing the build log). Requests during a build showed that JitPack's status API reports none until the build finishes. So the step waits on the POM request, and checks the API for Error only when that request fails.
  • Not tested with a real release tag, since that would release 4.0.1.

Relation to other PRs

🤖 Generated with Claude Code

OSSRH (oss.sonatype.org), which uploadArchives published to, was shut down in
June 2025. JitPack builds a version from its tag the first time it is
requested, running publishToMavenLocal as set up in jitpack.yml, and serves it
as com.github.LucidtechAI:las-sdk-java:<tag>. The Publish workflow requests
the release when it is published, so it is built from the tag right away and
a failed build fails the workflow with JitPack's build log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant