This repository was archived by the owner on Jun 8, 2023. It is now read-only.
forked from barrycarey/SnipeSharp
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
70 lines (65 loc) · 2.05 KB
/
.gitlab-ci.yml
File metadata and controls
70 lines (65 loc) · 2.05 KB
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
stages:
- test
- build
- package
- deploy
test:
stage: test
tags: [docker]
image: mcr.microsoft.com/dotnet/core/sdk:3.1
script:
- cd SnipeSharp.Tests
- dotnet test SnipeSharp.Tests.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=OpenCover.xml
- dotnet reportgenerator -reports:OpenCover.xml -targetdir:coveragereport
artifacts:
paths:
- SnipeSharp.Tests/coveragereport
expire_in: 1 mo
build debug:
stage: build
only: [master]
tags: [docker]
image: mcr.microsoft.com/dotnet/core/sdk:3.1
script:
- dotnet build -c Debug
artifacts:
paths:
- SnipeSharp/bin/Debug/netstandard2.0
- SnipeSharp.PowerShell/bin/Debug/netstandard2.0
build release:
stage: build
only: [tags]
tags: [docker]
image: mcr.microsoft.com/dotnet/core/sdk:3.1
script:
- dotnet build -c Release
artifacts:
paths:
- SnipeSharp/bin/Release/netstandard2.0
- SnipeSharp.PowerShell/bin/Release/netstandard2.0
package release:
stage: package
only: [tags]
tags: [docker]
dependencies: [build release]
image: mcr.microsoft.com/dotnet/core/sdk:3.1
before_script:
- mkdir bin
- pwsh -Command "Register-PSRepository -Name PowerShellRepository -SourceLocation (Get-Item bin).FullName -PublishLocation (Get-Item bin).FullName -InstallationPolicy Trusted"
script:
- mv SnipeSharp.PowerShell/bin/Release/netstandard2.0 SnipeSharp.PowerShell/bin/SnipeSharp.PowerShell
- pwsh -Command "Publish-Module -Path 'SnipeSharp.PowerShell/bin/SnipeSharp.PowerShell' -Repository PowerShellRepository -Force"
artifacts:
paths:
- bin/SnipeSharp.PowerShell.*.nupkg
expire_in: 1 mo
deploy release:
# runs in PowerShell ONLY
stage: deploy
only:
refs: [tags]
variables: [$InternalPowerShellRepositoryPath =~ /.+/]
tags: [INTERNAL-PS-REPO] # No, you can't have it
dependencies: [package release]
script:
- Copy-Item -Path "bin/*" -Destination "$env:InternalPowerShellRepositoryPath/"