-
Notifications
You must be signed in to change notification settings - Fork 12
/
azure-pipelines.yml
121 lines (102 loc) · 3.91 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
# 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
trigger:
- main-ci
- main
jobs:
- job: build_x64
pool:
vmImage: "windows-2022"
timeoutInMinutes: 120
variables:
solution: "YtFlowApp.sln"
buildPlatform: "x64|ARM"
buildConfiguration: "Release"
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
vcpkgGitCommitId: 8d3649ba34aab36914ddd897958599aa0a91b08e
cleanBuild: false
steps:
- checkout: self
submodules: recursive
- task: NuGetToolInstaller@1
- task: Cache@2
condition: eq(variables.cleanBuild, 'false')
inputs:
key: 'nuget | "$(Agent.OS)" | **/*.vcxproj'
restoreKeys: |
nuget | "$(Agent.OS)"
nuget
path: $(NUGET_PACKAGES)
displayName: Cache NuGet packages
- task: NuGetCommand@2
inputs:
restoreSolution: "$(solution)"
- task: Cache@2
condition: false
inputs:
key: 'target | "$(Agent.OS)" | rust-toolchain.toml | Cargo.lock'
restoreKeys: |
target | "$(Agent.OS)" | rust-toolchain.toml
target
path: target
displayName: Cache target directory
- task: Cache@2
condition: eq(variables.cleanBuild, 'false')
inputs:
key: 'rustup | "$(Agent.OS)" | rust-toolchain.toml'
path: "$(UserProfile)/.rustup"
displayName: Cache rustup toolchains
- task: Cache@2
condition: eq(variables.cleanBuild, 'false')
inputs:
key: 'cargo | "$(Agent.OS)" | Cargo.lock'
restoreKeys: |
cargo | "$(Agent.OS)"
cargo
path: "$(UserProfile)/.cargo"
displayName: Cache Cargo packages
- task: Cache@2
condition: eq(variables.cleanBuild, 'false')
inputs:
key: 'vcpkg | "$(Agent.OS)" | "$(vcpkgGitCommitId)"'
path: "$(Build.BinariesDirectory)/vcpkg"
displayName: Cache vcpkg for YtFlowCore
- task: run-vcpkg@0
name: runVcpkg
displayName: "Run vcpkg for YtFlowCore"
inputs:
vcpkgArguments: "openssl:x64-uwp openssl:arm-uwp"
vcpkgGitCommitId: $(vcpkgGitCommitId)
- task: CmdLine@2
inputs:
script: |
cargo build --config .cargo/publish.config.toml --target x86_64-uwp-windows-msvc --release
cargo build --config .cargo/publish.config.toml --target thumbv7a-uwp-windows-msvc --release
env:
X86_64_UWP_WINDOWS_MSVC_OPENSSL_DIR: "$(runVcpkg.RUNVCPKG_VCPKG_ROOT_OUT)\\installed\\x64-uwp"
THUMBV7A_UWP_WINDOWS_MSVC_OPENSSL_DIR: "$(runVcpkg.RUNVCPKG_VCPKG_ROOT_OUT)\\installed\\arm-uwp"
displayName: Build core wrapper for UWP
- task: DownloadSecureFile@1
name: secureKeyFile
inputs:
secureFile: "YtFlowApp_TemporaryKey.pfx"
retryCount: "2"
- task: CmdLine@2
inputs:
script: '.\vcpkg\bootstrap-vcpkg.bat'
displayName: Bootstrap vcpkg
- task: VSBuild@1
displayName: Build App Bundle
inputs:
platform: "x64"
solution: "$(solution)"
configuration: "$(buildConfiguration)"
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:PackageCertificateKeyFile="$(secureKeyFile.secureFilePath)" /p:PackageCertificateThumbprint="" /p:UapAppxPackageBuildMode=SideloadOnly /p:PlatformToolset=v143 /p:PreferredToolArchitecture=x64'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(build.artifactStagingDirectory)\AppxPackages\'
artifact: "AppxPackages"
publishLocation: "pipeline"