Publishing Android and Compose
Delivered by JitPack from a git tag: nothing to upload, one lookup to verify.
Last updated
Library: packages/android (VectorDrawables and Compose ImageVector accessors). It is delivered by JitPack, which builds it
from a git tag on demand, so there is no account to create and nothing to upload.
Coordinates: com.github.xerobi:xerobi-icons:<tag> (for example v0.1.0). Consumers add:
dependencyResolutionManagement { repositories { google(); mavenCentral(); maven("https://jitpack.io") } }
dependencies { implementation("com.github.xerobi:xerobi-icons:v0.1.0") }
One-time setup
- The repository is public, at
github.com/xerobi/xerobi-icons. JitPack builds the pathcom.github.<owner>:<repo>; if the repo moves, the coordinates change for everyone. jitpack.ymlat the repository root tells it to use JDK 17 and runcd packages/android && VERSION=$VERSION ./gradlew publishToMavenLocal. Do not move that file.- Nothing has to be published by hand. The first time anyone asks for a tag, JitPack builds it. Do that yourself once to see it work: open <https://jitpack.io/#xerobi/xerobi-icons>, find the tag under Releases, click Get it. It shows a log and turns green when the build is done (the first build of a large library takes several minutes).
Per release
The jitpack job in release.yml requests the new tag’s .pom (that is what starts a build) and waits up to 20 minutes for it. It is
marked non-blocking: a slow JitPack must not turn a good release red. If it warns, look at the log on jitpack.io.
packages/android must be committed on the tagged commit: JitPack builds the tag, not your machine. The release PR check
makes sure of it.
Common errors
| Symptom | Fix |
|---|---|
| Red on jitpack.io, “Could not find …” | packages/android missing or stale at that tag: regenerate, commit, move or recreate the tag |
| “Unsupported class file major version” | JDK mismatch: jitpack.yml must say openjdk17 |
| Build times out | Large icon set: the log shows the step; a re-request often succeeds once caches warm |
| Wrong artifact name | The artifact is derived from the repo name; do not rename the repository |
Later: Maven Central (optional)
JitPack coordinates (com.github...) work but are less trusted than Maven Central, and some companies block JitPack. To move: register at the
Sonatype Central Portal, verify a namespace (io.github.xerobi is verified through a GitHub repository, or a domain you own), create
a GPG key, add a maven-publish + signing configuration to the generated Gradle files, and add a central job to release.yml.
Keep publishing to JitPack too so existing users do not break.