File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 - name : Setup environment
4242 shell : bash
4343 run : |
44- echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
4544 echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
4645
4746 - name : Check out code
6968 - name : Setup environment
7069 shell : bash
7170 run : |
72- echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
7371 echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
7472
7573 - name : Check out code
@@ -118,7 +116,6 @@ jobs:
118116 - name : Setup environment
119117 shell : bash
120118 run : |
121- echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
122119 echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
123120
124121 - name : Check out code
Original file line number Diff line number Diff line change @@ -136,3 +136,6 @@ target = "examples/next.pb.txt"
136136# [[descriptors]]
137137# target = "examples/foo/descriptors.pb.txt"
138138# prefix = "github.com/containerd/protobuild/examples/foo"
139+
140+ [parameters .go ]
141+ paths = " source_relative"
Original file line number Diff line number Diff line change @@ -194,11 +194,11 @@ func main() {
194194 includes = append (includes , gopathJoin (gopath , pkg ))
195195 }
196196
197- includes = append (includes , gopath )
197+ includes = append (includes , pkg . Dir )
198198 includes = append (includes , c .Includes .After ... )
199199
200200 protoc := protocCmd {
201- Generators : generators (c .Generators , outputDir ),
201+ Generators : generators (c .Generators , pkg . Dir ),
202202 Files : pkg .ProtoFiles ,
203203 OutputDir : outputDir ,
204204 Includes : includes ,
@@ -246,7 +246,7 @@ func main() {
246246 }
247247
248248 var (
249- genDescriptors = shouldGenerateDescriptors (importDirPath )
249+ genDescriptors = shouldGenerateDescriptors (pkg . GoImportPath )
250250 dfp * os.File // tempfile for descriptors
251251 )
252252
@@ -291,7 +291,7 @@ func main() {
291291 }
292292
293293 for path , set := range descriptorSets {
294- if strings .HasPrefix (importDirPath , path ) {
294+ if strings .HasPrefix (pkg . GoImportPath , path ) {
295295 set .add (desc .File ... )
296296 }
297297 }
Original file line number Diff line number Diff line change @@ -8,3 +8,8 @@ generators = ["go", "go-grpc"]
88[[descriptors ]]
99prefix = " github.com/containerd/protobuild/examples/v2"
1010target = " examples/v2/next.pb.txt"
11+
12+ # The default mode is paths=import which makes a directory that mirrors its Go import path.
13+ # https://protobuf.dev/reference/go/go-generated/
14+ [parameters .go ]
15+ paths = " source_relative"
You can’t perform that action at this time.
0 commit comments