-
Notifications
You must be signed in to change notification settings - Fork 13
/
azure-pipelines.yml
63 lines (54 loc) · 1.57 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
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
BuildConfiguration: 'Release'
BuildPlatform: 'any cpu'
PathToBuildProjects: '**/*.csproj'
PathToNugetProjects: '**/Blazor.PersianDatePicker.csproj'
steps:
#task: Use .NET Core sdk 5.x
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 5.x'
inputs:
version: 5.x
#task: Restore
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: $(PathToBuildProjects)
#task: Build
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: $(PathToBuildProjects)
arguments: '--configuration $(BuildConfiguration)'
#task: Install Nuget tool otherwise following task with powershell command nuget push will fail
- task: NuGetToolInstaller@1
displayName: 'Install Nuget Tool'
inputs:
versionSpec: '5.7.0'
checkLatest: true
#task: Pack
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: $(PathToNugetProjects)
#task: NuGet push nuget.org
#link: https://stackoverflow.com/questions/52920786/publish-nuget-package-using-azure-devops
- task: PowerShell@2
displayName: 'NuGet push nuget.org'
inputs:
targetType: 'inline'
script: 'nuget push $(Build.ArtifactStagingDirectory)\*.nupkg -ApiKey $env:Api_Key -Source https://api.nuget.org/v3/index.json -SkipDuplicate'
env:
Api_Key: $(FeriApiKey)
#task: Publish Artifact
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()