Skip to content

Commit

Permalink
Update azure-pipelines.yml for AppCenter
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Feb 27, 2021
1 parent 43575bb commit 9462a3b
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pool:
vmImage: 'windows-latest'

variables:
group: status-app
solution: 'status/csharp/csharp.sln'
buildPlatform: 'x86|x64|ARM'
buildConfiguration: 'Release'
Expand All @@ -18,6 +19,28 @@ variables:
steps:
- task: NuGetToolInstaller@1

- task: DownloadSecureFile@1
name: mySecureFile
inputs:
secureFile: '$(signing.keystore)'

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Start adding the PFX file to the certificate store."
$pfxpath = '$(mySecureFile.keystore)'
$password = '$(signing.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: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
Expand All @@ -27,4 +50,33 @@ steps:
platform: 'x86'
solution: '$(solution)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)"
/p:AppxPackageDir="$(appxPackageDir)"
/p:AppxBundle=Always
/p:UapAppxPackageBuildMode=StoreUpload
/p:AppxPackageSigningEnabled=true
/p:PackageCertificateThumbprint="$(signing.thumbprint)"
/p:PackageCertificateKeyFile="$(signing.keystore)"
/p:PackageCertificatePassword="$(signing.password)"'

- 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: AppCenterDistribute@3
inputs:
serverEndpoint: 'VSAC'
appSlug: '$(appSlug)'
appFile: '$(build.artifactstagingdirectory)\AppxPackages\*.appxupload'
releaseNotesOption: 'input'
releaseNotesInput: 'New release!'
destinationType: 'groups'
distributionGroupId: '$(distributionGroup)'

0 comments on commit 9462a3b

Please sign in to comment.