-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated azure=pipelines.yml to support new multi-stage build/rdeploym…
…ent format
- Loading branch information
Showing
1 changed file
with
75 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,85 @@ | ||
# .NET Desktop | ||
# Build and run tests for .NET Desktop or Windows classic desktop solutions. | ||
# Add steps that publish symbols, save build artifacts, and more: | ||
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net | ||
|
||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
stages: | ||
- stage: build | ||
jobs: | ||
- job: Build | ||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
variables: | ||
- group: Invisionware.Collections | ||
- name: solution | ||
value: '**/*.sln' | ||
- name: buildPlatform | ||
value: 'Any CPU' | ||
- name: buildConfiguration | ||
value: 'Release' | ||
- name: buildTarget | ||
value: 'Nuget-Package' | ||
variables: | ||
- group: Invisionware.Collections | ||
- name: solution | ||
value: '**/*.sln' | ||
- name: buildPlatform | ||
value: 'Any CPU' | ||
- name: buildConfiguration | ||
value: 'Release' | ||
- name: buildTarget | ||
value: 'Nuget-Package' | ||
steps: | ||
- task: NuGetToolInstaller@1 | ||
displayName: 'Install Nuget Tools' | ||
|
||
steps: | ||
- task: NuGetToolInstaller@1 | ||
displayName: 'Install Nuget Tools' | ||
- task: NuGetCommand@2 | ||
displayName: 'Restore nuget packages' | ||
inputs: | ||
restoreSolution: '$(solution)' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'Restore nuget packages' | ||
inputs: | ||
restoreSolution: '$(solution)' | ||
- task: replacetokens@3 | ||
displayName: 'Transform appsetings.json' | ||
inputs: | ||
rootDirectory: '$(Build.SourcesDirectory)/tests' | ||
targetFiles: '**/appSettings.json' | ||
encoding: 'auto' | ||
writeBOM: true | ||
escapeType: 'json' | ||
verbosity: 'detailed' | ||
actionOnMissing: 'warn' | ||
keepToken: false | ||
tokenPrefix: '#{' | ||
tokenSuffix: '}#' | ||
|
||
- task: replacetokens@3 | ||
displayName: 'Transform appsetings.json' | ||
inputs: | ||
rootDirectory: '$(Build.SourcesDirectory)/tests' | ||
targetFiles: '**/appSettings.json' | ||
encoding: 'auto' | ||
writeBOM: true | ||
escapeType: 'json' | ||
verbosity: 'detailed' | ||
actionOnMissing: 'warn' | ||
keepToken: false | ||
tokenPrefix: '#{' | ||
tokenSuffix: '}#' | ||
- task: Cake@0 | ||
displayName: 'Build Solution: Cake' | ||
inputs: | ||
script: 'build.cake' | ||
target: '$(buildTarget)' | ||
verbosity: 'Verbose' | ||
arguments: '-NugetArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)' | ||
|
||
- task: Cake@0 | ||
displayName: 'Build Solution: Cake' | ||
inputs: | ||
script: 'build.cake' | ||
target: '$(buildTarget)' | ||
verbosity: 'Verbose' | ||
arguments: '-NugetArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)' | ||
- task: PublishTestResults@2 | ||
displayName: 'Unit Tests: Publish results' | ||
enabled: true | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/tests/**/*.trx' | ||
mergeTestResults: true | ||
failTaskOnFailedTests: true | ||
|
||
- task: PublishTestResults@2 | ||
displayName: 'Unit Tests: Publish results' | ||
enabled: true | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/tests/**/*.trx' | ||
mergeTestResults: true | ||
failTaskOnFailedTests: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish Artifacts' | ||
enabled: true | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
ArtifactName: 'drop' | ||
publishLocation: 'Container' | ||
|
||
- stage: nuget_deploy | ||
jobs: | ||
- deployment: nuget_deploy | ||
pool: | ||
vmImage: 'windows-latest' | ||
environment: nuget | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- task: NuGetCommand@2 | ||
inputs: | ||
command: 'push' | ||
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' | ||
nuGetFeedType: 'external' | ||
publishFeedCredentials: 'Github Connection' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish Artifacts' | ||
enabled: true | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
ArtifactName: 'drop' | ||
publishLocation: 'Container' |