forked from UnigramDev/Unigram
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathazure-pipelines.yml
94 lines (79 loc) · 2.8 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
# 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:
- RS1
- RS2
pool:
vmImage: 'vs2017-win2016'
variables:
solution: '**/UnigramMobile.sln'
buildPlatform: 'ARM'
buildConfiguration: 'Release'
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
steps:
- checkout: self
- task: CmdLine@2
displayName: 'Install tdlib extension'
inputs:
script: |
echo Checkout tdlib VSIX branch
git checkout tdlib
echo Install tdlib extension
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" /q tdlib.vsix
echo Cleanup
git checkout $(Build.SourceBranchName)
# workingDirectory: '$(Build.Repository.LocalPath)'
- task: PowerShell@2
displayName: 'Install windows-sdk-10.1.18362.1'
inputs:
targetType: 'inline'
script: |
# https://chocolatey.org/packages/windows-sdk-10.1#versionhistory
choco install windows-sdk-10.1 --version=10.1.18362.1
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: DownloadSecureFile@1
name: Secrets
displayName: 'Download Constants.Secret.cs.'
inputs:
secureFile: 'Constants.Secret.cs'
- task: CopyFiles@2
displayName: 'Copy Constants.Secret.cs to repository.'
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: 'Constants.Secret.cs'
TargetFolder: '$(Build.Repository.LocalPath)\Unigram\Unigram\'
- task: DownloadSecureFile@1
name: StoreKey
displayName: 'Get the pfx file StoreKey.'
inputs:
secureFile: 'Unigram_StoreKey.pfx'
- task: PowerShell@2
displayName: 'Add the pfx file to the certificate store.'
inputs:
targetType: 'inline'
script: |
$pfxpath = '$(StoreKey.secureFilePath)'
$password = ''
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()
- task: VSBuild@1
inputs:
platform: 'ARM'
vsVersion: '15.0'
solution: '$(solution)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'