-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (56 loc) · 2.25 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
image: cly0896/dm-mono-nunit
before_script:
- nuget restore -NonInteractive
- mapfile BuildConfiguration < BUILD
stages:
- build
- test
- deploy
build:
stage: build
script:
#Build DLLs
- echo "BuildNum:${BuildConfiguration[0]}"
#Build DLLs in Release mode
- msbuild Build.proj /p:Configuration=Release /p:Platform="Any CPU" /p:build_number=${BuildConfiguration[0]}
artifacts:
paths:
- "MessagingLibrary-4.5.2/bin/Release/"
- "MessagingLibrary-3.5/bin/Release/"
- "Consolidated Unit Tests-4.5.2/bin/Release/"
- "Consolidated Unit Tests-3.5/bin/Release/"
test:
stage: test
script:
#Write Config File from Environment Variables
- echo "UserIdOrEmail:"$UserIdOrEmail > "Consolidated Unit Tests/Test Documents/MessageData.txt"
- echo "Password:"$Password >> "Consolidated Unit Tests/Test Documents/MessageData.txt"
- echo "ToAddress:"$ToAddress >> "Consolidated Unit Tests/Test Documents/MessageData.txt"
- echo "FromAddress:"$FromAddress >> "Consolidated Unit Tests/Test Documents/MessageData.txt"
#Change directory and run unit tests
- nunit "Consolidated Unit Tests-4.5.2/bin/Release/Consolidated Unit Tests.dll" --result 452Result.xml
- nunit "Consolidated Unit Tests-3.5/bin/Release/Consolidated Unit Tests-3.5.dll" --result 35Result.xml
artifacts:
paths:
- "452Result.xml"
- "35Result.xml"
dependencies:
- build
release:
stage: deploy
only:
- tags
script:
#Copy DLLs to lib folder for NuGet
- mkdir -p "lib/net452" && cp "MessagingLibrary-4.5.2/bin/Release/DataMotion Messaging Library.dll" "lib/net452/DataMotion Messaging Library.dll"
- mkdir -p "lib/net35" && cp "MessagingLibrary-3.5/bin/Release/DataMotion Messaging Library.dll" "lib/net35/DataMotion Messaging Library.dll"
- sed -i "s/version-num/${BuildConfiguration[0]}/g" MessagingLibrary.nuspec
- sed -i "s/author-name/DataMotion/g" MessagingLibrary.nuspec
- sed -i "s/copyright-date/Copyright 2018/g" MessagingLibrary.nuspec
- nuget pack MessagingLibrary.nuspec
- nuget setApiKey $ApiKey -Source https://api.nuget.org/v3/index.json
- nuget push *.nupkg -Source https://api.nuget.org/v3/index.json
environment:
name: nuget
dependencies:
- build