Skip to content

Commit

Permalink
cleanup & update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaw committed Mar 30, 2024
1 parent dea3a82 commit 2982d30
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 107 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
uses: actions/checkout@v4

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

- name: Push to schema registry
uses: bufbuild/buf-push-action@v1.1.1
uses: bufbuild/buf-push-action@v1.2.0
with:
buf_token: ${{ secrets.BUF_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
echo "NEW_VERSION=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_OUTPUT
- name: Create release
uses: ncipollo/release-action@v1.13.0
uses: ncipollo/release-action@v1
with:
name: Meshtastic Protobufs ${{ steps.version.outputs.NEW_VERSION }}
tag: ${{ steps.version.outputs.NEW_VERSION }}
generateReleaseNotes: true
token: ${{ github.token }}

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
uses: actions/checkout@v4

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

- name: Lint
uses: bufbuild/buf-lint-action@v1.0.3
uses: bufbuild/buf-lint-action@v1.1.1

- name: Push to schema registry
uses: bufbuild/buf-push-action@v1.1.1
uses: bufbuild/buf-push-action@v1.2.0
with:
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ github.ref_name != 'master'}}
8 changes: 0 additions & 8 deletions .trunk/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions .trunk/configs/.markdownlint.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions .trunk/configs/.yamllint.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions .trunk/trunk.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["trunk.io", "pbkit.vscode-pbkit", "bufbuild.vscode-buf"]
"recommendations": ["pbkit.vscode-pbkit", "bufbuild.vscode-buf"]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "trunk.io"
"editor.defaultFormatter": "pbkit.vscode-pbkit"
}
71 changes: 35 additions & 36 deletions nanopb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@
// for memory-limited environments.

syntax = "proto2";

import "google/protobuf/descriptor.proto";

option java_package = "fi.kapsi.koti.jpa.nanopb";

enum FieldType {
FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
FT_CALLBACK = 1; // Always generate a callback 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_IGNORE = 3; // Ignore the field completely.
FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead
FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
FT_CALLBACK = 1; // Always generate a callback 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_IGNORE = 3; // Ignore the field completely.
FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead
}

enum IntSize {
IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto
IS_8 = 8;
IS_16 = 16;
IS_32 = 32;
IS_64 = 64;
IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto
IS_8 = 8;
IS_16 = 16;
IS_32 = 32;
IS_64 = 64;
}

enum TypenameMangling {
M_NONE = 0; // Default, no typename mangling
M_STRIP_PACKAGE = 1; // Strip current package name
M_FLATTEN = 2; // Only use last path component
M_PACKAGE_INITIALS = 3; // Replace the package name by the initials
M_NONE = 0; // Default, no typename mangling
M_STRIP_PACKAGE = 1; // Strip current package name
M_FLATTEN = 2; // Only use last path component
M_PACKAGE_INITIALS = 3; // Replace the package name by the initials
}

enum DescriptorSize {
DS_AUTO = 0; // Select minimal size based on field type
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_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_AUTO = 0; // Select minimal size based on field type
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_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
}

// This is the inner options message, which basically defines options for
Expand All @@ -49,32 +50,32 @@ message NanoPBOptions {
// Allocated size for 'bytes' and 'string' fields.
// For string fields, this should include the space for null terminator.
optional int32 max_size = 1;

// Maximum length for 'string' fields. Setting this is equivalent
// to setting max_size to a value of length+1.
optional int32 max_length = 14;

// Allocated number of entries in arrays ('repeated' fields)
optional int32 max_count = 2;

// Size of integer fields. Can save some memory if you don't need
// full 32 bits for the value.
optional IntSize int_size = 7 [default = IS_DEFAULT];

// Force type of field (callback or static allocation)
optional FieldType type = 3 [default = FT_DEFAULT];

// Use long names for enums, i.e. EnumName_EnumValue.
optional bool long_names = 4 [default = true];

// Add 'packed' attribute to generated structs.
// Note: this cannot be used on CPUs that break on unaligned
// accesses to variables.
optional bool packed_struct = 5 [default = false];

// Add 'packed' attribute to generated enums.
optional bool packed_enum = 10 [default = false];

// Skip this message
optional bool skip_message = 6 [default = false];

Expand All @@ -89,7 +90,7 @@ message NanoPBOptions {

// Proto3 singular field does not generate a "has_" flag
optional bool proto3 = 12 [default = false];

// Force proto3 messages to have no "has_" flag.
// This was default behavior until nanopb-0.4.0.
optional bool proto3_singular_msgs = 21 [default = false];
Expand Down Expand Up @@ -139,7 +140,7 @@ message NanoPBOptions {

// Package name that applies only for nanopb.
optional string package = 25;

// 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;

Expand All @@ -152,7 +153,7 @@ message NanoPBOptions {
// A field that can become a static member of a c struct (e.g. int, bool, etc)
// will be a a static field.
// 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
Expand All @@ -167,19 +168,17 @@ message NanoPBOptions {
// --------------------------------

extend google.protobuf.FileOptions {
optional NanoPBOptions nanopb_fileopt = 1010;
optional NanoPBOptions nanopb_fileopt = 1010;
}

extend google.protobuf.MessageOptions {
optional NanoPBOptions nanopb_msgopt = 1010;
optional NanoPBOptions nanopb_msgopt = 1010;
}

extend google.protobuf.EnumOptions {
optional NanoPBOptions nanopb_enumopt = 1010;
optional NanoPBOptions nanopb_enumopt = 1010;
}

extend google.protobuf.FieldOptions {
optional NanoPBOptions nanopb = 1010;
optional NanoPBOptions nanopb = 1010;
}


0 comments on commit 2982d30

Please sign in to comment.