Skip to content

Commit b6da520

Browse files
authored
Merge branch 'master' into develop_issues
2 parents 06fecd4 + edcb330 commit b6da520

40 files changed

+7082
-922
lines changed

.github/workflows/generator.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Generate Protobuf Documentation
2+
3+
# Define a manual trigger with input for version
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# Step 1: Checkout the repository code
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
# Step 1.1: Check Version Number
19+
- name: Check Version Number
20+
run: |
21+
pwd
22+
PROTO_VERSION=$(grep -oP '(?<=version\s)[0-9]+\.[0-9]+' ./idl/grpc/service.proto)
23+
THRIFT_VERSION=$(grep -oP '(?<=version\s)[0-9]+\.[0-9]+' ./idl/thrift/soccer_service.thrift)
24+
if [ "$PROTO_VERSION" != "$THRIFT_VERSION" ]; then
25+
echo "Version mismatch: Protobuf version is $PROTO_VERSION, Thrift version is $THRIFT_VERSION"
26+
exit 1
27+
fi
28+
29+
# Step 2: Install dependencies for protoc
30+
- name: Install protoc dependencies
31+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler wget
32+
33+
# Step 3: Download precompiled protoc-gen-doc binary
34+
- name: Download protoc-gen-doc binary
35+
run: |
36+
# Download the appropriate precompiled binary for Linux
37+
wget https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz -O protoc-gen-doc.tar.gz
38+
39+
# Extract the binary from the tarball
40+
tar -xvf protoc-gen-doc.tar.gz
41+
42+
# Ensure it's an executable binary
43+
file protoc-gen-doc
44+
45+
# Make it executable
46+
chmod +x protoc-gen-doc
47+
48+
# Move the binary to /usr/local/bin
49+
sudo mv protoc-gen-doc /usr/local/bin/
50+
51+
# Step 4: Generate Markdown from the Protobuf file
52+
- name: Generate Protobuf Documentation
53+
run: |
54+
# Generate markdown from .proto file
55+
protoc --doc_out=./idl --doc_opt=markdown,readme.md ./idl/grpc/service.proto
56+
57+
# Step 5: Extract version from the first line of the .proto file
58+
- name: Extract version from .proto file
59+
id: extract_version
60+
run: |
61+
VERSION=$(grep -oP '(?<=version\s)[0-9]+\.[0-9]+' ./idl/grpc/service.proto)
62+
echo "VERSION=$VERSION" >> $GITHUB_ENV
63+
64+
# Step 6: Insert version into the generated Markdown file
65+
- name: Insert version into markdown
66+
run: |
67+
sed -i '3a\\n## Version: '"${{ env.VERSION }}"'\n' ./idl/readme.md
68+
69+
# Step 7: Replace &gt; and &lt; in Mermaid diagrams with > and <
70+
- name: Fix Mermaid symbols in readme.md
71+
run: |
72+
sed -i 's/&gt;/>/g' ./idl/readme.md
73+
sed -i 's/&lt;/</g' ./idl/readme.md
74+
75+
# Step 8: Configure Git and commit the updated readme.md
76+
- name: Configure Git
77+
run: |
78+
git config --global user.name "GitHub Action"
79+
git config --global user.email "[email protected]"
80+
81+
# Step 10: Stage and Commit Changes
82+
- name: Stage and Commit Changes
83+
run: |
84+
ls ./idl
85+
git status
86+
git add ./idl/readme.md # Ensure the correct file is added
87+
git diff --quiet || git commit -m "Update protobuf documentation with version and fixed Mermaid symbols" || echo "No changes to commit"
88+
89+
# Step 11: Push the changes
90+
- name: Push Changes
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
run: git push
94+
95+
# Step 12: Clone the website repository and push the updated protobuf.md
96+
- name: Generate random number for branch name
97+
id: random
98+
run: echo "::set-output name=random_number::$(shuf -i 1000-9999 -n 1)"
99+
- name: Clone the CLSFramework.github.io repository
100+
run: |
101+
git clone https://github.com/CLSFramework/CLSFramework.github.io.git cls-repo
102+
cd cls-repo
103+
104+
# Copy updated README to target directory in the CLSFramework.github.io repository
105+
cp ../idl/readme.md docs/3-idl/protobuf.md
106+
107+
# Create a new branch with a random number appended
108+
git checkout -b update-proto-doc-${{ steps.random.outputs.random_number }}
109+
- name: Set up authentication using PAT for CLSFramework.github.io
110+
run: |
111+
cd cls-repo
112+
git remote set-url origin https://x-access-token:${{ secrets.WEBSITE_TOKEN }}@github.com/CLSFramework/CLSFramework.github.io.git
113+
- name: Commit and Push Changes to CLSFramework.github.io
114+
run: |
115+
cd cls-repo
116+
if git diff | grep 'protobuf.md'; then
117+
echo "protobuf.md has changed"
118+
else
119+
echo "protobuf.md has not changed" && exit 0
120+
fi
121+
git add docs/3-idl/protobuf.md
122+
git commit -m "Update proto documentation"
123+
git push origin update-proto-doc-${{ steps.random.outputs.random_number }}
124+
- name: Create Pull Request in CLSFramework.github.io using GitHub API
125+
run: |
126+
PR_RESPONSE=$(curl -X POST -H "Authorization: token ${{ secrets.WEBSITE_TOKEN }}" \
127+
-H "Accept: application/vnd.github.v3+json" \
128+
https://api.github.com/repos/CLSFramework/CLSFramework.github.io/pulls \
129+
-d '{"title":"Update proto documentation","head":"update-proto-doc-${{ steps.random.outputs.random_number }}","base":"main","body":"This PR updates the proto documentation based on changes made in grpc file."}')
130+
echo "Pull request created: $PR_RESPONSE"
131+

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,15 @@ grpc/python-v1/src/__pycache__/
3737
.idea/
3838
cmake-build-debug-event-trace/
3939
__pycache__/
40-
grpc/python-v1/src/__pycache__/
40+
grpc/python-v1/src/__pycache__/
41+
42+
src/grpc-generated/service.grpc.pb.cc
43+
src/grpc-generated/service.grpc.pb.h
44+
src/grpc-generated/service.pb.cc
45+
src/grpc-generated/service.pb.h
46+
src/thrift-generated/Game_server.skeleton.cpp
47+
src/thrift-generated/Game.cpp
48+
src/thrift-generated/Game.h
49+
src/thrift-generated/soccer_service_types.cpp
50+
src/thrift-generated/soccer_service_types.h
51+
idl/test.md

