-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
144 lines (131 loc) · 4.44 KB
/
azure-pipelines.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
trigger:
- master
name: 4.0.$(Build.BuildId)
variables:
- name: BuildPlatform
value: 'Any CPU'
- name: BuildConfiguration
value: 'Release'
- group: CodeSigning
stages:
- stage: Build
jobs:
- job: Build
displayName: Build Toolkit
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
useGlobalJson: true
- task: NuGetToolInstaller@1
displayName: Use Latest NuGet
inputs:
checkLatest: true
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
command: restore
feedsToUse: config
nugetConfigPath: build/NuGet.config
externalFeedCredentials: 'SponsorConnect-Feed'
- task: MSBuild@1
displayName: 'Build solution AP.MobileToolkit.sln'
inputs:
solution: ci-build.slnf
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:DebugType=portable /p:JavaSdkDirectory="$(JAVA_HOME)"'
- task: DotNetCoreCLI@2
displayName: Run Tests
inputs:
command: test
projects: 'tests/**/*.csproj'
arguments: '-c $(BuildConfiguration) --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/CodeCoverage.runsettings --no-build'
# Temporarily disable until code sign cert is updated.
# - task: PowerShell@2
# displayName: 'Authenticode Sign Artifacts'
# inputs:
# filePath: 'build\Sign-Packages.ps1'
# env:
# SignClientUser: $(SignClientUser)
# SignClientSecret: $(SignClientSecret)
# SignClientClientId: $(SignClientClientId)
# SignClientTenantId: $(SignClientTenantId)
# SignServiceResourceId: $(SignServiceResourceId)
# condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- task: PublishPipelineArtifact@1
displayName: 'Publish Package Artifacts'
inputs:
artifact: NuGet
targetPath: $(Build.ArtifactStagingDirectory)
- stage: Deploy
displayName: Deploy NuGet Packages
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['system.pullrequest.isfork'], false))
jobs:
- deployment: SponsorConnect
displayName: SponsorConnect.dev
environment: SponsorConnect
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'SponsorConnect'
- deployment: InHouse
displayName: In-House
environment: In-House
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'InHouse'
- stage: DeployRelease
displayName: Deploy Release NuGet Packages
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['system.pullrequest.isfork'], false))
jobs:
- deployment: NuGet
displayName: NuGet.org
environment: NuGet
strategy:
runOnce:
deploy:
steps:
- checkout: self
clean: true
- task: PowerShell@2
displayName: Process Release
inputs:
targetType: filePath
filePath: $(System.DefaultWorkingDirectory)/build/Process-Release.ps1
- task: GitHubRelease@1
inputs:
action: create
gitHubConnection: GitHub
assets: |
$(Pipeline.Workspace)/**/*.nupkg
$(Pipeline.Workspace)/**/*.snupkg
tag: 'v$(VersionName)'
tagSource: userSpecifiedTag
isPreRelease: $(IS_PREVIEW)
title: $(ReleaseDisplayName)
addChangeLog: true
- task: NuGetCommand@2
displayName: NuGet Push
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet.org'