forked from MscrmTools/MsCrmTools.UserSettingsUtility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
75 lines (63 loc) · 2.15 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
pool:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
variables:
ToolName: 'MsCrmTools.UserSettingsUtility'
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.6.0'
inputs:
versionSpec: 4.6.0
checkLatest: true
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: VSBuild@1
displayName: 'Build solution **\*.sln'
inputs:
solution: '$(Parameters.solution)'
vsVersion: "15.0"
platform: 'any cpu'
configuration: 'release'
- task: "AssembyInfoReader@2"
displayName: 'Get Assembly version'
- task: NuGetCommand@2
displayName: 'Create Nuget package'
inputs:
command: pack
packagesToPack: '**/*.nuspec'
versioningScheme: byEnvVar
versionEnvVar: AssemblyInfo.AssemblyVersion
- task: AzureKeyVault@1
displayName: 'Get Code signin certificate'
inputs:
azureSubscription: 'Visual Studio Ultimate avec MSDN (c15be07d-a965-4473-8099-eac957b8e27a)'
KeyVaultName: XrmToolBoxKeyVault
#SecretsFilter: "CodeSigning-TanguyTouzard"
- powershell: |
# Write your PowerShell commands here.
$kvSecretBytes = [System.Convert]::FromBase64String("$(CodeSigning-TanguyTouzard)")
[System.IO.File]::WriteAllBytes("$(Build.SourcesDirectory)\certificate.pfx", $kvSecretBytes)
displayName: 'Store certificate locally'
- task: NuGetCommand@2
displayName: 'Sign Nuget package'
inputs:
command: custom
arguments: 'sign "$(Build.ArtifactStagingDirectory)\$(ToolName).$(AssemblyInfo.AssemblyVersion).nupkg" -CertificatePath "$(Build.SourcesDirectory)\certificate.pfx" -Timestamper "http://timestamp.digicert.com"'
- powershell: |
# Write your PowerShell commands here.
Remove-Item "$(Build.SourcesDirectory)\certificate.pfx"
displayName: 'Delete local certificate'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: '**\*$(ToolName)*.nupkg'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'