forked from Nyanotrasen/Nyanotrasen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
64 lines (60 loc) · 2.33 KB
/
.gitlab-ci.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
image: mcr.microsoft.com/dotnet/sdk:7.0
stages:
- test
- publish
test-debug:
stage: test
retry: 2
script:
- apt update && apt upgrade -y
- apt install -y python3 libfreetype6
- mkdir .git/hooks -p
- python3 RUN_THIS.py
- dotnet restore
- dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m
- pwsh -Command "dotnet test --configuration DebugOpt --no-build Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0"
- export DOTNET_gcServer=1
- pwsh -Command "dotnet test --configuration DebugOpt --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0"
test-release:
stage: test
retry: 2
script:
- apt update && apt upgrade -y
- apt install -y python3 libfreetype6
- mkdir .git/hooks -p
- python3 RUN_THIS.py
- dotnet restore
- dotnet build --configuration Tools --no-restore /p:WarningsAsErrors=nullable /m
- pwsh -Command "dotnet test --configuration Tools --no-build Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0"
- export DOTNET_gcServer=1
- pwsh -Command "dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0"
publish:
stage: publish
retry: 2
interruptible: true
rules:
- if: '$SSH_PRIVATE_KEY != null'
script:
- apt update && apt upgrade -y
- apt install -y python3 libfreetype6 openssh-client rsync
- mkdir .git/hooks -p
- python3 RUN_THIS.py
- Tools/package_server_build.py -p win-x64 linux-x64 osx-x64 linux-arm64 > server_build.log
- Tools/package_client_build.py > client_build.log
- Tools/gen_build_info.py
- mkdir release/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
- mv release/*.zip release/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
- eval $(ssh-agent -s)
- ssh-add - <<< "${SSH_PRIVATE_KEY}"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_REMOTE_IP >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- rsync -avz release/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA $SSH_USER@$SSH_REMOTE_IP:~/builds/builds/
- ssh $SSH_USER@$SSH_REMOTE_IP "~/push.ps1 $CI_COMMIT_REF_NAME-$CI_COMMIT_SHA $CI_COMMIT_REF_NAME"
artifacts:
name: "$CI_COMMIT_REF_NAME"
paths:
- release/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
- server_build.log
- client_build.log