Skip to content

Commit f7643a9

Browse files
authored
Generate Go files (#6)
Generate Go files and add install instructions #5. Additionally, check for uncommitted changes in the pipeline first to view the output, even if there's an intentional breaking change.
1 parent d9e2c30 commit f7643a9

10 files changed

Lines changed: 508 additions & 16 deletions

File tree

.github/workflows/main.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v2
13-
- name: Setup buf
14-
uses: bufbuild/buf-setup-action@v1
15-
- name: Lint schema files
16-
uses: bufbuild/buf-lint-action@v1
17-
with:
18-
input: 'schema'
19-
- name: Check for breaking changes
20-
uses: bufbuild/buf-breaking-action@v1
21-
with:
22-
input: 'schema'
23-
against: 'https://github.com/gaming-platform/api.git#branch=main,subdir=schema'
2413
- name: Ensure no uncommitted changes
2514
run: |
2615
./project protoc
@@ -33,3 +22,14 @@ jobs:
3322
echo "$DIFF"
3423
exit 1
3524
fi
25+
- name: Setup buf
26+
uses: bufbuild/buf-setup-action@v1
27+
- name: Lint schema files
28+
uses: bufbuild/buf-lint-action@v1
29+
with:
30+
input: 'schema'
31+
- name: Check for breaking changes
32+
uses: bufbuild/buf-breaking-action@v1
33+
with:
34+
input: 'schema'
35+
against: 'https://github.com/gaming-platform/api.git#branch=main,subdir=schema'

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@ FROM ubuntu:22.04
22

33
WORKDIR /project
44

5+
ENV PATH="/usr/local/go/bin:${PATH}" \
6+
GOPATH="/usr/local/go"
7+
58
RUN apt-get update && \
69
apt-get upgrade --yes && \
710
apt-get install --yes curl unzip && \
811
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip && \
912
unzip protoc-25.1-linux-x86_64.zip -d /usr/local bin/protoc && \
1013
unzip protoc-25.1-linux-x86_64.zip -d /usr/local include/* && \
11-
rm protoc-25.1-linux-x86_64.zip
14+
rm protoc-25.1-linux-x86_64.zip && \
15+
curl -LO https://go.dev/dl/go1.25.4.linux-amd64.tar.gz && \
16+
tar -C /usr/local -xzf go1.25.4.linux-amd64.tar.gz && \
17+
rm -rf go1.25.4.linux-amd64.tar.gz && \
18+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.10
1219

1320
CMD protoc \
1421
--proto_path=schema/ \
1522
--php_out=php/ \
23+
--go_out=go/ \
1624
$(find schema -name '*.proto')

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ package with the following command.
1717
composer require gaming-platform/api
1818
```
1919

20+
### Go
21+
22+
Install the package with the following command.
23+
24+
```bash
25+
go get github.com/gaming-platform/api
26+
```
27+
2028
## Contributing
2129

2230
You can find the schema definitions in the [/schema](/schema) directory.

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/gaming-platform/api
2+
3+
go 1.25.4
4+
5+
require google.golang.org/protobuf v1.36.10

go/chat/v1/messaging.pb.go

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

0 commit comments

Comments
 (0)