-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.yaml
57 lines (56 loc) · 1.94 KB
/
build.yaml
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
name: $(Date:yyyyMMdd)$(Rev:.r)
pool:
vmImage: "windows-latest"
jobs:
- job: Build
steps:
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: "Update SharedAssemblyInfo version"
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'
additionalArguments: '/updateassemblyinfo .\src\SharedAssemblyInfo.cs'
- task: gitversion/execute@0
displayName: "Update dotnet csproj assembly version"
inputs:
targetPath: '$(Build.SourcesDirectory)'
useConfigFile: true
configFilePath: 'GitVersion.yml'
additionalArguments: '/updateprojectfiles'
- task: DotNetCoreCLI@2
displayName: "Dotnet Restore"
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
- task: DotNetCoreCLI@2
displayName: "Build"
inputs:
command: 'build'
arguments: --no-restore -c "Release"
- task: DotNetCoreCLI@2
displayName: "Dotnet Pack"
inputs:
command: 'pack'
packagesToPack: '**/*.csproj'
versioningScheme: 'byEnvVar'
versionEnvVar: 'GitVersion.NuGetVersion'
includeSymbols: true
nobuild: true
- task: DotNetCoreCLI@2
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')))
displayName: "Push to Artifact feed"
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '8e7d8e9a-96b7-4364-985a-625841ad216e/f096d8c4-c6ef-4c3f-ab64-f47f1c625b2e'
arguments: --no-symbols
- task: PublishPipelineArtifact@1
displayName: "Publish Build Artifact"
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: Packages