-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate_pr_pipeline.yml
More file actions
118 lines (101 loc) · 4.33 KB
/
template_pr_pipeline.yml
File metadata and controls
118 lines (101 loc) · 4.33 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
pr:
branches:
include:
- master
exclude:
- feature/*
- fix/*
trigger: none
pool:
vmImage: ubuntu-latest
# Versioning source: https://stackoverflow.com/a/60609868/987827
variables:
buildConfiguration: 'Release'
stages:
- stage: build
jobs:
- job: BuildAndTest
steps:
- checkout: self
fetchDepth: 0
- script: echo $(version)
displayName: 'Basic Information - Version'
- script: echo $(Build.ArtifactStagingDirectory)
displayName: 'Basic Information - ArtifactStagingDirectory'
- script: pwd
displayName: 'Basic Information - Current Directory'
- script: ls -al
displayName: 'Basic Information - Directory Contents'
- task: Bash@3
displayName: 'Install Mono via apt'
inputs:
targetType: 'inline'
script: |
sudo apt-get update
sudo apt-get install -y mono-devel
- task: UseDotNet@2
displayName: Install .NET Core SDK
inputs:
packageType: 'sdk'
version: '9.x'
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: Determine Version
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'
- script: |
echo Major: $(GitVersion.Major)
echo Minor: $(GitVersion.Minor)
echo Patch: $(GitVersion.Patch)
echo PreReleaseTag: $(GitVersion.PreReleaseTag)
echo PreReleaseLabel: $(GitVersion.PreReleaseLabel)
echo PreReleaseNumber: $(GitVersion.PreReleaseNumber)
echo WeightedPreReleaseNumber: $(GitVersion.WeightedPreReleaseNumber)
echo BuildMetaData: $(GitVersion.BuildMetaData)
echo BuildMetaDataPadded: $(GitVersion.BuildMetaDataPadded)
echo FullBuildMetaData: $(GitVersion.FullBuildMetaData)
echo MajorMinorPatch: $(GitVersion.MajorMinorPatch)
echo SemVer: $(GitVersion.SemVer)
echo LegacySemVer: $(GitVersion.LegacySemVer)
echo LegacySemVerPadded: $(GitVersion.LegacySemVerPadded)
echo AssemblySemVer: $(GitVersion.AssemblySemVer)
echo AssemblySemFileVer: $(GitVersion.AssemblySemFileVer)
echo FullSemVer: $(GitVersion.FullSemVer)
echo InformationalVersion: $(GitVersion.InformationalVersion)
echo BranchName: $(GitVersion.BranchName)
echo EscapedBranchName: $(GitVersion.EscapedBranchName)
echo Sha: $(GitVersion.Sha)
echo ShortSha: $(GitVersion.ShortSha)
echo NuGetVersionV2: $(GitVersion.NuGetVersionV2)
echo NuGetVersion: $(GitVersion.NuGetVersion)
echo NuGetPreReleaseTagV2: $(GitVersion.NuGetPreReleaseTagV2)
echo NuGetPreReleaseTag: $(GitVersion.NuGetPreReleaseTag)
echo VersionSourceSha: $(GitVersion.VersionSourceSha)
echo CommitsSinceVersionSource: $(GitVersion.CommitsSinceVersionSource)
echo CommitsSinceVersionSourcePadded: $(GitVersion.CommitsSinceVersionSourcePadded)
echo UncommittedChanges: $(GitVersion.UncommittedChanges)
echo CommitDate: $(GitVersion.CommitDate)
displayName: Current Version $(GitVersion.FullSemVer)
- script: dotnet build ./source/SparkRoseDigital_Template.sln --configuration Release
displayName: 'dotnet build $(buildConfiguration)'
- task: DockerInstaller@0
displayName: Docker Installer
inputs:
dockerVersion: 17.09.0-ce
releaseType: stable
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: 'test'
projects: '**/*.csproj'
publishTestResults: true
configuration: $(buildConfiguration)
- task: NuGetCommand@2
displayName: 'nuget pack'
inputs:
command: 'custom'
arguments: 'pack ./SparkRoseDigital.Template.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory) -Properties Configuration=Release -version $(GitVersion.SemVer) -Verbosity Detailed -NoDefaultExcludes'