forked from navferty/NavfertyExcelAddIn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-publish.yml
89 lines (80 loc) · 2.84 KB
/
azure-pipelines-publish.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
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
pool:
vmImage: 'windows-latest'
variables:
solutionFolder: '$(Build.SourcesDirectory)/NavfertyExcelAddIn'
solution: '$(Build.SourcesDirectory)/NavfertyExcelAddIn.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
# patchVersion: counter with the prefix as minorVersion, and seed as 0.
patchVersion: $[counter(variables['minorVersion'], 0)]
buildId: '$(Build.BuildId)'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Import Certificate"
$pfxpath = '$(solutionFolder)/$(certfile)'
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:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '$(msbuildArgs) /p:Version="$(majorVersion).$(minorVersion).$(patchVersion).$(buildId)"'
- task: CopyFiles@2
inputs:
SourceFolder: '$(solutionFolder)/bin/Release/app.publish/'
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'InstallationFiles'
publishLocation: 'Container'
# Upload navferty.ru website contents
- task: FtpUpload@2
name: 'UploadWebsite'
inputs:
credentialsOption: 'inputs'
serverUrl: 'ftps://ftp.navferty.ru'
username: '$(ftpUsername)'
password: '$(ftpPassword)'
rootDirectory: '$(Build.SourcesDirectory)/Website/'
filePatterns: '**'
remoteDirectory: '/' # navferty.ru/website
clean: false
cleanContents: true
preservePaths: true
trustSSL: true
# Upload build artifacts with (all files except setup.exe)
- task: FtpUpload@2
name: 'UploadInstallationFiles'
inputs:
credentialsOption: 'inputs'
serverUrl: 'ftps://ftp.navferty.ru'
username: '$(ftpUsername)'
password: '$(ftpPassword)'
rootDirectory: '$(Build.ArtifactStagingDirectory)'
filePatterns: |
**/*.deploy
**/*.manifest
**/*.vsto
remoteDirectory: '/deploy/' # navferty.ru/deploy
clean: false
cleanContents: true
preservePaths: true
trustSSL: true