Skip to content

Commit b406936

Browse files
kzysclaude
andcommitted
Migrate from protobuild to buf
Like containerd did recently, we can migrate from protobuild to buf. containerd/containerd#12762 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 076b5e0 commit b406936

7 files changed

Lines changed: 657 additions & 695 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,14 @@ jobs:
193193
go-version: '1.22.x'
194194
cache-dependency-path: src/github.com/containerd/cgroups
195195

196-
- name: Set env
197-
shell: bash
198-
run: |
199-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
200-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
196+
- name: Install buf
197+
uses: bufbuild/buf-setup-action@v1
201198

202-
- name: Install protoc
203-
run: |
204-
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip
205-
# /usr/local is not writable from GitHub Actions' user
206-
sudo unzip protoc-21.5-linux-x86_64.zip -d /usr/local
199+
- name: Install protoc-gen-go
200+
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
207201

208-
- name: Install proto-related tools for Go
209-
run: |
210-
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
211-
go install github.com/containerd/protobuild@v0.3.0
212-
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
202+
- name: Install go-fix-acronym
203+
run: go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
213204

214205
- name: Compare auto-generated Go files
215206
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ cgutil:
2424
cd cmd/cgctl && $(GO) build $(GO_BUILD_FLAGS) -v $(GO_TAGS)
2525

2626
proto:
27-
protobuild --quiet ${PACKAGES}
27+
buf generate
2828
# Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
2929
go-fix-acronym -w -a '(Cpu|Tcp|Rss|Psi)' $(shell find cgroup1/stats/ cgroup2/stats/ -name '*.pb.go')

Protobuild.toml

Lines changed: 0 additions & 31 deletions
This file was deleted.

buf.gen.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: v2
2+
plugins:
3+
- local: protoc-gen-go
4+
out: .
5+
opt: paths=source_relative

buf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version: v2

0 commit comments

Comments
 (0)