-
Notifications
You must be signed in to change notification settings - Fork 28
/
azure-pipelines.yml
114 lines (99 loc) · 3.59 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
trigger:
branches:
include:
- master
- rel/*
paths:
exclude:
- '**/*.md'
- 'UITests/*'
pr:
branches:
include:
- master
- rel/*
paths:
exclude:
- '**/*.md'
- 'UITests/*'
variables:
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
- job: Build
pool:
vmImage: windows-2019
strategy:
matrix:
Channel_CD_Web:
ChannelName: CD-Web
DistributionUrl: https://mywpfapp.azurewebsites.net/CD
MsixPackageId: MyWPFApp.DevOpsDemo.CD
MsixPublisherId: CN=build
MsixPackageDisplayName: MyWPFApp (CD)
MsixBuildMode: SideLoadOnly
MsixGenerateAppInstaller: true
Channel_Prod_Web:
ChannelName: Prod-Web
DistributionUrl: https://mywpfapp.z5.web.core.windows.net/Prod
MsixPackageId: MyWPFApp.DevOpsDemo
MsixPublisherId: CN=build
MsixPackageDisplayName: MyWPFApp (Prod)
MsixBuildMode: SideLoadOnly
MsixGenerateAppInstaller: true
Channel_Prod_Store:
ChannelName: Prod-Store
DistributionUrl: https://not/used
MsixPackageId: MyWPFApp
MsixPublisherId: CN=E40A5878-9BC7-45A3-BBFC-B988EA6795B5
MsixPackageDisplayName: MyWPFApp (Store)
MsixBuildMode: CI
MsixGenerateAppInstaller: false
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.0.x'
inputs:
version: 3.0.x
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool
- script: nbgv cloud -c -a
displayName: Set Version
- powershell: |
# Update appxmanifest. This must be done before build.
# Set the per-channel values into the appxmanifest, replacing the checked-in values
[xml]$manifest= get-content ".\MyWPFApp.Package\Package.appxmanifest"
$manifest.Package.Identity.Version = "$(GitBuildVersionSimple).0"
$manifest.Package.Identity.Name = "$(MsixPackageId)"
$manifest.Package.Identity.Publisher = "$(MsixPublisherId)"
$manifest.Package.Properties.DisplayName = "$(MsixPackageDisplayName)"
$manifest.Package.Applications.Application.VisualElements.DisplayName = "$(MsixPackageDisplayName)"
$manifest.save(".\MyWPFApp.Package\Package.appxmanifest")
displayName: Update manifest version
- powershell: |
# Update App Insights instrumentation key
[xml]$doc = Get-Content ".\MyWPFApp\ApplicationInsights.config"
$doc.ApplicationInsights.InstrumentationKey = "$(AppInsightsKey)"
$doc.save(".\MyWPFApp\ApplicationInsights.config")
displayName: Set AppInsights Config
env:
AppInsightsKey: $(AppInsightsKey)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['AppInsightsKey'], '')))
- task: MSBuild@1
displayName: Build for $(BuildConfiguration)
inputs:
solution: MyWPFApp.sln
platform: x86
msbuildArguments: /restore /p:AppInstallerUri=$(DistributionUrl) /p:UapAppxPackageBuildMode=$(MsixBuildMode) /p:GenerateAppInstallerFile=$(MsixGenerateAppInstaller)
configuration: $(BuildConfiguration)
maximumCpuCount: false
- script: copy build.cer MyWPFApp.Package\AppPackages\MyWPFApp.Package_$(GitBuildVersionSimple).0_x86_Test\MyWPFApp.Package_$(GitBuildVersionSimple).0_x86.cer
displayName: Copy Certificate to versioned dir
condition: and(succeeded(), not(eq(variables['ChannelName'], 'Prod-Store')))
- task: PublishPipelineArtifact@0
inputs:
artifactName: $(ChannelName)
targetPath: MyWPFApp.Package/AppPackages