Skip to content

Commit 049540a

Browse files
authored
ci: fix update protobuf workflow (#357)
1 parent b36a88a commit 049540a

15 files changed

+26
-52
lines changed

.github/workflows/protobuf.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,12 @@ jobs:
3737
wget -O /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.12.2/protoc-3.12.2-linux-x86_64.zip
3838
unzip /tmp/protoc.zip -d /tmp/protoc
3939
40-
GO111MODULE=off go get -u github.com/gogo/protobuf/protoc-gen-gogofaster
40+
go install google.golang.org/protobuf/cmd/protoc-gen-[email protected]
4141
4242
- name: Generate Go code
4343
if: env.PROTOBUFS_CHANGED == 'true'
4444
run: |
4545
cd pkg/demoinfocs/msg
46-
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/cstrike15_usermessages.proto
47-
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/cstrike15_gcmessages.proto
48-
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/engine_gcmessages.proto
49-
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/netmessages.proto
50-
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/steammessages.proto
5146
5247
export PATH=/tmp/protoc/bin:$PATH
5348
./generate.sh

pkg/demoinfocs/msg/cstrike15_gcmessages.pb.go

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/demoinfocs/msg/cstrike15_usermessages.pb.go

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/demoinfocs/msg/engine_gcmessages.pb.go

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/demoinfocs/msg/generate.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkg/demoinfocs/msg/generate.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3-
protoc --go_out=. \
3+
protoc --proto_path=proto \
4+
--go_out=. \
5+
--go_opt=Mcstrike15_usermessages.proto=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
6+
--go_opt=Mcstrike15_gcmessages.proto=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
7+
--go_opt=Mengine_gcmessages.proto=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
8+
--go_opt=Mnetmessages.proto=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
9+
--go_opt=Msteammessages.proto=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
410
--go_opt=module=github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg \
5-
-I=./proto ./proto/*.proto
11+
cstrike15_gcmessages.proto cstrike15_usermessages.proto engine_gcmessages.proto netmessages.proto steammessages.proto

pkg/demoinfocs/msg/msg.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build !windows
2-
// +build !windows
3-
41
package msg
52

63
//go:generate ./generate.sh

pkg/demoinfocs/msg/msg_windows.go

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

pkg/demoinfocs/msg/netmessages.pb.go

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/demoinfocs/msg/proto/cstrike15_gcmessages.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";
1+
22

33
import "steammessages.proto";
44
import "engine_gcmessages.proto";

0 commit comments

Comments
 (0)