-
Notifications
You must be signed in to change notification settings - Fork 83
/
azure-pipelines.yml
136 lines (116 loc) · 5.05 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
# Universal Windows Platform
# Build a Universal Windows Platform project using Visual Studio.
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml
pr:
autoCancel: true
branches:
include:
- master
variables:
- group: UWP-PipeLineVariable
- name: BuildProject
value: "Package"
- name: Solution
value: "**/*.sln"
- name: BuildPlatform
value: "x64|ARM64"
- name: BuildConfiguration
value: "Release"
- name: SideloadBuildPublishLocation
value: '$(Build.ArtifactStagingDirectory)\Sideload\\'
- name: CIBuildPublishLocation
value: '$(Build.ArtifactStagingDirectory)\CI\\'
- name: NUGET_RESTORE_MSBUILD_ARGS
value: "/p:Configuration=$(BuildConfiguration)"
jobs:
- job: CIBuild
displayName: "Build CI Application"
timeoutInMinutes: 30
pool:
vmImage: "windows-latest"
steps:
- task: UseDotNet@2
displayName: "Install .Net 8 SDK"
inputs:
version: 8.x
- task: DownloadSecureFile@1
name: secureFile
displayName: "Download Publish Certificate"
inputs:
secureFile: "$(signingCert.secureFileName)"
- task: PowerShell@2
displayName: "Add AppCenter Secret Value"
inputs:
targetType: "inline"
script: |
Write-Host "Start adding AppCenter secret value."
$AppCenterSecret = '$(appCenter.secret)'
$TargetPath = '$(Build.SourcesDirectory)\RX_Explorer\View\ExtendedSplash.xaml.cs'
$TargetContent = Get-Content -Path $TargetPath
$TargetContent -Replace '<RX-Explorer-AppCenter-Secret-Value>', $AppCenterSecret | Set-Content -Path $TargetPath -Encoding UTF8
Write-Host "AppCenter secret value was added successfully"
- task: NuGetToolInstaller@1
displayName: "Install Nuget ToolSet"
- task: NuGetCommand@2
displayName: "Restore Nuget Packages On Solution"
inputs:
restoreSolution: "$(Solution)"
- task: VSBuild@1
displayName: "Build RX-Explorer Project"
inputs:
solution: "$(Solution)"
msbuildArgs: '/t:$(BuildProject):Rebuild /p:PreferredToolArchitecture="x64" /p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(CIBuildPublishLocation)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=CI /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="$(signingCert.thumbprint)" /p:PackageCertificateKeyFile="$(secureFile.secureFilePath)" /p:PackageCertificatePassword="$(signingCert.password)"'
configuration: "$(BuildConfiguration)"
clean: true
msbuildArchitecture: "x64"
- task: PublishBuildArtifacts@1
displayName: "Publish And Upload Artifact"
inputs:
ArtifactName: "CIBuild"
PathtoPublish: "$(CIBuildPublishLocation)"
# - job: SideLoadBuild
# displayName: "Build Sideload Application"
# timeoutInMinutes: 180
# pool:
# vmImage: "windows-latest"
# steps:
# - task: UseDotNet@2
# displayName: "Install .Net 8 SDK"
# inputs:
# version: 8.x
# - task: DownloadSecureFile@1
# name: secureFile
# displayName: "Download Publish Certificate"
# inputs:
# secureFile: "$(signingCert.secureFileName)"
# - task: PowerShell@2
# displayName: "Add AppCenter Secret Value"
# inputs:
# targetType: "inline"
# script: |
# Write-Host "Start adding AppCenter Secret Value."
# $AppCenterSecret = '$(appCenter.secret)'
# $TargetPath = '$(Build.SourcesDirectory)\RX_Explorer\View\ExtendedSplash.xaml.cs'
# $TargetContent = Get-Content -Path $TargetPath
# $TargetContent -Replace '<RX-Explorer-AppCenter-Secret-Value>', $AppCenterSecret | Set-Content -Path $TargetPath -Encoding UTF8
# Write-Host "AppCenter Secret Value was added successfully"
# - task: NuGetToolInstaller@1
# displayName: "Install Nuget ToolSet"
# - task: NuGetCommand@2
# displayName: "Restore Nuget Packages On Solution"
# inputs:
# restoreSolution: "$(Solution)"
# - task: VSBuild@1
# displayName: "Build RX-Explorer Project"
# inputs:
# solution: "$(Solution)"
# msbuildArgs: '/t:$(BuildProject):Rebuild /p:PreferredToolArchitecture="x64" /p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(SideloadBuildPublishLocation)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="$(signingCert.thumbprint)" /p:PackageCertificateKeyFile="$(secureFile.secureFilePath)" /p:PackageCertificatePassword="$(signingCert.password)"'
# configuration: "$(BuildConfiguration)"
# clean: true
# msbuildArchitecture: "x64"
# - task: PublishBuildArtifacts@1
# displayName: "Publish And Upload Artifact"
# inputs:
# ArtifactName: "SideloadBuild"
# PathtoPublish: "$(SideloadBuildPublishLocation)"