Add KMP protobuf publishing with Wire#924
Merged
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow pull-request / build (pull_request).
|
Kotlin Multiplatform library (Android, JVM, iOS) generated from the proto schema using Square Wire. Includes: - packages/kmp/ build with Wire plugin, maven-publish, and signing - CI workflow for PR validation (kmp-pull-request.yml) - CI workflow for tagged release publishing (publish-kmp.yml) - CI workflow for SNAPSHOT publishing on master push (snapshot-kmp.yml) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These two options are required for ABI compatibility with all existing consumers (Meshtastic-Android, TAKPacket-SDK): - boxOneOfsMinSize = 5000: flattens oneof fields to nullable properties on the parent class instead of sealed-class wrappers - makeImmutableCopies = false: skips defensive copies of repeated/map fields on decode for better performance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add publishToMavenCentral(automaticRelease = true) for auto-promotion - Add inline POM block (name, description, license, scm, developers) - Add VERSION_NAME to gradle.properties; workflows use -PVERSION_NAME - Compute snapshot version as major.minor.(patch+1)-SNAPSHOT - Align CI secret names with org conventions (OSSRH_USERNAME/PASSWORD) - Add org.gradle.caching=true and org.gradle.parallel=true - Remove redundant POM_* properties from gradle.properties Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
VERSION_NAME in gradle.properties tracks the current proto version. Snapshots publish as major.minor.(patch+1)-SNAPSHOT (e.g. 2.7.24-SNAPSHOT). Updated README with versioning docs and corrected publish commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove VERSION_NAME from gradle.properties. Version is now computed: - CI release: tag name stripped of 'v' prefix, passed via -PVERSION_NAME - CI snapshot: git describe + patch bump, computed in workflow - Local dev: git describe fallback in build.gradle.kts (auto-SNAPSHOT) - Override: -PVERSION_NAME=x.y.z always wins No file to keep in sync — tagging a release is the only action needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds LICENSE as a commonMain resource so it is included in all platform JARs/klibs alongside the POM license declaration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace static copy with tasks.withType<Jar> { from(...) } that reads
the repo root LICENSE at packaging time. No file duplication needed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4bebeee to
7569f71
Compare
This was referenced May 29, 2026
thebentern
approved these changes
May 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Kotlin Multiplatform package under packages/kmp/ that generates Wire Kotlin models from the protobuf schema in this repo and publishes them as a KMP library for downstream consumers (Android/JVM/iOS), along with CI workflows to validate and publish the artifacts.
Changes:
- Introduce a new Gradle-based KMP/Wire build (
packages/kmp) with Maven Central publishing configuration. - Add GitHub Actions workflows for PR validation, tag-based releases, and master-branch snapshot publishing.
- Update repo documentation and ignore rules to account for the new package.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the newly added generated client packages, including the new KMP/Wire package. |
| .gitignore | Ignores Gradle and build outputs for the new packages/kmp project. |
| packages/kmp/settings.gradle.kts | Configures plugin and dependency repositories for the standalone KMP build. |
| packages/kmp/README.md | Documents usage, versioning, and publishing commands for the KMP artifact. |
| packages/kmp/build.gradle.kts | Defines KMP targets, Wire generation, version derivation, and Maven Central publishing. |
| packages/kmp/gradle.properties | Sets Gradle/Kotlin build properties and publishing coordinates (GROUP/artifact ID). |
| packages/kmp/gradlew | Adds Gradle wrapper script for POSIX. |
| packages/kmp/gradlew.bat | Adds Gradle wrapper script for Windows. |
| packages/kmp/gradle/wrapper/gradle-wrapper.properties | Pins the Gradle distribution used by the wrapper. |
| .github/workflows/kmp-pull-request.yml | Validates the KMP build on PRs affecting protos or the KMP package. |
| .github/workflows/publish-kmp.yml | Publishes releases on tag pushes (and supports manual dispatch). |
| .github/workflows/snapshot-kmp.yml | Attempts to publish snapshot builds on master pushes (proto/kmp changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The local-dev fallback merged git stderr into stdout, so a failed git describe (no git, shallow/tagless clone) left an error string in `tag` — defeating the empty-string guard and throwing IndexOutOfBounds at configuration time. Drop redirectErrorStream, check the exit code, and parse each segment defensively so it degrades to 0.0.1-SNAPSHOT. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Snapshots publish to the Central Portal snapshots repository rather than the main Maven Central CDN, so consumers must add that repo explicitly to resolve -SNAPSHOT artifacts. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Adds a Kotlin Multiplatform library (
packages/kmp/) that generates and publishes Wire models from the protobuf schema in this repo. Provides a single "source of truth" artifact for downstream KMP consumers.graph TD repo[protobufs repo] -->|publishes| artifact["org.meshtastic:protobufs<br/>(KMP)"] artifact --> takpacket[takpacket-sdk] artifact --> sdk[meshtastic-sdk] artifact --> android[Meshtastic-Android] artifact --> other[Other KMP/JVM consumers] takpacket --> androidPublished coordinates
implementation("org.meshtastic:protobufs:<version>")Platform artifacts resolved automatically by Gradle:
protobufs-androidprotobufs-jvmprotobufs-iosx64/protobufs-iosarm64/protobufs-iossimulatorarm64Snapshots
Snapshots (published from
master) live in the Central Portal snapshots repository, not the main Maven Central CDN. Consumers must add it explicitly:repositories { mavenCentral() maven("https://central.sonatype.com/repository/maven-snapshots/") } implementation("org.meshtastic:protobufs:2.7.24-SNAPSHOT")Versioning
Version is derived entirely from git tags — no file to maintain:
v2.7.23)2.7.232.7.24-SNAPSHOTgit describeStack
boxOneOfsMinSize=5000,makeImmutableCopies=false)com.android.kotlin.multiplatform.library)CI Workflows
kmp-pull-request.yml— build validation on PRspublish-kmp.yml— tag-triggered release to Maven Centralsnapshot-kmp.yml— SNAPSHOT on master push (proto/kmp path filter)Publishing alignment
Matches conventions from
takpacket-sdk/mqttastic-client-kmp:publishToMavenCentral(automaticRelease = true)signingInMemoryKey.isPresent)MAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORD/MAVEN_SIGNING_KEYLicensing
GPLv3 is declared at three layers:
<licenses>block (name, URL, distribution)LICENSEbundled into all JARs viatasks.withType<Jar>Downstream consumers