Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/kmp-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: kmp-pull-request

on:
pull_request:
paths:
- "meshtastic/**/*.proto"
- "nanopb.proto"
- "packages/kmp/**"

permissions:
contents: read

jobs:
build-kmp:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build KMP package
run: packages/kmp/gradlew --no-daemon -p packages/kmp build -PVERSION_NAME=0.0.0-pr
95 changes: 95 additions & 0 deletions .github/workflows/publish-kmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Publish KMP package

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g. v1.2.3). Used when manually dispatching."
required: false
type: string
dry_run:
description: "Dry run mode - build and publish to Maven Local only"
required: false
type: boolean
default: false

permissions:
contents: read

jobs:
build-kmp:
runs-on: macos-latest
outputs:
version: ${{ steps.version.outputs.VERSION }}
tag: ${{ steps.version.outputs.TAG }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine version
id: version
run: |
set -euo pipefail
if [ "${{ github.ref_type }}" = "tag" ]; then
TAG="${{ github.ref_name }}"
elif [ -n "${{ inputs.version || '' }}" ]; then
TAG="${{ inputs.version }}"
else
echo "No tag ref and no 'version' input. Provide a tag or pass inputs.version." >&2
exit 1
fi
VERSION="${TAG#v}"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build KMP package
run: packages/kmp/gradlew --no-daemon -p packages/kmp clean build -PVERSION_NAME=${{ steps.version.outputs.VERSION }}

- name: Publish to Maven Local
run: packages/kmp/gradlew --no-daemon -p packages/kmp publishToMavenLocal -PVERSION_NAME=${{ steps.version.outputs.VERSION }}

publish-kmp:
runs-on: macos-latest
needs: build-kmp
if: ${{ !inputs.dry_run }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Publish to Maven Central
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_SIGNING_KEY }}
run: packages/kmp/gradlew --no-daemon -p packages/kmp publishAllPublicationsToMavenCentralRepository -PVERSION_NAME=${{ needs.build-kmp.outputs.version }}
35 changes: 9 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ jobs:
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
echo "Resolved VERSION=$VERSION, TAG=$TAG"

- name: Setup Buf
uses: bufbuild/buf-setup-action@main
uses: bufbuild/buf-setup-action@v1.50.0
with:
github_token: ${{ github.token }}

Expand All @@ -62,25 +61,21 @@ jobs:
set -euo pipefail
src_dir="packages/ts/lib/meshtastic"
dest_dir="packages/ts/lib"

if [ ! -d "$src_dir" ]; then
echo "Expected source directory '$src_dir' does not exist. 'buf generate' may have failed or changed its output paths." >&2
exit 1
fi

