Browse Source

ci: 💚 add osx

tags/0.1.0
shangfengh 2 years ago
parent
commit
1be10fc7f4
2 changed files with 31 additions and 9 deletions
  1. +26
    -8
      .github/workflows/upload_COS.yml
  2. +5
    -1
      docs/使用文档.md

+ 26
- 8
.github/workflows/upload_COS.yml View File

@@ -18,7 +18,7 @@ jobs:
- name: Setup dotnet Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 6.0.402
- name: Setup Python
uses: actions/setup-python@v4
@@ -35,17 +35,22 @@ jobs:
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: |
@@ -70,11 +75,13 @@ jobs:
cp ./CAPI/python/requirements.txt ./THUAI6/win/CAPI/python

cp -r ./THUAI6/win/CAPI ./THUAI6/linux/
cp -r ./THUAI6/win/CAPI ./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@v2
with:
@@ -128,22 +135,33 @@ jobs:
region: ${{ secrets.COS_REGION }}

- name: Remove Files
run: |
run: |
rm ./THUAI6/hash.json
rm -r ./THUAI6/win/CAPI/cpp/grpc
rm -r ./THUAI6/win/CAPI/cpp/spdlog
rm -r ./THUAI6/win/CAPI/cpp/tclap

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/win/win64/Debug/grpc_csharp_ext.x64.dll
rm ./THUAI6/win/win64/grpc_csharp_ext.x64.dll

rm ./THUAI6/linux/linux64/*.so
rm ./THUAI6/linux/linux64/Debug/*.so


+ 5
- 1
docs/使用文档.md View File

@@ -1,6 +1,6 @@
# 使用文档

本文档仅供Windows选手参考,Linux选手仿照本文档即可。
本文档仅供Windows选手参考,Linux,macOS选手仿照本文档即可。
[TOC]

## C++接口使用说明
@@ -8,6 +8,8 @@
- Windows:先查看`.\win\CAPI\cpp\`文件夹下是否有`lib`文件夹,没有则https://cloud.tsinghua.edu.cn/d/6972138f641d4e81a446/ 下载并复制粘贴
- Linux:首先自行安装`gRPC`,具体方法可以参考官方教程https://grpc.io/docs/languages/cpp/quickstart/。
- 然后在`CAPI\cpp\API\src\AI.cpp`中编写代码
- 选手不应当修改`AI.cpp`中原来有的代码,除了`void AI::play(IStudentAPI& api)`和`void AI::play(ITrickerAPI& api)`
- 选手可以在`AI.cpp`内`void AI::play`外新增函数和变量
- Windows:然后用Visual Studio打开`CAPI\cpp\CAPI.sln`编译,注意使用Debug模式
- Linux:用`cmake`,对`CAPI\cpp\CMakeLists.txt`进行编译
- Windows:最后使用`RunCpp.cmd`执行比赛代码
@@ -17,6 +19,8 @@

- 首先在Python环境下运行`GeneratePythonProto.cmd`,以安装必要的包、并生成对应的grpc python文件
- 然后在`CAPI\python\PyAPI\AI.py`中编写代码
- 选手不应当修改`AI.py`中原来有的代码,除了`StudentPlay(self, api: IStudentAPI)`和`TrickerPlay(self, api: ITrickerAPI)`
- 选手可以在`class AI(IAI)`内新增函数和变量
- Windows:最后通过运行`RunPython.cmd`执行比赛代码
- Linux:通过运行`RunPython.sh`执行比赛代码



Loading…
Cancel
Save