-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
99 lines (81 loc) · 2.62 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
resources:
repositories:
- repository: "Azure Repos Mirror"
type: git
name: namomo/ccs
variables:
- group: azure-repos-sync
jobs:
- job: Build
displayName: "Build, Test and Publish"
pool:
vmImage: ubuntu-latest
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: 'echo "ref: $(Build.SourceBranch)" > $(Build.SourcesDirectory)/.git/ADO_OVERRIDE_HEAD'
displayName: 'Set Source Branch'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.0.x'
displayName: 'Setup Build Environment'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
displayName: 'Build the Module'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
testRunTitle: 'Run unit tests'
displayName: 'Run Unit Tests'
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'pack'
arguments: '-c Release -p:DevelopMode=Release -o $(Build.ArtifactStagingDirectory)'
displayName: 'Package for NuGet'
- task: DotNetCoreCLI@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '5f8d36de-7004-4c36-a8b5-8a4bda9eb598/c2949ad7-bda3-4f23-a41b-3109c9419cb7'
displayName: 'Push to NuGet Feed'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'pack'
arguments: '-c Release -p:CIRevision=$(Build.BuildId)-$(Build.SourceVersion) -o $(Build.ArtifactStagingDirectory)'
displayName: 'Package for Preview Version'
- task: DotNetCoreCLI@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '5f8d36de-7004-4c36-a8b5-8a4bda9eb598/a195bd6e-4492-4434-b152-e450f6b11d5d'
displayName: 'Push to Dev NuGet Feed'
- job: Sync
displayName: "Sync with Azure Repos"
pool:
vmImage: windows-latest
steps:
- task: gitmirror@0
inputs:
GitRepoUrl: 'https://tlylz:$(SYNC_PAT)@dev.azure.com/tlylz/namomo/_git/ccs'
displayName: 'Sync via Git Tools'