This repository has been archived by the owner on Apr 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (72 loc) · 3.32 KB
/
dotnetcore.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
name: .NET Core
on:
push:
branches:
- master
- dev
jobs:
build_upload:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
- name: Setup Python
uses: actions/[email protected]
with:
python-version:: 3.7.4
- name: Pip install cos-python
run: pip install -U cos-python-sdk-v5
- name: Publish
run: |
ls
New-Item -Path . -Name "THUAI3.0" -ItemType "directory"
ls
cd ./logic
ls
./build_logic.ps1 -Dir ../THUAI3.0
ls
cd ..
ls
(Get-Content "runServer.bat").replace("logic\Logic.Server\bin\Release\netcoreapp3.0","THUAI3.0") | Set-Content "runServer.bat"
(Get-Content "runServerToFile.bat").replace("logic\Logic.Server\bin\Release\netcoreapp3.0","THUAI3.0") | Set-Content "runServerToFile.bat"
(Get-Content "runAgent.bat").replace("communication\Agent\bin\Release\netcoreapp3.0","THUAI3.0") | Set-Content "runAgent.bat"
(Get-Content "runClientConsole.bat").replace("logic\Logic.Client\bin\Release\netcoreapp3.0","THUAI3.0") | Set-Content "runClientConsole.bat"
python ./upload_to_tencent_cloud.py --id ${{ secrets.TENCENT_CLOUD_ID }} --key ${{ secrets.TENCENT_CLOUD_KEY }} CAPI THUAI3.0 Config runServer.bat runServerToFile.bat runAgent.bat runClientConsole.bat API.md README.md
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Log in to DockerHub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
- name: Publish server
run: dotnet publish "logic/Logic.Server/Logic.Server.csproj" -c Release -r linux-x64 --self-contained true
- name: Build docker image of server
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/thuai_server:latest -f logic/ServerDockerfile .
- name: Push server image to DockerHub
run: docker push ${{ secrets.DOCKER_USERNAME }}/thuai_server:latest
- name: Build CAPI_compile docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/thuai_compiler:latest -f CAPI/Dockerfile_compile .
- name: Push CAPI_compile image to DockerHub
run: docker push ${{ secrets.DOCKER_USERNAME }}/thuai_compiler:latest
- name: Get Protobuf and libprotos.so from Compiler
run: |
mkdir temp
cd temp
docker run --name compiler ${{ secrets.DOCKER_USERNAME }}/thuai_compiler:latest bash /usr/local/CAPI/compile.sh
docker cp compiler:/usr/local/CAPI/build/proto/lib/libprotos.so .
docker cp compiler:/usr/local/protobuf .
ls
cd ..
- name: Publish agent
run: dotnet publish "communication/Agent/Communication.Agent.csproj" -c Release -r linux-x64 -f netcoreapp3.0 --self-contained true
- name: Build docker image of agent
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/thuai_agentclient:latest -f CAPI/Dockerfile_run .
- name: Push agent image to DockerHub
run: docker push ${{ secrets.DOCKER_USERNAME }}/thuai_agentclient:latest