-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-Nuget.yml
103 lines (91 loc) · 3.14 KB
/
azure-pipelines-Nuget.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
trigger: none
pr: none
name: 1.0.$(rev:r)
pool:
vmImage: 'ubuntu-latest'
variables:
solution: 'src/Majorsoft.CQRS.Repositories.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
AssemblyCompany: 'Majorsoft'
AssemblyAuthor: 'Imre Toth'
AssemblyProduct: 'Majorsoft C(#)QRS Generic Repositories'
AssemblyCopyright: 'Copyright © 2022 Majorsoft'
AssemblyVersion: '${{ parameters.AssemblyVersion }}'
PreviewPackageVersion: '${{ parameters.PreviewPackageVersion }}'
VersionPrefix: $(AssemblyVersion)$(PreviewPackageVersion)
parameters:
- name: AssemblyVersion
displayName: 'Required Nuget package version e.g. "1.0.0"'
type: string
default: ''
- name: PreviewPackageVersion
displayName: 'Optional Preview version e.g. "-rc.2.20479.15"'
type: string
default: ' '
jobs:
- job: BuildAndPublish
displayName: Package Nuget
steps:
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
packageType: 'sdk'
version: '6.0.x' # replace this value with the version that you need for your project
- task: Assembly-Info-NetCore@2
displayName: 'Update Web Assembly Info'
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: '/src/**/*.csproj'
InsertAttributes: true
FileEncoding: 'auto'
WriteBOM: false
Authors: '$(AssemblyAuthor)'
Company: '$(AssemblyCompany)'
Product: '$(AssemblyProduct)'
Description: 'C(#)QRS Generic Repositories for Command and query segragation using EF by Imre Toth'
Copyright: '$(AssemblyCopyright)'
RepositoryType: 'git'
VersionNumber: '$(AssemblyVersion)'
FileVersionNumber: '$(AssemblyVersion)'
InformationalVersion: '$(AssemblyVersion)'
PackageVersion: '$(VersionPrefix)'
GeneratePackageOnBuild: true
LogLevel: 'verbose'
FailOnWarning: false
DisableTelemetry: false
- task: DotNetCoreCLI@2
displayName: 'dotnet restore packages'
inputs:
command: 'restore'
projects: '$(solution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '$(solution)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'run tests'
inputs:
command: 'test'
projects: '**/*.Tests.csproj'
arguments: '--configuration $(buildConfiguration)'
#- task: DotNetCoreCLI@2
# displayName: 'dotnet pack'
# inputs:
# command: 'pack'
# packagesToPack: 'src/Majorsoft.CQRS.Repositories/Majorsoft.CQRS.Repositories.csproj'
# packDirectory: '$(Build.ArtifactStagingDirectory)/nupkgs'
# nobuild: false
# includesymbols: true
# versioningScheme: 'byEnvVar'
# versionEnvVar: '$(AssemblyVersion)$(PreviewPackageVersion)'
- task: DotNetCoreCLI@2
displayName: 'dotnet upload Nuget'
inputs:
command: 'push'
packagesToPush: 'src/Majorsoft.CQRS.Repositories/bin/$(buildConfiguration)/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '4f8b1f2e-37e5-4c51-b721-13f56be6a30d'