-
-
Notifications
You must be signed in to change notification settings - Fork 22
181 lines (151 loc) · 6.2 KB
/
upload_COS.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: "upload_COS"
###############################################################################
# This ci packages the repository files and uploads them to
# the Tencent cloud storage bucket
###############################################################################
on:
push:
branches: [ main ]
jobs:
client_build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.402
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9.2'
architecture: 'x64'
- name: Pip Install paramiko
run: pip install paramiko
- name: Publish
run: |
mkdir -p THUAI6/win/win64
mkdir -p THUAI6/win/win64/Debug
mkdir -p THUAI6/linux/linux64
mkdir -p THUAI6/linux/linux64/Debug
mkdir -p ./THUAI6/osx/osx64/Debug
dotnet publish "./logic/Server/Server.csproj" -c Release -r win-x64 -o ./THUAI6/win/win64 --self-contained true
dotnet publish "./logic/Server/Server.csproj" -c Debug -r win-x64 -o ./THUAI6/win/win64/Debug --self-contained true
dotnet publish "./logic/Server/Server.csproj" -c Release -r linux-x64 -o ./THUAI6/linux/linux64 --self-contained true
dotnet publish "./logic/Server/Server.csproj" -c Debug -r linux-x64 -o ./THUAI6/linux/linux64/Debug --self-contained true
dotnet publish "./logic/Server/Server.csproj" -c Release -r osx-x64 -o ./THUAI6/osx/osx64 --self-contained true
dotnet publish "./logic/Server/Server.csproj" -c Debug -r osx-x64 -o ./THUAI6/osx/osx64/Debug --self-contained true
dotnet publish "./logic/Client/Client.csproj" -c Release -r win-x64 -o ./THUAI6/win/win64 --self-contained true
rm ./THUAI6/linux/linux64/*.pdb
rm ./THUAI6/linux/linux64/Debug/*.pdb
rm ./THUAI6/win/win64/*.pdb
rm ./THUAI6/win/win64/Debug/*.pdb
rm ./THUAI6/osx/osx64/*.pdb
rm ./THUAI6/osx/osx64/Debug/*.pdb
- name: Copy CAPI
run: |
mkdir -p THUAI6/win/CAPI/proto
mkdir -p THUAI6/win/CAPI/cpp
mkdir -p THUAI6/win/CAPI/python
cp ./dependency/proto/Message2Clients.proto ./THUAI6/win/CAPI/proto/
cp ./dependency/proto/Message2Server.proto ./THUAI6/win/CAPI/proto/
cp ./dependency/proto/Services.proto ./THUAI6/win/CAPI/proto/
cp ./dependency/proto/MessageType.proto ./THUAI6/win/CAPI/proto/
cp ./dependency/proto/cpp_output.sh ./THUAI6/win/CAPI/proto/
cp -r ./CAPI/cpp/API ./THUAI6/win/CAPI/cpp
cp -r ./CAPI/cpp/grpc ./THUAI6/win/CAPI/cpp
cp -r ./CAPI/cpp/spdlog ./THUAI6/win/CAPI/cpp
cp -r ./CAPI/cpp/tclap ./THUAI6/win/CAPI/cpp
cp -r ./CAPI/cpp/proto ./THUAI6/win/CAPI/cpp
cp ./CAPI/cpp/CAPI.sln ./THUAI6/win/CAPI/cpp
cp ./CAPI/cpp/CMakeLists.txt ./THUAI6/win/CAPI/cpp
cp -r ./CAPI/python/PyAPI ./THUAI6/win/CAPI/python
cp ./CAPI/python/requirements.txt ./THUAI6/win/CAPI/python
cp -r ./THUAI6/win/CAPI ./THUAI6/linux/
cp -r ./THUAI6/win/CAPI ./THUAI6/osx/
cp -r ./logic/cmd/map ./THUAI6/win/
cp -r ./logic/cmd/map ./THUAI6/linux/
cp -r ./logic/cmd/map ./THUAI6/osx/
- name: Copy shell
run: |
cp -r ./CAPI/cmd/* ./THUAI6/win/
cp -r ./CAPI/shell/* ./THUAI6/linux/
cp -r ./CAPI/shell/* ./THUAI6/osx/
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: ./THUAI6
build_upload:
needs: client_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Pip Install paramiko
run: pip install paramiko
- uses: actions/download-artifact@v4
with:
name: my-artifact
path: ./THUAI6
- name: Remove ReadMe.md
run: rm ./docs/README.md
- name: Markdown to PDF and HTML
uses: BaileyJM02/[email protected]
with:
input_dir: ./docs
output_dir: ./THUAI6/
images_dir: ./resource
image_import: ./images
build_html: false
- name: Hash Files
run: |
python ./dependency/py/HashFiles.py -t ./THUAI6
- name: Upload COS
uses: zkqiang/[email protected]
with:
args: upload -r ./THUAI6/hash.json /
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
bucket: ${{ secrets.COS_BUCKET }}
region: ${{ secrets.COS_REGION }}
- name: Remove Files
run: |
rm ./THUAI6/hash.json
rm ./THUAI6/win/win64/PresentationCore.dll
rm ./THUAI6/win/win64/PresentationFramework.dll
rm ./THUAI6/win/win64/Debug/Microsoft.DiaSymReader.Native.amd64.dll
rm ./THUAI6/win/win64/WindowsBase.dll
rm ./THUAI6/win/win64/Debug/grpc_csharp_ext.x64.dll
rm ./THUAI6/win/win64/grpc_csharp_ext.x64.dll
rm -r ./THUAI6/win/CAPI/cpp/grpc
rm -r ./THUAI6/win/CAPI/cpp/spdlog
rm -r ./THUAI6/win/CAPI/cpp/tclap
rm -r ./THUAI6/linux/CAPI/cpp/grpc
rm -r ./THUAI6/linux/CAPI/cpp/spdlog
rm -r ./THUAI6/linux/CAPI/cpp/tclap
rm -r ./THUAI6/osx/CAPI/cpp/grpc
rm -r ./THUAI6/osx/CAPI/cpp/spdlog
rm -r ./THUAI6/osx/CAPI/cpp/tclap
rm ./THUAI6/linux/linux64/System.*.dll
rm ./THUAI6/linux/linux64/Debug/System.*.dll
rm ./THUAI6/osx/osx64/System.*.dll
rm ./THUAI6/osx/osx64/Debug/System.*.dll
rm ./THUAI6/win/win64/System.*.dll
rm ./THUAI6/win/win64/Debug/System.*.dll
rm ./THUAI6/linux/linux64/*.so
rm ./THUAI6/linux/linux64/Debug/*.so
- name: Upload COS
uses: zkqiang/[email protected]
with:
args: upload -r ./THUAI6/ /THUAI6/
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
bucket: ${{ secrets.COS_BUCKET }}
region: ${{ secrets.COS_REGION }}