-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
174 lines (153 loc) · 5.87 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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 AP.MobileToolkit.Fonts
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
displayName: Install .NET 3.1
inputs:
packageType: sdk
version: 3.1.409
- task: UseDotNet@2
displayName: Install .NET 5
inputs:
packageType: sdk
version: 5.0.300
- task: UseDotNet@2
displayName: Install .NET 6 preview
inputs:
packageType: sdk
useGlobalJson: true
- powershell: |
dotnet tool install --global Redth.Net.Maui.Check --version 0.5.6
maui-check --preview --non-interactive --ci --fix
displayName: Setup for Maui and .NET 6
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
# - powershell: |
# dotnet tool install --global dotnet-vs --version 1.0.0
# vs install preview enterprise +mobile
# displayName: Setup VS Preview
# - powershell: |
# msbuild build-forms.slnf /r /p:Configuration=Release
# displayName: MSBuild
- task: MSBuild@1
displayName: Build Forms Packages
inputs:
solution: build-forms.slnf
configuration: 'Release'
msbuildArguments: '/r'
- powershell: |
dotnet restore .\build-maui.slnf --configfile .\build\nuget.config
displayName: Restore Maui Projects
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- task: MSBuild@1
displayName: Build Maui Packages
inputs:
solution: build-maui.slnf
configuration: 'Release'
- powershell: |
dotnet test tests\AP.MobileToolkit.Fonts.Tests\AP.MobileToolkit.Fonts.Tests.csproj --configuration Release --logger trx --no-build --collect "Code Coverage"
displayName: Run Tests
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunTitle: 'AP.MobileToolkit.Fonts'
testResultsFiles: '**/*.trx'
- powershell: 'build\Sign-Packages.ps1'
displayName: 'Authenticode Sign Artifacts'
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
SignClientClientId: $(SignClientClientId)
SignClientTenantId: $(SignClientTenantId)
SignServiceResourceId: $(SignServiceResourceId)
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
enabled: false
- task: PublishPipelineArtifact@1
displayName: Publish Pipeline Artifacts
inputs:
artifact: NuGet
targetPath: $(Build.ArtifactStagingDirectory)
- stage: Deploy
displayName: Deploy CI Packages
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['system.pullrequest.isfork'], false))
jobs:
- deployment: sponsorconnect
displayName: SponsorConnect
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: apnuget
displayName: 'nuget.avantipoint.com'
environment: APNuGet
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'AvantiPoint-NuGet'
- stage: NuGet
displayName: Deploy to NuGet.org
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['system.pullrequest.isfork'], false), eq(variables['IS_RELEASE'], 'true'))
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
tag: 'v$(VersionName)'
tagSource: userSpecifiedTag
isPreRelease: $(IS_PREVIEW)
title: $(ReleaseDisplayName)
addChangeLog: true
- task: NuGetCommand@2
displayName: Push to NuGet.org
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet.org'