ChangeLog.md

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# ChangeLog
22

3-
## [1.0.9] - 2024-11-9
3+
## [1.1.2] - 2024-12-08
44

55
### Added
6+
- ServerParams.pitch_margin
7+
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
68
- bhv_goalieFreeKick added
79

810
### Fixed
@@ -11,38 +13,64 @@
1113
### Changed
1214
-
1315

14-
### Engineers
16+
### Developers
1517
- [SoroushMazloum](https://github.com/SoroushMazloum)
1618

17-
## [1.0.8] - 2024-10-24
19+
=======
20+
21+
## [1.1.1] - 2024-12-01
1822

1923
### Added
20-
- ServerParams.pitch_margin
24+
25+
- added Neck_OffensiveInterceptNeck into idls
26+
- added HeliosBasicTackle into idls
27+
- added start-debug-agent.sh file
2128

2229
### Fixed
23-
-
30+
31+
- bug fixed in start-agent.sh
2432

2533
### Changed
34+
35+
-
36+
37+
### Developers
38+
39+
- [NaderZare](https://github.com/naderzare)
40+
41+
=======
42+
43+
## [1.1.0] - 2024-11-17
44+
45+
### Added
2646
-
2747

28-
### Engineers
29-
- [SoroushMazloum](https://github.com/SoroushMazloum)
48+
### Fixed
49+
-
3050

51+
### Changed
52+
- If the server sends some main actions to the proxy like doForceKick, dash, smartkick, etc, the proxy will just run the first action and ignore the rest of the main actions.
53+
54+
### Developers
55+
- [NaderZare](https://github.com/naderzare)
56+
- [Sadra Khanjari](https://github.com/sk2ip)
57+
3158
=======
3259

33-
## [1.0.7] - 2024-10-22
60+
## [1.0.7] - 2024-11-11
3461

3562
### Added
36-
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
63+
-
3764

3865
### Fixed
39-
-
66+
- Performance improvement
67+
- Fixed bugs in the server side planner
4068

4169
### Changed
4270
-
4371

44-
### Engineers
45-
- [SoroushMazloum](https://github.com/SoroushMazloum)
72+
### Developers
73+
- [NaderZare](https://github.com/naderzare)
4674

4775
=======
4876

@@ -57,7 +85,7 @@
5785
### Changed
5886
-
5987

60-
### Engineers
88+
### Developers
6189
- [ErfanFathi](https://github.com/ErfanFathii)
6290

6391
=======
@@ -73,7 +101,7 @@
73101
### Changed
74102
-
75103

76-
### Engineers
104+
### Developers
77105
- [NaderZare](https://github.com/naderzare)
78106
- [SadraKhanjari](https://github.com/SK2iP)
79107
- [SoroushMazloum](https://github.com/SoroushMazloum)
@@ -91,12 +119,9 @@
91119
### Changed
92120
-
93121

94-
### Engineers
95-
- [NaderZare](https://github.com/naderzare)
96-
- [SadraKhanjari](https://github.com/SK2iP)
122+
### Developers
97123
- [SoroushMazloum](https://github.com/SoroushMazloum)
98124

99-
=======
100125

101126
## [1.0.3] - 2024-10-7
102127

@@ -109,12 +134,10 @@
109134
### Changed
110135
-
111136

112-
### Engineers
113-
- [NaderZare](https://github.com/naderzare)
137+
### Developers
114138
- [SadraKhanjari](https://github.com/SK2iP)
115139
- [SoroushMazloum](https://github.com/SoroushMazloum)
116140

117-
=======
118141

119142
## [1.0.2] - 2024-09-15
120143

@@ -128,34 +151,27 @@
128151
### Changed
129152
-
130153

131-
### Engineers
154+
### Developers
132155
- [NaderZare](https://github.com/naderzare)
133156
- [SadraKhanjari](https://github.com/SK2iP)
134157

135-
# ChangeLog
136-
137-
=======
138158
## [1.0.1] - 2024-09-15
139159

140160
### Added
141161
- catch_time has been added to the proxy in the self message.
142162
- kickable_opponent_existance and kickable_teammate_existance has been added to the proxy in the worldmodel message.
143163
- bhv_doforceKick action has been added as a message and to the actions message.
144-
=======
145164

146165
### Fixed
147166
-
148167

149168
### Changed
150169
-
151170

152-
### Engineers
171+
### Developers
153172
- [SoroushMazloum](https://github.com/SoroushMazloum)
154173
- [SadraKhanjari](https://github.com/SK2iP)
155174

156-
=======
157-
158-
159175
## [1.0.0] - 2024-09-15
160176

161177
### Added
@@ -169,7 +185,7 @@
169185
### Changed
170186
- changed chain_action messages name to planner
171187

172-
### Engineers
188+
### Developers
173189
- [NaderZare](https://github.com/naderzare)
174190
- [SadraKhanjari](https://github.com/SK2iP)
175191

idl/generate-local-md.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# sudo apt-get update && sudo apt-get install -y protobuf-compiler wget
4+
5+
# # Download the appropriate precompiled binary for Linux
6+
# wget https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz -O protoc-gen-doc.tar.gz
7+
8+
# # Extract the binary from the tarball
9+
# tar -xvf protoc-gen-doc.tar.gz
10+
11+
# # Ensure it's an executable binary
12+
# file protoc-gen-doc
13+
14+
# # Make it executable
15+
# chmod +x protoc-gen-doc
16+
17+
# # Move the binary to /usr/local/bin
18+
# sudo mv protoc-gen-doc /usr/local/bin/
19+
20+
protoc --doc_out=./ --doc_opt=markdown,test.md ./grpc/service.proto
21+
22+
VERSION=$(grep -oP '(?<=version\s)[0-9]+\.[0-9]+' ./grpc/service.proto)
23+
echo "VERSION=$VERSION"
24+
25+
sed -i '3a\\n## Version: '"$VERSION"'\n' ./test.md
26+
27+
sed -i 's/&gt;/>/g' ./test.md
28+
sed -i 's/&lt;/</g' ./test.md

0 commit comments

Comments
 (0)