-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
azure-pipelines-task-tools.yml
115 lines (101 loc) · 2.96 KB
/
azure-pipelines-task-tools.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
trigger:
branches:
include:
- main
- develop
- release-*
paths:
include:
- Tools.BuildTasks-2019
tags:
include:
- refs/tags/v*
# PR always trigger build
pr:
autoCancel: true
pool:
vmImage: 'windows-latest'
variables:
DOTNET_NOLOGO: true
steps:
- checkout: self
persistCredentials: true
- task: NuGetToolInstaller@1
condition: succeeded()
displayName: 'Install specific version of NuGet'
inputs:
versionSpec: '>=5.10.0'
- task: UseDotNet@2
displayName: Install .NET 6.0 SDK
inputs:
packageType: sdk
version: 6.x
performMultiLevelLookup: true
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
condition: succeeded()
inputs:
command: restore
verbosityRestore: minimal
projects: Tools.BuildTasks-2019/Tools.BuildTasks-2019.csproj
feedsToUse: config
nugetConfigPath: NuGet.Config
- script: dotnet build Tools.BuildTasks-2019.csproj -c 'Release' -p:Configuration=Release -p:Platform="Any CPU" -p:PublicRelease=true --no-restore /t:build,pack
displayName: Build NuGet package
condition: succeeded()
workingDirectory: '$(System.DefaultWorkingDirectory)/Tools.BuildTasks-2019'
- task: CopyFiles@1
condition: succeeded()
displayName: Collecting deployable artifacts
inputs:
sourceFolder: $(Agent.BuildDirectory)
Contents: |
**\nanoFramework.Tools.BuildTasks*.nupkg
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: DotNetCoreCLI@2
displayName: Install SignTool tool
condition: succeeded()
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Build.ArtifactStagingDirectory)" `
--input "**/*.nupkg" `
--config "$(Build.Repository.LocalPath)\config\SignClient.json" `
--filelist "$(Build.Repository.LocalPath)\config\filelist.txt" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name ".NET nanoFramework Tools.BuildTasks" `
--description ".NET nanoFramework Tools.BuildTasks" `
--descriptionUrl "https://github.com/$env:Build_Repository_Name"
displayName: Sign packages
continueOnError: true
condition: succeeded()
# publish artifacts
- task: PublishBuildArtifacts@1
condition: succeeded()
displayName: Publish deployables artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: deployables
ArtifactType: Container
# push NuGet packages to NuGet
- task: NuGetCommand@2
displayName: Push NuGet packages to NuGet
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
)
continueOnError: true
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
allowPackageConflicts: true
includeSymbols: true
publishFeedCredentials: 'NuGet-$(System.TeamProject)'