-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from kzys/protoc-upgrade
Don't support github.com/golang/protobuf/[email protected]
- Loading branch information
Showing
8 changed files
with
15 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,55 +54,6 @@ jobs: | |
run: | | ||
go test | ||
v1: | ||
name: Run with protoc-gen-go v1.3.5 | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.16.x | ||
id: go | ||
|
||
- name: Setup environment | ||
shell: bash | ||
run: | | ||
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV | ||
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: src/github.com/containerd/protobuild | ||
|
||
- name: Build | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
go build . | ||
- name: Install protoc | ||
run: | | ||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip | ||
sudo unzip -x protoc-3.5.0-linux-x86_64.zip -d /usr/local | ||
sudo chmod -R go+rX /usr/local/include | ||
sudo chmod go+x /usr/local/bin/protoc | ||
# Both google.golang.org/protobuf/cmd/protoc-gen-go and github.com/golang/protobuf/protoc-gen-go > 1.4.0 don't | ||
# support import_path. So this step has to use 1.3.x here. | ||
- name: Install protoc-gen-go | ||
run: | | ||
go install github.com/golang/protobuf/[email protected] | ||
- name: Run protobuild to see all committed auto-generated files can be generated as is | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
rm examples/foo/*.pb.* examples/bar/*.pb.* examples/nogrpc/*.pb.* | ||
export PATH=$(go env GOBIN):$PATH | ||
./protobuild github.com/containerd/protobuild/examples/bar github.com/containerd/protobuild/examples/foo github.com/containerd/protobuild/examples/nogrpc | ||
git diff --exit-code | ||
v2: | ||
name: Run with protoc-gen-go v1.26 | ||
runs-on: ubuntu-22.04 | ||
|
@@ -148,5 +99,5 @@ jobs: | |
run: | | ||
rm examples/v2/*.pb.* | ||
export PATH=$(go env GOBIN):$PATH | ||
./protobuild -f v2.toml github.com/containerd/protobuild/examples/v2 | ||
./protobuild github.com/containerd/protobuild/examples/v2 | ||
git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,138 +1,10 @@ | ||
version = "unstable" | ||
version = "2" | ||
|
||
# Generator defines which generator to go. The default is "go". This will be | ||
# formatted into the --xxx_out flag provided to protoc. Below, we have an | ||
# example that selects the ctrd vanity binary. | ||
# generator = "go" | ||
generators = ["go", "go-grpc"] | ||
|
||
# Plugins allows one to specify one or more plugins for use in generation. | ||
# | ||
# The common example grpc is provided below. | ||
plugins = ["grpc"] | ||
|
||
# Control protoc include paths. Below are usually some good defaults, but feel | ||
# free to try it without them if it works for your project. | ||
[includes] | ||
# Include paths that will be added before all others. Typically, you want to | ||
# treat the root of the project as an include, but this may not be necessary. | ||
# | ||
# "." is included by default | ||
# before = ["."] | ||
|
||
# Paths that should be treated as include roots in relation to the vendor | ||
# directory. These will be calculated with the vendor directory nearest the | ||
# target package. | ||
# | ||
# This should be used only in cases where imports must be resolved from the | ||
# vendor package and not a GOPATH package. Most users should employ the | ||
# `packages` configuration and let protobuild resolve the existing package. | ||
# | ||
# With the example below, we import github.com/golang/protobuf from the vendor | ||
# directory. | ||
# | ||
# This is empty by default. | ||
# vendored = ["github.com/golang/protobuf"] | ||
|
||
# Packages will add imports that are relative to the vendor path or GOPATH. | ||
# | ||
# If in doubt, use this over `vendored` configuration for your project. | ||
# | ||
# This is empty by default. | ||
# packages = ["github.com/golang/protobuf"] | ||
|
||
# Paths that will be added untouched to the end of the includes. We use | ||
# a few paths to pickup the common install locations for protobuf. | ||
# This is the default. | ||
# after = ["usr/local/include", "/usr/include"] | ||
|
||
# This section let's us map protobuf imports to Go packages. These will become | ||
# `-M` directives in the call to the go protobuf generator. | ||
# | ||
# We have a few examples to map packages from the examples. | ||
[packages] | ||
"google/protobuf/empty.proto" = "github.com/containerd/protobuild/internal" | ||
|
||
# Overrides allows one to specify configuration overrides for specific | ||
# packages. Currently, only overriding the generator and plugin set are | ||
# supported. | ||
# | ||
# This can be used to use a different plugin set for a given package. | ||
[[overrides]] | ||
|
||
# Prefix specifies the protobuf import path to which the configuration | ||
# overrides apply. | ||
# | ||
# This works the same as the descriptors selection prefix except that each path | ||
# that is overridden must be specified, rather than applying to the whole tree. | ||
# | ||
# For this example, if there were a package that needed this overrides applied, | ||
# you would need to specify that explicitly in the prefixes list. This allows | ||
# one to granularly select which packages have the overrides. | ||
prefixes = ["github.com/containerd/protobuild/examples/nogrpc"] | ||
"google/protobuf/empty.proto" = "github.com/containerd/protobuild/internal" | ||
|
||
# Generator allows one to override the generator for the given prefix. | ||
# generator = "" | ||
|
||
# Plugins will override the entire plugin set for the specified prefix. | ||
plugins = [] | ||
|
||
# Descriptors allows you to aggregate generated protobuf descriptors under a | ||
# particular Go import path into a single, de-duplicated file. The result of | ||
# configuring this option for one or more paths will be a text format protobuf | ||
# dump of all the descriptors in the API. | ||
# | ||
# While this is useful for other applications that require access to | ||
# descriptors, the goal of this features is to provide visibility into changes | ||
# that may affect API stability. Each service, message and field will be | ||
# included in the file, along with dependencies. If a change occurs that | ||
# impacts API stability, it will be obvious in a diff with a file from the | ||
# previous version. | ||
# | ||
# Save these descriptors in your repository. When the next round of protobuf | ||
# changes are built and merged, additions and incompatible changes can be | ||
# detected by diffing these files. When you release, move this file to the | ||
# release version to keep track of the exports over time from various releases. | ||
# | ||
# This takes inspiration from Go's API checker in | ||
# https://github.com/golang/go/tree/master/api, but does so for protobufs. | ||
# Stablize packages and collections of packages of generated protobufs. | ||
[[descriptors]] | ||
|
||
# Prefix specifies the protobuf import prefix relative to items that you want | ||
# to stabilize. | ||
# | ||
# For example, if the files are imported as | ||
# github.com/containerd/protobuild/examples/foo/foo.proto, and you want to | ||
# stabilize everything in package "foo", it should be | ||
# "github.com/containerd/protobuild/example/foo". | ||
# | ||
# The example below stablizes the protobufs under the examples directory. The | ||
# generated descriptor file will include both the "foo" and "bar" subpackages. | ||
prefix = "github.com/containerd/protobuild/examples" | ||
|
||
# Target defines the output location of the merged descriptor file. | ||
target = "examples/next.pb.txt" | ||
|
||
# Ignore files by their protobuf import path. | ||
# | ||
# This operates directly on the FileDescriptorProto.Name field, so it will | ||
# filter out imported protobufs. This allows one to remove descriptors from the | ||
# result that don't impact API stability, such as generation extension | ||
# directives. | ||
# | ||
# The example below will exclude empty.proto. Experiment with this feature by | ||
# uncommenting the line below and notice that the description of that file will | ||
# be removed. | ||
# ignore_files = ["google/protobuf/empty.proto"] | ||
|
||
# TODO(stevvooe): Possibly automate build rejection under certain classes of | ||
# changes. Left alone now until we get a solid idea about the noise present in | ||
# this process. | ||
# | ||
|
||
# Remember that you can have multiple aggregation points for descriptors. Here, | ||
# we aggregate the descriptors for examples/foo, in addition to the above. | ||
# Uncomment these lines to try it out! | ||
# [[descriptors]] | ||
# target = "examples/foo/descriptors.pb.txt" | ||
# prefix = "github.com/containerd/protobuild/examples/foo" | ||
prefix = "github.com/containerd/protobuild/examples/v2" | ||
target = "examples/v2/next.pb.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.