-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
75 lines (66 loc) · 1.86 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
name: $(date:yyyy.MM.dd)$(rev:.r)
schedules:
- cron: '0 6 * * *'
displayName: 'Daily 6AM Test Run'
branches:
include:
- main
trigger:
batch: true
branches:
include:
- main
paths:
include:
- /Innovian.Telnyx.Storage
- /Innovian.Telnyx.Storage.Tests
pool: AzureBuildServers
variables:
- name: BuildNumber
value: $(Build.BuildNumber)
- name: ProjectName
value: Innovian.Telnyx.Storage
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet tool'
inputs:
checkLatest: true
versionSpec: '>=6.7.0' # Latest versions at https://dist.nuget.org/tools.json
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
projects: '**/$(ProjectName).csproj'
feedsToUse: 'select'
vstsFeed: '4d1432f3-ac87-4104-a03a-bc658b00a9ea/0fb21d1f-6c0f-493f-9532-64eeda958e26'
noCache: true
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: 'test'
projects: '**/$(ProjectName).Tests.csproj'
env:
Telnyx_ApiKey: $(TelnyxApiKey)
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
condition: and(succeeded(), ne(variables['Build.Reason'], 'Schedule'))
inputs:
command: 'build'
projects: '**/$(ProjectName).csproj'
arguments: '--no-restore'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
condition: and(succeeded(), ne(variables['Build.Reason'], 'Schedule'))
inputs:
command: 'pack'
packagesToPack: '**/$(ProjectName).csproj'
versioningScheme: 'byEnvVar'
versionEnvVar: 'BuildNumber'
- task: PowerShell@2
displayName: 'push to NuGet.org'
condition: and(succeeded(), ne(variables['Build.Reason'], 'Schedule'))
inputs:
targetType: 'inline'
script: 'nuget push "$(Build.ArtifactStagingDirectory)\*.nupkg" -ApiKey $(NuGetApiKey) -Source https://api.nuget.org/v3/index.json'
env:
NuGetApiKey: $(NuGetApiKey)