-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
187 lines (161 loc) · 9.95 KB
/
azure-pipelines.yml
File metadata and controls
187 lines (161 loc) · 9.95 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
trigger:
- main
- store
pr:
- main
pool:
vmImage: "windows-latest"
variables:
- name: solution
value: "**/*.sln"
- name: buildPlatform
value: "x64"
- name: buildConfiguration
value: "Release"
- name: publishDirectory
value: "Pack/Output"
- name: artifactDirectory
value: "Pack/Zip"
- group: AppCenter
- group: Protected
parameters:
- name: "plugins"
type: object
default:
- "plugin_Kinect360"
- "plugin_KinectOne"
- "plugin_PSMoveService"
- "plugin_owoTrackVR"
- "plugin_OpenVR"
- "plugin_OSC"
name: 1.3.$(Date:yyyyMMdd).$(Rev:r)
stages:
- stage: Build
jobs:
- job: Publish
steps:
- checkout: self
submodules: true | recursive
persistCredentials: "true"
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: "$(solution)"
- pwsh: |
((Get-Content -path .\Amethyst\Amethyst.csproj -Raw) -replace 'AZ_BUILD_DATA-->', "") | Set-Content -Path .\Amethyst\Amethyst.csproj
((Get-Content -path .\Amethyst\Amethyst.csproj -Raw) -replace '<!--AZ_BUILD_DATA', "") | Set-Content -Path .\Amethyst\Amethyst.csproj
((Get-Content -path .\Amethyst\Amethyst.csproj -Raw) -replace 'AZ_BUILD_NUMBER', "$(Build.BuildNumber)") | Set-Content -Path .\Amethyst\Amethyst.csproj
((Get-Content -path .\Amethyst\Classes\AppData.cs -Raw) -replace 'AZ_BUILD_NUMBER', "$(Build.BuildNumber)") | Set-Content -Path .\Amethyst\Classes\AppData.cs
displayName: Add version data to Amethyst
- pwsh: |
((Get-Content -path .\Amethyst\Classes\AppData.cs -Raw) -replace 'AZ_API_TOKEN', "$(AppToken)") | Set-Content -Path .\Amethyst\Classes\AppData.cs
((Get-Content -path .\Amethyst\App.xaml.cs -Raw) -replace 'AZ_COMMIT_SHA', "$(Build.SourceVersion)") | Set-Content -Path .\Amethyst\App.xaml.cs
((Get-Content -path .\Amethyst\App.xaml.cs -Raw) -replace 'AZ_APPSECRET', "$(AppSecret)") | Set-Content -Path .\Amethyst\App.xaml.cs
(((Get-Content -path .\Amethyst\Pages\Info.xaml -Raw) -replace '<!--AZ_COMMIT_DATA', '') -replace 'AZ_COMMIT_DATA-->', '') | Set-Content -Path .\Amethyst\Pages\Info.xaml
((Get-Content -path .\Amethyst\Pages\Info.xaml -Raw) -replace 'AZ_COMMIT_SHA', "$("$(Build.SourceVersion)".Substring(0,7))") | Set-Content -Path .\Amethyst\Pages\Info.xaml
((Get-Content -path .\Amethyst\Pages\Info.xaml -Raw) -replace 'AZ_COMMIT_LINK', "https://github.com/KinectToVR/Amethyst/commit/$(Build.SourceVersion)") | Set-Content -Path .\Amethyst\Pages\Info.xaml
displayName: Add commit data to Amethyst
- pwsh: |
((Get-Content -path .\Amethyst\Classes\AppData.cs -Raw) -replace 'AZ_APPCENTER_SECRET', "$(Amethyst_AppSecret)") | Set-Content -Path .\Amethyst\Classes\AppData.cs
((Get-Content -path .\Amethyst\Classes\AppData.cs -Raw) -replace 'AZ_APPCENTER_RO_TOKEN', "$(UserApiToken_ReadOnly)") | Set-Content -Path .\Amethyst\Classes\AppData.cs
displayName: Add API keys to Amethyst
- pwsh: |
Write-Host "##vso[task.setvariable variable=PackageVersion;]$(([xml](Get-Content .\Amethyst\Package.appxmanifest)).Package.Identity.Version)"
Write-Host "##vso[task.setvariable variable=packageVersion;isOutput=true;]$(([xml](Get-Content .\Amethyst\Package.appxmanifest)).Package.Identity.Version)"
displayName: Prepare package version variables
name: ParseAppxManifest
- task: DownloadSecureFile@1
name: signingCert
displayName: Download the signing certificate
inputs:
secureFile: "Amethyst_TestingKey.pfx"
- ${{each plugin in parameters.plugins}}:
- task: DownloadGitHubRelease@0
displayName: "Download plugin ${{ plugin }}"
inputs:
connection: github.com_KimihikoAkayasaki
userRepository: "KinectToVR/${{ plugin }}"
defaultVersionType: latest
version: latest
downloadPath: $(artifactDirectory)
- task: ExtractFiles@1
displayName: "Pack plugin ${{ plugin }}"
inputs:
archiveFilePatterns: "$(artifactDirectory)/${{ plugin }}.zip"
destinationFolder: "Amethyst/Plugins/${{ plugin }}"
cleanDestinationFolder: false
# - pwsh: Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My -FilePath "$(signingCert.secureFilePath)" -Password $(ConvertTo-SecureString "$(PackageCertificatePassword)" -AsPlainText -Force)
# displayName: Import the signing certificate
# - task: VSBuild@1
# displayName: Build (publish) Amethyst - Signed
# inputs:
# platform: "$(buildPlatform)"
# solution: "$(solution)"
# configuration: "$(buildConfiguration)"
# msbuildArgs:
# '/t:Amethyst /p:Platform=$(buildPlatform) /p:PlatformTarget=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:GenerateAppxPackageOnBuild=true
# /p:RuntimeIdentifier=win-$(buildPlatform) /t:Amethyst /p:PublishProfile=Amethyst\Properties\PublishProfiles\win-$(buildPlatform).pubxml
# /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="bin\$(buildConfiguration)\net8.0\win-$(buildPlatform)\deploy\\"
# /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile="$(signingCert.secureFilePath)"
# /p:PackageCertificateThumbprint="3C288874D8146BC9860512DAC28ED51528B8C39F" /p:PackageCertificatePassword="$(PackageCertificatePassword)"'
# - task: PowerShell@2
# displayName: Pack Amethyst - Signed
# inputs:
# targetType: inline
# script: Copy-Item -Path "Amethyst\bin\$(buildConfiguration)\net8.0\win-$(buildPlatform)\deploy\Amethyst_$(packageVersion)_Test\Amethyst_$(packageVersion)_$(buildPlatform).msix" -Destination "$(Build.ArtifactStagingDirectory)/Amethyst_$(packageVersion)_$(buildPlatform)_TestSigned.msix"
# - publish: "$(Build.ArtifactStagingDirectory)/Amethyst_$(packageVersion)_$(buildPlatform)_TestSigned.msix"
# displayName: Publish Amethyst - Signed
# artifact: signed
- task: VSBuild@1
displayName: Build (publish) Amethyst - Unpackaged
inputs:
platform: "$(buildPlatform)"
solution: "$(solution)"
configuration: "$(buildConfiguration)"
msbuildArgs:
'/t:Amethyst /p:Platform=$(buildPlatform) /p:PlatformTarget=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:GenerateAppxPackageOnBuild=false
/p:RuntimeIdentifier=win-$(buildPlatform) /t:Amethyst /p:PublishProfile=Amethyst\Properties\PublishProfiles\win-$(buildPlatform).pubxml
/p:WindowsPackageType=None /p:IncludeNativeLibrariesForSelfExtract=true'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'Amethyst\bin\$(buildPlatform)\$(buildConfiguration)\net8.0\win-$(buildPlatform)'
includeRootFolder: false
archiveType: "zip"
archiveFile: "$(Build.ArtifactStagingDirectory)/Amethyst_$(packageVersion)_$(buildPlatform)_Unpackaged.zip"
- publish: "$(Build.ArtifactStagingDirectory)/Amethyst_$(packageVersion)_$(buildPlatform)_Unpackaged.zip"
displayName: Publish Amethyst - Unpackaged
artifact: unpack
- task: GitHubRelease@1
inputs:
gitHubConnection: "github.com_KimihikoAkayasaki"
repositoryName: KinectToVR/Amethyst
action: "edit"
tagSource: "userSpecifiedTag"
tag: artifact
releaseNotesSource: "inline"
releaseNotesInline: "# Testing Setup (Unpackaged) \n### 1. Download the `__Unpackaged` .zip file and extract anywhere\n(Note: No shared AppData is used, it will be forwarded to inside the extracted folder) \n\n### 2. Run `Amethyst.exe` and reregister the driver\n"
isPreRelease: true
changeLogCompareToRelease: "lastFullRelease"
changeLogType: "commitBased"
assets: "$(Build.ArtifactStagingDirectory)/*"
- task: VSBuild@1
displayName: Build (publish) Amethyst - Unsigned
inputs:
platform: "$(buildPlatform)"
solution: "$(solution)"
configuration: "$(buildConfiguration)"
msbuildArgs:
'/t:Amethyst /p:Platform=$(buildPlatform) /p:PlatformTarget=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:GenerateAppxPackageOnBuild=true
/p:RuntimeIdentifier=win-$(buildPlatform) /t:Amethyst /p:PublishProfile=Amethyst\Properties\PublishProfiles\win-$(buildPlatform).pubxml
/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="bin\$(buildConfiguration)\net8.0\win-$(buildPlatform)\deploy\\"
/p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxPackageSigningEnabled=false'
- task: CopyFiles@2
displayName: Pack Amethyst - Unsigned
inputs:
SourceFolder: 'Amethyst\bin\$(buildConfiguration)\net8.0\win-$(buildPlatform)\deploy\Amethyst_$(packageVersion)_Test'
Contents: "Amethyst_$(packageVersion)_$(buildPlatform).msix"
TargetFolder: $(Build.ArtifactStagingDirectory)
preserveTimestamp: true
- publish: "$(Build.ArtifactStagingDirectory)/Amethyst_$(packageVersion)_$(buildPlatform).msix"
displayName: Publish Amethyst - Unsigned
artifact: pack