kopia lustrzana https://github.com/meshtastic/protobufs
cleanup & update actions
rodzic
dea3a82ef2
commit
2982d3017b
|
@ -17,11 +17,11 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Buf
|
- name: Setup Buf
|
||||||
uses: bufbuild/buf-setup-action@v1.26.1
|
uses: bufbuild/buf-setup-action@v1.30.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Push to schema registry
|
- name: Push to schema registry
|
||||||
uses: bufbuild/buf-push-action@v1.1.1
|
uses: bufbuild/buf-push-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
buf_token: ${{ secrets.BUF_TOKEN }}
|
buf_token: ${{ secrets.BUF_TOKEN }}
|
||||||
|
|
|
@ -50,7 +50,7 @@ jobs:
|
||||||
echo "NEW_VERSION=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_OUTPUT
|
echo "NEW_VERSION=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: ncipollo/release-action@v1.13.0
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
name: Meshtastic Protobufs ${{ steps.version.outputs.NEW_VERSION }}
|
name: Meshtastic Protobufs ${{ steps.version.outputs.NEW_VERSION }}
|
||||||
tag: ${{ steps.version.outputs.NEW_VERSION }}
|
tag: ${{ steps.version.outputs.NEW_VERSION }}
|
||||||
|
@ -58,7 +58,7 @@ jobs:
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Setup Buf
|
- name: Setup Buf
|
||||||
uses: bufbuild/buf-setup-action@v1.26.1
|
uses: bufbuild/buf-setup-action@v1.30.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Buf
|
- name: Setup Buf
|
||||||
uses: bufbuild/buf-setup-action@v1.26.1
|
uses: bufbuild/buf-setup-action@v1.30.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,15 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Buf
|
- name: Setup Buf
|
||||||
uses: bufbuild/buf-setup-action@v1.26.1
|
uses: bufbuild/buf-setup-action@v1.30.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
uses: bufbuild/buf-lint-action@v1.0.3
|
uses: bufbuild/buf-lint-action@v1.1.1
|
||||||
|
|
||||||
- name: Push to schema registry
|
- name: Push to schema registry
|
||||||
uses: bufbuild/buf-push-action@v1.1.1
|
uses: bufbuild/buf-push-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
buf_token: ${{ secrets.BUF_TOKEN }}
|
buf_token: ${{ secrets.BUF_TOKEN }}
|
||||||
draft: ${{ github.ref_name != 'master'}}
|
draft: ${{ github.ref_name != 'master'}}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
*out
|
|
||||||
*logs
|
|
||||||
*actions
|
|
||||||
*notifications
|
|
||||||
*tools
|
|
||||||
plugins
|
|
||||||
user_trunk.yaml
|
|
||||||
user.yaml
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Autoformatter friendly markdownlint config (all formatting rules disabled)
|
|
||||||
default: true
|
|
||||||
blank_lines: false
|
|
||||||
bullet: false
|
|
||||||
html: false
|
|
||||||
indentation: false
|
|
||||||
line_length: false
|
|
||||||
spaces: false
|
|
||||||
url: false
|
|
||||||
whitespace: false
|
|
|
@ -1,10 +0,0 @@
|
||||||
rules:
|
|
||||||
quoted-strings:
|
|
||||||
required: only-when-needed
|
|
||||||
extra-allowed: ["{|}"]
|
|
||||||
empty-values:
|
|
||||||
forbid-in-block-mappings: true
|
|
||||||
forbid-in-flow-mappings: true
|
|
||||||
key-duplicates: {}
|
|
||||||
octal-values:
|
|
||||||
forbid-implicit-octal: true
|
|
|
@ -1,33 +0,0 @@
|
||||||
version: 0.1
|
|
||||||
cli:
|
|
||||||
version: 1.16.2
|
|
||||||
plugins:
|
|
||||||
sources:
|
|
||||||
- id: trunk
|
|
||||||
ref: v1.2.5
|
|
||||||
uri: https://github.com/trunk-io/plugins
|
|
||||||
lint:
|
|
||||||
enabled:
|
|
||||||
- checkov@2.4.9
|
|
||||||
- trivy@0.45.1
|
|
||||||
- trufflehog@3.57.0
|
|
||||||
- yamllint@1.32.0
|
|
||||||
- buf-lint@1.26.1
|
|
||||||
- buf-breaking@1.26.1
|
|
||||||
- actionlint@1.6.26
|
|
||||||
- markdownlint@0.37.0
|
|
||||||
- prettier@3.0.3
|
|
||||||
- gitleaks@8.18.0
|
|
||||||
- git-diff-check
|
|
||||||
runtimes:
|
|
||||||
enabled:
|
|
||||||
- python@3.10.8
|
|
||||||
- go@1.21.0
|
|
||||||
- node@18.12.1
|
|
||||||
actions:
|
|
||||||
disabled:
|
|
||||||
- trunk-announce
|
|
||||||
- trunk-check-pre-push
|
|
||||||
- trunk-fmt-pre-commit
|
|
||||||
enabled:
|
|
||||||
- trunk-upgrade-available
|
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"recommendations": ["trunk.io", "pbkit.vscode-pbkit", "bufbuild.vscode-buf"]
|
"recommendations": ["pbkit.vscode-pbkit", "bufbuild.vscode-buf"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.defaultFormatter": "trunk.io"
|
"editor.defaultFormatter": "pbkit.vscode-pbkit"
|
||||||
}
|
}
|
||||||
|
|
71
nanopb.proto
71
nanopb.proto
|
@ -6,40 +6,41 @@
|
||||||
// for memory-limited environments.
|
// for memory-limited environments.
|
||||||
|
|
||||||
syntax = "proto2";
|
syntax = "proto2";
|
||||||
|
|
||||||
import "google/protobuf/descriptor.proto";
|
import "google/protobuf/descriptor.proto";
|
||||||
|
|
||||||
option java_package = "fi.kapsi.koti.jpa.nanopb";
|
option java_package = "fi.kapsi.koti.jpa.nanopb";
|
||||||
|
|
||||||
enum FieldType {
|
enum FieldType {
|
||||||
FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
|
FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
|
||||||
FT_CALLBACK = 1; // Always generate a callback field.
|
FT_CALLBACK = 1; // Always generate a callback field.
|
||||||
FT_POINTER = 4; // Always generate a dynamically allocated field.
|
FT_POINTER = 4; // Always generate a dynamically allocated field.
|
||||||
FT_STATIC = 2; // Generate a static field or raise an exception if not possible.
|
FT_STATIC = 2; // Generate a static field or raise an exception if not possible.
|
||||||
FT_IGNORE = 3; // Ignore the field completely.
|
FT_IGNORE = 3; // Ignore the field completely.
|
||||||
FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead
|
FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead
|
||||||
}
|
}
|
||||||
|
|
||||||
enum IntSize {
|
enum IntSize {
|
||||||
IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto
|
IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto
|
||||||
IS_8 = 8;
|
IS_8 = 8;
|
||||||
IS_16 = 16;
|
IS_16 = 16;
|
||||||
IS_32 = 32;
|
IS_32 = 32;
|
||||||
IS_64 = 64;
|
IS_64 = 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TypenameMangling {
|
enum TypenameMangling {
|
||||||
M_NONE = 0; // Default, no typename mangling
|
M_NONE = 0; // Default, no typename mangling
|
||||||
M_STRIP_PACKAGE = 1; // Strip current package name
|
M_STRIP_PACKAGE = 1; // Strip current package name
|
||||||
M_FLATTEN = 2; // Only use last path component
|
M_FLATTEN = 2; // Only use last path component
|
||||||
M_PACKAGE_INITIALS = 3; // Replace the package name by the initials
|
M_PACKAGE_INITIALS = 3; // Replace the package name by the initials
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DescriptorSize {
|
enum DescriptorSize {
|
||||||
DS_AUTO = 0; // Select minimal size based on field type
|
DS_AUTO = 0; // Select minimal size based on field type
|
||||||
DS_1 = 1; // 1 word; up to 15 byte fields, no arrays
|
DS_1 = 1; // 1 word; up to 15 byte fields, no arrays
|
||||||
DS_2 = 2; // 2 words; up to 4095 byte fields, 4095 entry arrays
|
DS_2 = 2; // 2 words; up to 4095 byte fields, 4095 entry arrays
|
||||||
DS_4 = 4; // 4 words; up to 2^32-1 byte fields, 2^16-1 entry arrays
|
DS_4 = 4; // 4 words; up to 2^32-1 byte fields, 2^16-1 entry arrays
|
||||||
DS_8 = 8; // 8 words; up to 2^32-1 entry arrays
|
DS_8 = 8; // 8 words; up to 2^32-1 entry arrays
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the inner options message, which basically defines options for
|
// This is the inner options message, which basically defines options for
|
||||||
|
@ -49,32 +50,32 @@ message NanoPBOptions {
|
||||||
// Allocated size for 'bytes' and 'string' fields.
|
// Allocated size for 'bytes' and 'string' fields.
|
||||||
// For string fields, this should include the space for null terminator.
|
// For string fields, this should include the space for null terminator.
|
||||||
optional int32 max_size = 1;
|
optional int32 max_size = 1;
|
||||||
|
|
||||||
// Maximum length for 'string' fields. Setting this is equivalent
|
// Maximum length for 'string' fields. Setting this is equivalent
|
||||||
// to setting max_size to a value of length+1.
|
// to setting max_size to a value of length+1.
|
||||||
optional int32 max_length = 14;
|
optional int32 max_length = 14;
|
||||||
|
|
||||||
// Allocated number of entries in arrays ('repeated' fields)
|
// Allocated number of entries in arrays ('repeated' fields)
|
||||||
optional int32 max_count = 2;
|
optional int32 max_count = 2;
|
||||||
|
|
||||||
// Size of integer fields. Can save some memory if you don't need
|
// Size of integer fields. Can save some memory if you don't need
|
||||||
// full 32 bits for the value.
|
// full 32 bits for the value.
|
||||||
optional IntSize int_size = 7 [default = IS_DEFAULT];
|
optional IntSize int_size = 7 [default = IS_DEFAULT];
|
||||||
|
|
||||||
// Force type of field (callback or static allocation)
|
// Force type of field (callback or static allocation)
|
||||||
optional FieldType type = 3 [default = FT_DEFAULT];
|
optional FieldType type = 3 [default = FT_DEFAULT];
|
||||||
|
|
||||||
// Use long names for enums, i.e. EnumName_EnumValue.
|
// Use long names for enums, i.e. EnumName_EnumValue.
|
||||||
optional bool long_names = 4 [default = true];
|
optional bool long_names = 4 [default = true];
|
||||||
|
|
||||||
// Add 'packed' attribute to generated structs.
|
// Add 'packed' attribute to generated structs.
|
||||||
// Note: this cannot be used on CPUs that break on unaligned
|
// Note: this cannot be used on CPUs that break on unaligned
|
||||||
// accesses to variables.
|
// accesses to variables.
|
||||||
optional bool packed_struct = 5 [default = false];
|
optional bool packed_struct = 5 [default = false];
|
||||||
|
|
||||||
// Add 'packed' attribute to generated enums.
|
// Add 'packed' attribute to generated enums.
|
||||||
optional bool packed_enum = 10 [default = false];
|
optional bool packed_enum = 10 [default = false];
|
||||||
|
|
||||||
// Skip this message
|
// Skip this message
|
||||||
optional bool skip_message = 6 [default = false];
|
optional bool skip_message = 6 [default = false];
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ message NanoPBOptions {
|
||||||
|
|
||||||
// Proto3 singular field does not generate a "has_" flag
|
// Proto3 singular field does not generate a "has_" flag
|
||||||
optional bool proto3 = 12 [default = false];
|
optional bool proto3 = 12 [default = false];
|
||||||
|
|
||||||
// Force proto3 messages to have no "has_" flag.
|
// Force proto3 messages to have no "has_" flag.
|
||||||
// This was default behavior until nanopb-0.4.0.
|
// This was default behavior until nanopb-0.4.0.
|
||||||
optional bool proto3_singular_msgs = 21 [default = false];
|
optional bool proto3_singular_msgs = 21 [default = false];
|
||||||
|
@ -139,7 +140,7 @@ message NanoPBOptions {
|
||||||
|
|
||||||
// Package name that applies only for nanopb.
|
// Package name that applies only for nanopb.
|
||||||
optional string package = 25;
|
optional string package = 25;
|
||||||
|
|
||||||
// Override type of the field in generated C code. Only to be used with related field types
|
// Override type of the field in generated C code. Only to be used with related field types
|
||||||
optional google.protobuf.FieldDescriptorProto.Type type_override = 27;
|
optional google.protobuf.FieldDescriptorProto.Type type_override = 27;
|
||||||
|
|
||||||
|
@ -152,7 +153,7 @@ message NanoPBOptions {
|
||||||
// A field that can become a static member of a c struct (e.g. int, bool, etc)
|
// A field that can become a static member of a c struct (e.g. int, bool, etc)
|
||||||
// will be a a static field.
|
// will be a a static field.
|
||||||
// Fields with dynamic length are converted to either a pointer or a callback.
|
// Fields with dynamic length are converted to either a pointer or a callback.
|
||||||
optional FieldType fallback_type = 29 [default = FT_CALLBACK];
|
optional FieldType fallback_type = 29 [default = FT_CALLBACK];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extensions to protoc 'Descriptor' type in order to define options
|
// Extensions to protoc 'Descriptor' type in order to define options
|
||||||
|
@ -167,19 +168,17 @@ message NanoPBOptions {
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
||||||
extend google.protobuf.FileOptions {
|
extend google.protobuf.FileOptions {
|
||||||
optional NanoPBOptions nanopb_fileopt = 1010;
|
optional NanoPBOptions nanopb_fileopt = 1010;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend google.protobuf.MessageOptions {
|
extend google.protobuf.MessageOptions {
|
||||||
optional NanoPBOptions nanopb_msgopt = 1010;
|
optional NanoPBOptions nanopb_msgopt = 1010;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend google.protobuf.EnumOptions {
|
extend google.protobuf.EnumOptions {
|
||||||
optional NanoPBOptions nanopb_enumopt = 1010;
|
optional NanoPBOptions nanopb_enumopt = 1010;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend google.protobuf.FieldOptions {
|
extend google.protobuf.FieldOptions {
|
||||||
optional NanoPBOptions nanopb = 1010;
|
optional NanoPBOptions nanopb = 1010;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue