-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
83 lines (76 loc) · 2.97 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
# 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:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'x86|x64|ARM'
buildConfiguration: 'Release'
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: DownloadSecureFile@1
displayName: 'Download Store Key'
inputs:
secureFile: MorseCode.UWP.pfx
retryCount: 5
- task: CopyFiles@2
displayName: 'Copy Files to: MorseCode.UWP'
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: MorseCode.UWP.pfx
TargetFolder: MorseCode.UWP/
- powershell: |
$pfxpath = 'MorseCode.UWP/MorseCode.UWP.pfx'
$password = 'AVKApps'
Add-Type -AssemblyName System.Security
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")
$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "MY", CurrentUser
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
$store.Add($cert)
$store.Close()
displayName: 'PowerShell Script to Sign'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Installing Microsoft Engagement Framework..."
$msiPath = "$($env:USERPROFILE)\MicrosoftStoreServicesSDK.msi"
(New-Object Net.WebClient).DownloadFile('https://admediator.gallerycdn.vsassets.io/extensions/admediator/microsoftstoreservicessdk/10.0.5/1550117536112/MicrosoftStoreServicesSDK.msi', $msiPath)
cmd /c start /wait msiexec /i $msiPath /quiet
Write-Host "Installed" -ForegroundColor green
- task: VSBuild@1
displayName: 'Build VS'
inputs:
solution: '$(solution)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
platform: x64
clean: true
createLogFile: true
logFileVerbosity: detailed
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**\bin\$(BuildConfiguration)\**'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
- task: fizzcode-discordhook@1
displayName: 'Discord Webhook'
inputs:
DiscordChannelID: '1179896808256847932'
DiscordToken: 'SyFcjXvSLc1TVErsJZ7R_2bgNG9x97aKm9s0xMnPi_kUAQ3_oTAnel0DEvOvFY62ARF3'
Title: '$Build $(Build.BuildNumber) succeeded ($(Build.Reason))'
Message: '$(Build.SourceVersionMessage)'