if ! compgen -G "$src_dir"/*_pb.ts > /dev/null; then
echo "No '*_pb.ts' files found in '$src_dir'. 'buf generate' may have produced no TypeScript files or changed their naming." >&2
exit 1
fi

mv "$src_dir"/*_pb.ts "$dest_dir"/
- name: Show generated files
run: |
echo "=== packages/ts contents ==="
ls -la packages/ts/
echo "=== packages/ts/lib contents ==="
ls -la packages/ts/lib/ || echo "lib folder not found"

- name: Set package versions
run: |
set -euo pipefail
Expand All @@ -89,7 +84,6 @@ jobs:
test -f "$f" || { echo "Missing $f" >&2; exit 1; }
sed -i "s/__PACKAGE_VERSION__/${VERSION}/g" "$f"
done

- name: Copy license & README
run: cp LICENSE README.md packages/ts/

Expand All @@ -116,11 +110,10 @@ jobs:
ls -la
echo "=== lib/ contents ==="
ls -la lib/ || echo "lib folder not found"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"

- name: Install dependencies
run: npm install
Expand All @@ -133,7 +126,6 @@ jobs:
echo "=== Build output ==="
ls -la
ls -la dist/

- name: Upload built NPM package
uses: actions/upload-artifact@v4
with:
Expand All @@ -143,7 +135,6 @@ jobs:
package.json
LICENSE
README.md

- name: Upload JSR package
uses: actions/upload-artifact@v4
with:
Expand All @@ -154,7 +145,6 @@ jobs:
deno.json
LICENSE
README.md

create-release-zips:
runs-on: ubuntu-24.04
needs: [codegen, build-typescript]
Expand All @@ -175,15 +165,13 @@ jobs:
run: |
cd npm_package && zip -r ../meshtastic-protobufs-npm.zip . && cd ..
cd jsr_package && zip -r ../meshtastic-protobufs-jsr.zip . && cd ..

- name: Upload release zips
uses: actions/upload-artifact@v4
with:
name: release_zips
path: |
meshtastic-protobufs-npm.zip
meshtastic-protobufs-jsr.zip

upload-release-assets:
runs-on: ubuntu-24.04
needs: [codegen, create-release-zips]
Expand All @@ -201,7 +189,6 @@ jobs:
files: |
meshtastic-protobufs-npm.zip
meshtastic-protobufs-jsr.zip

push-buf-registry:
runs-on: ubuntu-24.04
needs: codegen
Expand All @@ -211,7 +198,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Buf
uses: bufbuild/buf-setup-action@main
uses: bufbuild/buf-setup-action@v1.50.0
with:
github_token: ${{ github.token }}

Expand All @@ -224,9 +211,6 @@ jobs:
runs-on: ubuntu-24.04
needs: [codegen, build-typescript]
if: ${{ !inputs.dry_run }}
permissions:
contents: read
id-token: write
steps:
- name: Download NPM package
uses: actions/download-artifact@v4
Expand All @@ -236,14 +220,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
registry-url: "https://registry.npmjs.org"

- name: Install NPM CLI
run: npm install -g npm@latest

- name: Publish to NPM
run: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-jsr:
runs-on: ubuntu-24.04
Expand All @@ -261,7 +244,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"

- name: Publish to JSR
run: npx jsr publish
run: npx jsr publish --allow-dirty
59 changes: 59 additions & 0 deletions .github/workflows/snapshot-kmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish KMP snapshot

on:
push:
branches:
- master
paths:
- "meshtastic/**/*.proto"
- "nanopb.proto"
- "packages/kmp/**"

permissions:
contents: read

jobs:
publish-snapshot:
runs-on: macos-latest
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
with:
distribution: temurin
java-version: "21"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Gradle
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 }}

- name: Publish snapshot to Maven Central
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_SIGNING_KEY }}
run: |
set -euo pipefail
if [ -z "${ORG_GRADLE_PROJECT_mavenCentralUsername}" ] || [ -z "${ORG_GRADLE_PROJECT_mavenCentralPassword}" ]; then
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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

# Generated protobuf files
packages/ts/lib/
packages/kmp/.gradle/
packages/kmp/build/
.bin/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ The [Protobuf](https://developers.google.com/protocol-buffers) message definitio

**[Documentation/API Reference](https://buf.build/meshtastic/protobufs)**

## Generated client packages

- TypeScript package: `packages/ts`
- Rust package: `packages/rust`
- Kotlin Multiplatform package (Wire): `packages/kmp`

## Stats

![Alt](https://repobeats.axiom.co/api/embed/47e9ee1d81d9c0fdd2b4b5b4c673adb1756f6db5.svg "Repobeats analytics image")
20 changes: 20 additions & 0 deletions meshtastic/mesh.proto
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,26 @@ enum HardwareModel {
*/
T_ECHO_CARD = 136;

/*
* Seeed Tracker L2
*/
SEEED_WIO_TRACKER_L2 = 137;

/*
* Elecrow CrowPanel Advance P4 models, ESP32-P4 and TFT with SX1262 radio plugin
*/
CROWPANEL_P4 = 138;

/*
* Heltec Mesh Tower V2
*/
HELTEC_MESH_TOWER_V2 = 139;

/*
* Meshnology W10
*/
MESHNOLOGY_W10 = 140;

/*
* ------------------------------------------------------------------------------------------------------------------------------------------
* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
Expand Down
Loading
Loading