Skip to content

Commit 9b456d8

Browse files
committed
Set up CI with Azure Pipelines
additional pipeline with different release strategy [skip ci]
1 parent 80d3b37 commit 9b456d8

File tree

1 file changed

+9
-30
lines changed

1 file changed

+9
-30
lines changed

azure-pipelines.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
trigger:
44
branches:
55
include:
6-
- master
7-
- features/*
8-
- feature/*
9-
- releases/*
6+
- dev/*
107
paths:
118
exclude:
129
- docs/*
@@ -17,7 +14,7 @@ variables:
1714
- group: GitRelease
1815

1916
- name: patch
20-
value: $[counter('versioncounter', 100)]
17+
value: $[counter('versioncounter', 1)]
2118
- name: buildPlatform
2219
value: 'Any CPU'
2320
- name: buildConfiguration
@@ -32,12 +29,6 @@ variables:
3229
value: '$(gitAccessToken)'
3330
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
3431
value: 1
35-
- name: BUILD_PUBLISH_ARTIFACTS
36-
value: $[or(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))]
37-
- name: BUILD_IS_RELEASE
38-
value: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')]
39-
- name: BUILD_IS_ALPHA
40-
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
4132

4233
pool:
4334
vmImage: 'windows-2019'
@@ -88,7 +79,7 @@ jobs:
8879
searchFolder: '$(System.DefaultWorkingDirectory)'
8980

9081
- task: PowerShell@2
91-
condition: and(succeeded(), eq(variables['BUILD_PUBLISH_ARTIFACTS'], 'True'))
82+
condition: and(succeeded())
9283
displayName: dotnet publish
9384
inputs:
9485
targetType: 'inline'
@@ -103,19 +94,8 @@ jobs:
10394
& dotnet publish $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -r win-x64 -f netcoreapp2.1 -c $(buildConfiguration) --self-contained false -o $(Build.ArtifactStagingDirectory)\cli-netcore2.1-shared
10495
10596
- task: PowerShell@2
106-
condition: and(succeeded(), eq(variables['BUILD_IS_RELEASE'], 'True'))
107-
displayName: dotnet pack release
108-
inputs:
109-
targetType: 'inline'
110-
script: |
111-
mkdir $(Build.ArtifactStagingDirectory)\nupkg
112-
Write-Host $(PackageVersion)
113-
Write-Host $(PackageVersionCLI)
114-
& dotnet pack $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)\nupkg /p:PackAsTool=true /p:VersionPrefix=$(PackageVersionCLI) /p:SymbolPackageFormat=snupkg --include-symbols --version-suffix=beta
115-
116-
- task: PowerShell@2
117-
condition: and(succeeded(), eq(variables['BUILD_IS_ALPHA'], 'True'))
118-
displayName: dotnet pack alpha
97+
condition: and(succeeded())
98+
displayName: dotnet pack dev
11999
inputs:
120100
targetType: 'inline'
121101
script: |
@@ -126,32 +106,31 @@ jobs:
126106
$commandSample = "dotnet pack $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)\nupkg /p:PackAsTool=true /p:VersionPrefix=$(PackageVersionCLI) /p:SymbolPackageFormat=snupkg --include-symbols --version-suffix=alpha"
127107
Write-Host $commandSample
128108
Invoke-Expression $commandSample
129-
& dotnet pack $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)\nupkg /p:PackAsTool=true /p:VersionPrefix=$(PackageVersionCLI) /p:SymbolPackageFormat=snupkg --include-symbols --version-suffix=alpha
130109
131110
- task: CopyFiles@2
132-
condition: and(succeeded(), eq(variables['BUILD_PUBLISH_ARTIFACTS'],'True'))
111+
condition: and(succeeded())
133112
inputs:
134113
SourceFolder: '$(Build.SourcesDirectory)'
135114
Contents: |
136115
**/*.md
137116
TargetFolder: '$(Build.ArtifactStagingDirectory)'
138117

139118
- task: PowerShell@2
140-
condition: and(succeeded(), eq(variables['BUILD_PUBLISH_ARTIFACTS'],'True'))
119+
condition: and(succeeded())
141120
displayName: zip artifacts
142121
inputs:
143122
targetType: 'inline'
144123
script: |
145124
7z a $(Build.ArtifactStagingDirectory)\TemplateGenerator_$(PackageVersion)_win64.zip $(Build.ArtifactStagingDirectory)\*
146125
147126
- task: PublishPipelineArtifact@0
148-
condition: and(succeeded(), eq(variables['BUILD_PUBLISH_ARTIFACTS'],'True'))
127+
condition: and(succeeded())
149128
inputs:
150129
artifactName: 'drop'
151130
targetPath: '$(Build.ArtifactStagingDirectory)\TemplateGenerator_$(PackageVersion)_win64.zip'
152131

153132
- task: PublishPipelineArtifact@0
154-
condition: and(succeeded(), eq(variables['BUILD_PUBLISH_ARTIFACTS'],'True'))
133+
condition: and(succeeded())
155134
inputs:
156135
artifactName: 'nupkg'
157136
targetPath: '$(Build.ArtifactStagingDirectory)\nupkg'

0 commit comments

Comments
 (0)