-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
120 lines (106 loc) · 3.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# https://aka.ms/yaml
trigger:
branches:
include:
- master
- features/*
- releases/*
paths:
exclude:
- README.md
- azure-pipelines.yml
pr:
autoCancel: true
branches:
include:
- master
- releases/*
variables:
patch: $[counter('versioncounter', 100)]
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
pool:
vmImage: 'windows-2019'
jobs:
- job: Build
displayName: change project and build
condition: succeeded()
steps:
- task: PowerShell@2
displayName: Update version
inputs:
filePath: 'build\update-version-append.ps1'
arguments: '$(patch) $(Build.SourcesDirectory)\src\Amusoft.CodeAnalysis.Analyzers\Amusoft.CodeAnalysis.Analyzers.csproj $(Build.SourcesDirectory)\src\Amusoft.CodeAnalysis.Analyzers.Vsix\source.extension.vsixmanifest'
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.4.0
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
- task: VSBuild@1
inputs:
solution: '**\*.sln'
vsVersion: '16.0'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
- task: DotNetCoreCLI@2
displayName: dotnet test *.csproj
inputs:
command: 'test'
projects: '**/*test*/*.csproj'
publishTestResults: true
- task: CopyFiles@2
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')))
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
README.md
build/**
**/*.vsix
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishPipelineArtifact@0
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')))
inputs:
artifactName: 'drop'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: PublishGitHubRelease@0
displayName: 'Publish-GitHub-Alpha'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
applicationName: 'Amusoft.CodeAnalysis.Analyzers'
gitSourceOption: 'github'
token: '$($gitAccessToken)'
repo: 'Amusoft.CodeAnalysis.Analyzers'
owner: 'taori'
tagName: 'alpha-$(PackageVersion)'
releaseName: 'alpha-$(PackageVersion)'
releaseBody: 'automated release from Azure DevOps'
draft: false
prerelease: true
assetsPattern: '$(build.artifactstagingdirectory)\**\*.vsix'
- task: PublishGitHubRelease@0
displayName: 'Publish-GitHub-Release'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'))
inputs:
applicationName: 'Amusoft.CodeAnalysis.Analyzers'
gitSourceOption: 'github'
token: '$($gitAccessToken)'
repo: 'Amusoft.CodeAnalysis.Analyzers'
owner: 'taori'
tagName: 'release-$(PackageVersion)'
releaseName: 'release-$(PackageVersion)'
releaseBody: 'automated release from Azure DevOps'
draft: false
prerelease: false
assetsPattern: '$(build.artifactstagingdirectory)\**\*.vsix'
- task: PublishPipelineArtifact@1
displayName: 'Publish-Vsix-Marketplace'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'))
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'