-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
101 lines (96 loc) · 5.57 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
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
variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
windows_test:
stage: test
tags:
- win
script:
- chcp 65001
- dotnet test Tests/Tests.sln
windows_build:
stage: build
tags:
- win
script:
- $ErrorActionPreference = "Stop";
- chcp 65001
- 'Orange\Launcher\bin\Win\Release\Launcher.exe -c -j -b .\Orange\Orange.Win.sln'
- '.\Orange\Orange.CLI\bin\Release\Orange.CLI.exe --command:"Generate Lime Deserializers And Cloners"'
- 'git status -s > ..\changes.txt'
- 'cat .\..\changes.txt'
- 'if ((Get-Item "..\changes.txt").length -ne 0) {exit 1}'
- 'Orange\Launcher\bin\Win\Release\Launcher.exe -c -j -b .\Tangerine\Tangerine.Win.sln'
- '.\Orange\Orange.CLI\bin\Release\Orange.CLI.exe .\Examples\EmptyProject\EmptyProject.citproj --target:Win --command:"Build" --disable-asset-cache --delete-tancache'
- '.\Orange\Orange.CLI\bin\Release\Orange.CLI.exe .\Examples\EmptyProject\EmptyProject.citproj --target:Android --command:"Build" --disable-asset-cache --delete-tancache'
- '.\Orange\Orange.CLI\bin\Release\Orange.CLI.exe .\Examples\Tests\Tests.citproj --target:Win --command:"Build" --disable-asset-cache --delete-tancache'
- '.\Orange\Orange.CLI\bin\Release\Orange.CLI.exe .\Examples\Tests\Tests.citproj --target:Android --command:"Build" --disable-asset-cache --delete-tancache'
- dotnet build -c:Release .\Orange\Launcher\Launcher.Win.Sln
osx_build:
stage: build
tags:
- osx
script:
- CITRUS_PATH="$(pwd)"
- './Orange/Launcher/bin/Mac/Release/Launcher.app/Contents/MacOS/Launcher -c -j -b $CITRUS_PATH/Orange/Orange.Mac.sln'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI --command:"Generate Lime Deserializers And Cloners"'
- 'git status -s > ../changes.txt'
- 'cat ./../changes.txt'
- if [ -s ./../changes.txt ]; then exit 1; fi
- './Orange/Launcher/bin/Mac/Release/Launcher.app/Contents/MacOS/Launcher -c -j -b $CITRUS_PATH/Tangerine/Tangerine.Mac.sln'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/EmptyProject/EmptyProject.citproj --target:Mac --command:"Build" --disable-asset-cache --delete-tancache'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/EmptyProject/EmptyProject.citproj --target:iOS --command:"Build" --disable-asset-cache --delete-tancache'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/EmptyProject/EmptyProject.citproj --target:Android --command:"Build" --disable-asset-cache --delete-tancache'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/Tests/Tests.citproj --target:Mac --command:"Build" --disable-asset-cache --delete-tancache'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/Tests/Tests.citproj --target:iOS --command:"Build" --disable-asset-cache --delete-tancache'
- 'Orange/Orange.CLI/bin/Release/Orange.CLI.app/Contents/MacOS/Orange.CLI $(pwd)/Examples/Tests/Tests.citproj --target:Android --command:"Build" --disable-asset-cache --delete-tancache'
- nuget restore ./Orange/Launcher/Launcher.Mac.sln
- msbuild ./Orange/Launcher/Launcher.Mac.sln -property:Configuration=Release
generate_docs:
stage: build
only:
- /^master$/
tags:
- win
- docfx
- git_usr_bin_in_path
script:
# generate docs using docfx (into ./Docs/site_/)
- docfx Docs/docfx.json
# replace backslashes with forwards slashes in a path to private key
- $env:GAME_FOREST_BOT_RSA=$env:GAME_FOREST_BOT_RSA -replace "[\\]", "/"
# replace crlf in last line of private key, because gitlab is broken (and -NoNewLine option because powershell is also broken)
- ((Get-Content $env:GAME_FOREST_BOT_RSA) -join "`n") + "`n" | Set-Content -NoNewline $env:GAME_FOREST_BOT_RSA
# override ssh command for git to ignore remote host fingerprint and provide custom private key
- $env:GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $env:GAME_FOREST_BOT_RSA -F /dev/null"
# make a shallow clone of github pages branch
- git clone [email protected]:game-forest/Citrus.git --depth 1 --branch gh-pages --single-branch citrus_gh_pages
- cd citrus_gh_pages
- git config user.email [email protected]
- git config --replace-all user.name "Game Forest"
- git rm -r *
- mv ../Docs/_site/* .
- git add -A
- git diff-index --quiet HEAD; if ($?) { echo "no changes; skipping commit" } else { git commit -m"update docs" }
- git push origin gh-pages
push_to_github:
stage: build
only:
- /^master$/
tags:
- win
- git_usr_bin_in_path
script:
# replace backslashes with forwards slashes in a path to private key
- $env:GAME_FOREST_BOT_RSA=$env:GAME_FOREST_BOT_RSA -replace "[\\]", "/"
# replace crlf in last line of private key, because gitlab is broken (and -NoNewLine option because powershell is also broken)
- ((Get-Content $env:GAME_FOREST_BOT_RSA) -join "`n") + "`n" | Set-Content -NoNewline $env:GAME_FOREST_BOT_RSA
# override ssh command for git to ignore remote host fingerprint and provide custom private key
- $env:GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $env:GAME_FOREST_BOT_RSA -F /dev/null"
- git config user.email [email protected]
- git config --replace-all user.name "Game Forest"
- git remote add github [email protected]:game-forest/Citrus.git; if ($?) { } else { echo "remote already set" }
- git fetch github
- git branch -D $env:CI_BUILD_REF_NAME; if ($?) { } else { echo "branch doesn't exist" }
- git checkout --track origin/$env:CI_BUILD_REF_NAME
- git push github $env:CI_BUILD_REF_NAME