Skip to content

Commit f86f39c

Browse files
authored
Merge branch 'master' into develop_issues
2 parents df8123a + e701105 commit f86f39c

40 files changed

+7071
-911
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: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,75 @@
11
# ChangeLog
22

3-
## [1.0.8] - 2024-10-24
3+
## [1.1.2] - 2024-12-08
44

55
### Added
66
- ServerParams.pitch_margin
7+
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
78

89
### Fixed
910
-
1011

1112
### Changed
1213
-
1314

14-
### Engineers
15+
### Developers
1516
- [SoroushMazloum](https://github.com/SoroushMazloum)
1617

1718
=======
1819

19-
## [1.0.7] - 2024-10-22
20+
## [1.1.1] - 2024-12-01
2021

2122
### Added
22-
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
23+
24+
- added Neck_OffensiveInterceptNeck into idls
25+
- added HeliosBasicTackle into idls
26+
- added start-debug-agent.sh file
2327

2428
### Fixed
29+
30+
- bug fixed in start-agent.sh
31+
32+
### Changed
33+
2534
-
2635

36+
### Developers
37+
38+
- [NaderZare](https://github.com/naderzare)
39+
40+
=======
41+
42+
## [1.1.0] - 2024-11-17
43+
44+
### Added
45+
-
46+
47+
### Fixed
48+
-
49+
2750
### Changed
51+
- 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.
52+
53+
### Developers
54+
- [NaderZare](https://github.com/naderzare)
55+
- [Sadra Khanjari](https://github.com/sk2ip)
56+
57+
=======
58+
59+
## [1.0.7] - 2024-11-11
60+
61+
### Added
2862
-
2963

30-
### Engineers
31-
- [SoroushMazloum](https://github.com/SoroushMazloum)
64+
### Fixed
65+
- Performance improvement
66+
- Fixed bugs in the server side planner
67+
68+
### Changed
69+
-
70+
71+
### Developers
72+
- [NaderZare](https://github.com/naderzare)
3273

3374
=======
3475

@@ -43,7 +84,7 @@
4384
### Changed
4485
-
4586

46-
### Engineers
87+
### Developers
4788
- [ErfanFathi](https://github.com/ErfanFathii)
4889

4990
=======
@@ -59,7 +100,7 @@
59100
### Changed
60101
-
61102

62-
### Engineers
103+
### Developers
63104
- [NaderZare](https://github.com/naderzare)
64105
- [SadraKhanjari](https://github.com/SK2iP)
65106
- [SoroushMazloum](https://github.com/SoroushMazloum)
@@ -77,12 +118,9 @@
77118
### Changed
78119
-
79120

80-
### Engineers
81-
- [NaderZare](https://github.com/naderzare)
82-
- [SadraKhanjari](https://github.com/SK2iP)
121+
### Developers
83122
- [SoroushMazloum](https://github.com/SoroushMazloum)
84123

85-
=======
86124

87125
## [1.0.3] - 2024-10-7
88126

@@ -95,12 +133,10 @@
95133
### Changed
96134
-
97135

98-
### Engineers
99-
- [NaderZare](https://github.com/naderzare)
136+
### Developers
100137
- [SadraKhanjari](https://github.com/SK2iP)
101138
- [SoroushMazloum](https://github.com/SoroushMazloum)
102139

103-
=======
104140

105141
## [1.0.2] - 2024-09-15
106142

@@ -114,34 +150,27 @@
114150
### Changed
115151
-
116152

117-
### Engineers
153+
### Developers
118154
- [NaderZare](https://github.com/naderzare)
119155
- [SadraKhanjari](https://github.com/SK2iP)
120156

121-
# ChangeLog
122-
123-
=======
124157
## [1.0.1] - 2024-09-15
125158

126159
### Added
127160
- catch_time has been added to the proxy in the self message.
128161
- kickable_opponent_existance and kickable_teammate_existance has been added to the proxy in the worldmodel message.
129162
- bhv_doforceKick action has been added as a message and to the actions message.
130-
=======
131163

132164
### Fixed
133165
-
134166

135167
### Changed
136168
-
137169

138-
### Engineers
170+
### Developers
139171
- [SoroushMazloum](https://github.com/SoroushMazloum)
140172
- [SadraKhanjari](https://github.com/SK2iP)
141173

142-
=======
143-
144-
145174
## [1.0.0] - 2024-09-15
146175

147176
### Added
@@ -155,7 +184,7 @@
155184
### Changed
156185
- changed chain_action messages name to planner
157186

158-
### Engineers
187+
### Developers
159188
- [NaderZare](https://github.com/naderzare)
160189
- [SadraKhanjari](https://github.com/SK2iP)
161190

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)