-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
88 lines (74 loc) · 2.66 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
variables:
GIT_DEPTH: "100000"
MSBuildThisFileDirectory: "./"
IGNORE_NORMALISATION_GIT_HEAD_MOVE: "1"
# GIT_STRATEGY: clone
stages:
- build
- deploy
- publish
build-zetbox:
stage: build
image: mcr.microsoft.com/dotnet/sdk:6.0
tags:
- Windows
script: |
dotnet --info
dotnet build --disable-parallel --ignore-failed-sources --configuration Release Zetbox.Core.sln
dotnet publish --disable-parallel --ignore-failed-sources --configuration Release Zetbox.Server.HttpService/Zetbox.Server.HttpService.csproj --output ./bin/Release/HttpService
artifacts:
paths:
- 'bin'
- 'publish'
name: 'zetbox'
expire_in: 1 hrs
create-artifacts:
stage: deploy
image: mcr.microsoft.com/dotnet/sdk:6.0
tags:
- Windows
script: |
echo "Creating local packages"
rm publish/*.nupkg
rm publish/*.nuspec
dotnet nuget remove source zetbox
dotnet nuget add source "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/packages/nuget/index.json" --name zetbox --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text
nuget install GitVersion.CommandLine -Version "5.6.6" -OutputDirectory ./Tools
$version=(./Tools/GitVersion.CommandLine.5.6.6/tools/gitversion.exe -nofetch -showvariable NuGetVersionV2)
echo "Version = $version"
echo ""
echo "setting version"
echo "@nuget install ZetboxBasic -Version $version -DependencyVersion Ignore -OutputDirectory ""%~dp0\bin""" > publish/DownloadZetbox.cmd
cp publish/* ./bin/Release
ls ./publish/*.nuspec.template | % {
$file = $_.Name.Replace(".nuspec.template", "")
$file | out-host
Get-Content "publish/$file.nuspec.template" | % {
$_ -replace '##version##', $version
} | Set-Content -encoding "UTF8" "./bin/Release/$file.nuspec"
}
echo "packing files"
ls ./bin/Release/*.nuspec | % {
$file = $_.Name
$file | out-host
nuget pack "./bin/Release/$file" -OutputDirectory ./publish -Properties NoWarn=NU5100
}
# for now, publish them
cd ./publish
dotnet nuget push *.nupkg -s zetbox --skip-duplicate
artifacts:
paths:
- 'publish/*.nupkg'
name: 'zetbox-packages'
publish-master:
stage: publish
image: mcr.microsoft.com/dotnet/sdk:6.0
tags:
- Windows
only:
refs:
- master
script: |
echo "Creating final packages"
dotnet nuget add source "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/packages/nuget/index.json" --name zetbox --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text
dotnet nuget push ./publish/*.nupkg -s zetbox --skip-duplicate