From 6ae44796387e115f0eb94d8f34e7e56665aa8b65 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sat, 13 Jun 2026 09:21:28 -0500 Subject: [PATCH] Publish KMP snapshots from develop with branch-named versions (#946) Co-authored-by: Claude Fable 5 --- .github/workflows/snapshot-kmp.yml | 16 +++------------- packages/kmp/README.md | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/snapshot-kmp.yml b/.github/workflows/snapshot-kmp.yml index 4b7c324e..5ab68751 100644 --- a/.github/workflows/snapshot-kmp.yml +++ b/.github/workflows/snapshot-kmp.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - develop paths: - "meshtastic/**/*.proto" - "nanopb.proto" @@ -18,17 +19,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Compute snapshot version - id: version - run: | - TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - RELEASE_VERSION="${TAG#v}" - IFS='.' read -r major minor patch <<< "$RELEASE_VERSION" - SNAPSHOT_VERSION="${major}.${minor}.$((patch + 1))-SNAPSHOT" - echo "snapshot=$SNAPSHOT_VERSION" >> "$GITHUB_OUTPUT" - name: Setup Java uses: actions/setup-java@v4 @@ -43,7 +33,7 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Build KMP package - run: packages/kmp/gradlew --no-daemon -p packages/kmp build -PVERSION_NAME=${{ steps.version.outputs.snapshot }} + run: packages/kmp/gradlew --no-daemon -p packages/kmp build -PVERSION_NAME=${{ github.ref_name }}-SNAPSHOT - name: Publish snapshot to Maven Central env: @@ -56,4 +46,4 @@ jobs: echo "Missing Maven Central secrets — skipping snapshot publish." >&2 exit 0 fi - packages/kmp/gradlew --no-daemon -p packages/kmp publishAllPublicationsToMavenCentralRepository -PVERSION_NAME=${{ steps.version.outputs.snapshot }} + packages/kmp/gradlew --no-daemon -p packages/kmp publishAllPublicationsToMavenCentralRepository -PVERSION_NAME=${{ github.ref_name }}-SNAPSHOT diff --git a/packages/kmp/README.md b/packages/kmp/README.md index 494304a7..1c4b9513 100644 --- a/packages/kmp/README.md +++ b/packages/kmp/README.md @@ -18,7 +18,8 @@ The SDK version is derived automatically from the latest git tag — no manual v | Context | Version | Source | |---------|---------|--------| | Release CI (`v2.7.23` tag push) | `2.7.23` | Tag stripped of `v` prefix, passed as `-PVERSION_NAME` | -| Snapshot CI (master push) | `2.7.24-SNAPSHOT` | Latest tag + patch bump, computed in workflow | +| Snapshot CI (`master` push) | `master-SNAPSHOT` | Branch name, passed as `-PVERSION_NAME` | +| Snapshot CI (`develop` push) | `develop-SNAPSHOT` | Branch name, passed as `-PVERSION_NAME` | | Local dev (no flag) | `2.7.24-SNAPSHOT` | `git describe --tags --abbrev=0` + patch bump | | Local override | any | `./gradlew build -PVERSION_NAME=x.y.z` | @@ -51,9 +52,11 @@ implementation("org.meshtastic:protobufs:2.7.23") ### Snapshots -Snapshot builds (published from `master`) live in the Central Portal snapshots -repository, not on the main Maven Central CDN. To consume them, add that -repository alongside `mavenCentral()` and depend on a `-SNAPSHOT` version: +Snapshot builds are published from `master` and `develop` under the stable +coordinates `master-SNAPSHOT` and `develop-SNAPSHOT` — pin once and every push +to that branch republishes the same version. They live in the Central Portal +snapshots repository, not on the main Maven Central CDN. To consume them, add +that repository alongside `mavenCentral()`: ```kotlin // settings.gradle.kts (or build.gradle.kts) @@ -65,7 +68,16 @@ repositories { } // build.gradle.kts -implementation("org.meshtastic:protobufs:2.7.24-SNAPSHOT") +implementation("org.meshtastic:protobufs:develop-SNAPSHOT") +``` + +Gradle caches snapshot resolutions for 24 hours by default. To always pick up +the latest publish during active development: + +```kotlin +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, "minutes") +} ``` ## Local build