-
Notifications
You must be signed in to change notification settings - Fork 56
/
.vsts-ci.yml
146 lines (132 loc) · 4.31 KB
/
.vsts-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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
trigger:
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- LICENSE.md
- Examples/*
pr:
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- LICENSE.md
- Examples/*
variables:
# TODO: reset counter on each GlobalAssemblyProperties version bump
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=vsts&tabs=yaml%2Cbatch#counters
patch: $[counter('patch_counter_20_12_1', 1)]
stages:
- stage: 'CI'
jobs:
- job: BuildSolution
displayName: Build Solution
pool:
name: Azure Pipelines
vmImage: windows-2019
demands:
- msbuild
- visualstudio
variables:
Solution: "UiPath.Orchestrator.Powershell.sln"
BuildConfiguration: "Release"
BuildPlatform: "Any CPU"
VSVersion: "16.0"
Build.Repository.Clean: true
steps:
- powershell: |
Write-Host "Variables for current build:"
Get-ChildItem ENV:* | Format-List
displayName: "Print variables"
continueOnError: true
condition: always()
- task: NodeTool@0
inputs:
versionSpec: '10.x'
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
restoreSolution: "$(Solution)"
- task: VSBuild@1
displayName: Build solution
inputs:
solution: '$(Solution)'
platform: '$(BuildPlatform)'
msbuildArgs: '/p:Revision=$(patch)'
configuration: '$(BuildConfiguration)'
- powershell: |
$buildNumber = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$($ENV:BUILD_SOURCESDIRECTORY)\Output\$($ENV:BUILDCONFIGURATION)\netstandard2.0\UiPath.PowerShell.dll").ProductVersion
Write-Host "##vso[build.updatebuildnumber]$buildNumber"
displayName: "Update Build Number"
- task: NuGetCommand@2
displayName: NuGet pack
inputs:
command: pack
versioningScheme: byBuildNumber
includeSymbols: true
symbolPackageFormat: snupkg
packagesToPack: "$(Build.SourcesDirectory)\\UiPath.PowerShell.nuspec"
configurationToPack: "$(BuildConfiguration)"
packDestination: '$(Build.ArtifactStagingDirectory)'
includeReferencedProjects: false
noPackageAnalysis: true
verbosityPack: 'Detailed'
- powershell: |
Get-ChildItem $(Build.ArtifactStagingDirectory) -Recurse
displayName: Show ArtifactStagingDirectory content
- task: PublishBuildArtifacts@1
displayName: Publish Artifact NuGet Packages
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "Setup"
- stage: 'Internal'
dependsOn: [ 'CI' ]
condition: and(
succeeded(),
ne(variables['Build.SourceBranchName'], 'master')
)
jobs:
- deployment: 'PublishPackageToDevPackages'
displayName: 'Publish package to feature feed'
environment: FEATURE
pool:
vmImage: windows-2019
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push - UiPath.PowerShell'
inputs:
command: push
packagesToPush: '$(Agent.BuildDirectory)/**/*.nupkg;$(Agent.BuildDirectory)/**/*.snupkg;!$(Agent.BuildDirectory)/**/*.symbols.nupkg'
publishVstsFeed: 'UiPath.PowerShell'
- stage: 'RELEASE'
dependsOn: [ 'CI' ]
condition: and(
succeeded(),
eq(variables['Build.SourceBranchName'], 'master')
)
jobs:
- deployment: 'PublishPackageMyGet'
displayName: 'Publish package to public MyGet feed'
environment: RELEASE
pool:
vmImage: windows-2019
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push - UiPath.PowerShell'
inputs:
command: push
packagesToPush: '$(Agent.BuildDirectory)/**/*.nupkg;$(Agent.BuildDirectory)/**/*.snupkg;!$(Agent.BuildDirectory)/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'UiPath Dev NuGet'