Skip to content

Next (Keeping a draft open) #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
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
27 changes: 0 additions & 27 deletions .github/workflows/ci.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,3 @@ jobs:
tag: ${{ steps.version.outputs.NEW_VERSION }}
generateReleaseNotes: true
token: ${{ github.token }}

- name: Setup Buf
uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}

- name: Push to schema registry
# uses: bufbuild/buf-push-action@v1
# with:
# buf_token: ${{ secrets.BUF_TOKEN }}
run: |
export BUF_TOKEN=${{ secrets.BUF_TOKEN }}
buf push --tag ${{ steps.version.outputs.NEW_VERSION }}
92 changes: 74 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,86 @@
name: Push new version to schema registry

permissions:
contents: read
name: Publish to Cargo & JSR

on:
push:
tags:
- "**"
# tags:
# - "**"

jobs:
push_to_registry:
runs-on: ubuntu-latest
permissions: write-all

jobs:
codegen:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: debug
run: cat packages/ts/deno.json && cat packages/rust/Cargo.toml
- name: Set Package Versions to current tag
# run: sed -i "s/__PACKAGE_VERSION__/$(echo $GITHUB_REF | cut -d '/' -f 3)/g" packages/ts/deno.json \
# && sed -i "s/__PACKAGE_VERSION__/$(echo $GITHUB_REF | cut -d '/' -f 3)/g" packages/rust/Cargo.toml
run: |
sed -i "s/__PACKAGE_VERSION__/2.7.0/g" packages/ts/deno.json
sed -i "s/__PACKAGE_VERSION__/2.7.0/g" packages/rust/Cargo.toml
- name: Setup Buf
uses: bufbuild/buf-setup-action@v1.30.0
uses: bufbuild/buf-setup-action@main
with:
github_token: ${{ github.token }}

- name: Push to schema registry
# uses: bufbuild/buf-push-action@v1
# with:
# buf_token: ${{ secrets.BUF_TOKEN }}
- name: Generate code
run: buf generate
- name: Copy license & README
run: |
export BUF_TOKEN=${{ secrets.BUF_TOKEN }}
buf push --tag ${{ github.ref_name }}
cp LICENSE packages/ts
cp LICENSE packages/rust
cp README.md packages/ts
cp README.md packages/rust
- name: Upload Rust code
uses: actions/upload-artifact@v4
with:
name: rust_code
path: packages/rust
- name: Upload TypeScript code
uses: actions/upload-artifact@v4
with:
name: ts_code
path: packages/ts
- name: Upload C code
uses: actions/upload-artifact@v4
with:
name: c_code
path: packages/c

publish-jsr:
runs-on: ubuntu-24.04
needs: codegen
permissions:
contents: read
id-token: write
steps:
- name: Download TypeScript code
uses: actions/download-artifact@v4
with:
name: ts_code
- name: Set up Deno
uses: denoland/setup-deno@main
with:
deno-version: rc
- name: Publish to JSR
run: deno publish --unstable-sloppy-imports

publish-cargo:
runs-on: ubuntu-24.04
needs: codegen
steps:
- name: Download Rust code
uses: actions/download-artifact@v4
with:
name: rust_code
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check Library
run: cargo check
- name: Publish to crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_TOKEN }}
ignore-unpublished-changes: true
28 changes: 0 additions & 28 deletions .github/workflows/pull_request.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
packages/ts/lib/*
packages/rust/src/generated/*
packages/rust/target
packages/c/*
!.gitkeep
.DS_Store
12 changes: 12 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: v2
plugins:
- remote: buf.build/bufbuild/es:v2.1.0
out: packages/ts/lib
opt: target=ts
- remote: buf.build/community/neoeinstein-prost:v0.4.0
out: packages/rust/src/generated
- remote: buf.build/community/neoeinstein-prost-crate:v0.4.1
out: packages/rust/src/generated
opt: no_features
- remote: buf.build/community/nanopb:v0.4.9
out: packages/c
32 changes: 18 additions & 14 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
version: v1
name: buf.build/meshtastic/protobufs
deps: []
build:
excludes: []
breaking:
use:
- FILE
lint:
ignore_only:
PACKAGE_DEFINED:
- nanopb.proto
use:
- MINIMAL
version: v2
modules:
- path: meshtastic
name: buf.build/meshtastic/protobufs
excludes:
- meshtastic/device_only/
lint:
use:
- MINIMAL
except:
- PACKAGE_NO_IMPORT_CYCLE
disallow_comment_ignores: true
breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT
12 changes: 6 additions & 6 deletions meshtastic/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/channel.proto";
import "meshtastic/config.proto";
import "meshtastic/connection_status.proto";
import "meshtastic/mesh.proto";
import "meshtastic/module_config.proto";
import "meshtastic/device_ui.proto";
import "channel.proto";
import "config.proto";
import "connection_status.proto";
import "mesh.proto";
import "module_config.proto";
import "device_ui.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
4 changes: 2 additions & 2 deletions meshtastic/apponly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/channel.proto";
import "meshtastic/config.proto";
import "channel.proto";
import "config.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
4 changes: 2 additions & 2 deletions meshtastic/clientonly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/localonly.proto";
import "meshtastic/mesh.proto";
import "localonly.proto";
import "mesh.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
2 changes: 1 addition & 1 deletion meshtastic/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/device_ui.proto";
import "device_ui.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions meshtastic/localonly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/config.proto";
import "meshtastic/module_config.proto";
import "config.proto";
import "module_config.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
14 changes: 7 additions & 7 deletions meshtastic/mesh.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/channel.proto";
import "meshtastic/config.proto";
import "meshtastic/module_config.proto";
import "meshtastic/portnums.proto";
import "meshtastic/telemetry.proto";
import "meshtastic/xmodem.proto";
import "meshtastic/device_ui.proto";
import "channel.proto";
import "config.proto";
import "module_config.proto";
import "portnums.proto";
import "telemetry.proto";
import "xmodem.proto";
import "device_ui.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
4 changes: 2 additions & 2 deletions meshtastic/mqtt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package meshtastic;

import "meshtastic/config.proto";
import "meshtastic/mesh.proto";
import "config.proto";
import "mesh.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down
Loading