-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update azure-pipelines.yml for Azure Pipelines (#20)
* Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines
- Loading branch information
Showing
1 changed file
with
92 additions
and
54 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,55 +1,93 @@ | ||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'vs2017-win2016' | ||
|
||
steps: | ||
- checkout: self | ||
submodules: recursive | ||
|
||
- task: NuGetToolInstaller@1 | ||
displayName: 'Install NuGet CLI' | ||
inputs: | ||
versionSpec: '5.0.2' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'nuget restore' | ||
inputs: | ||
command: 'restore' | ||
restoreSolution: 'IIS.Compression\Compression.sln' | ||
verbosityPack: 'Normal' | ||
|
||
- task: MSBuild@1 | ||
displayName: 'Build x86' | ||
inputs: | ||
solution: 'IIS.Compression\Compression.sln' | ||
platform: 'x86' | ||
configuration: 'Release' | ||
msbuildArguments: '/v:m' | ||
|
||
- task: MSBuild@1 | ||
displayName: 'Build x64' | ||
inputs: | ||
solution: 'IIS.Compression\Compression.sln' | ||
platform: 'x64' | ||
configuration: 'Release' | ||
msbuildArguments: '/v:m' | ||
|
||
- script: | | ||
xcopy .\IIS.Compression\bin\Release\x86\* .\build\32bit\ /I | ||
xcopy .\IIS.Compression\bin\Release\x64\* .\build\64bit\ /I | ||
displayName: 'Copy build artifacts' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'Pack NuGet' | ||
inputs: | ||
command: 'pack' | ||
packagesToPack: '.\IIS.Compression.SiteExtension.nuspec' | ||
packDestination: '$(System.DefaultWorkingDirectory)/dist' | ||
versioningScheme: 'off' | ||
basePath: '.\build' | ||
verbosityPack: 'Normal' | ||
|
||
- publish: dist | ||
artifact: nupkg | ||
branches: | ||
include: | ||
- master | ||
tags: | ||
include: | ||
- v* | ||
|
||
stages: | ||
- stage: Build | ||
jobs: | ||
- job: Build | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
steps: | ||
- checkout: self | ||
submodules: recursive | ||
|
||
- task: NuGetToolInstaller@1 | ||
displayName: 'Install NuGet CLI' | ||
inputs: | ||
versionSpec: '5.0.2' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'nuget restore' | ||
inputs: | ||
command: 'restore' | ||
restoreSolution: 'IIS.Compression\Compression.sln' | ||
verbosityPack: 'Normal' | ||
|
||
- task: MSBuild@1 | ||
displayName: 'Build x86' | ||
inputs: | ||
solution: 'IIS.Compression\Compression.sln' | ||
platform: 'x86' | ||
configuration: 'Release' | ||
msbuildArguments: '/v:m' | ||
|
||
- task: MSBuild@1 | ||
displayName: 'Build x64' | ||
inputs: | ||
solution: 'IIS.Compression\Compression.sln' | ||
platform: 'x64' | ||
configuration: 'Release' | ||
msbuildArguments: '/v:m' | ||
|
||
- script: | | ||
xcopy .\IIS.Compression\bin\Release\x86\* .\build\32bit\ /I | ||
xcopy .\IIS.Compression\bin\Release\x64\* .\build\64bit\ /I | ||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') | ||
displayName: 'Copy build artifacts' | ||
- powershell: 'echo "##vso[task.setvariable variable=PackageVersion]$($env:Build_SourceBranchName.Substring(1))"' | ||
displayName: 'PowerShell Script' | ||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'Pack NuGet' | ||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') | ||
inputs: | ||
command: 'pack' | ||
packagesToPack: '.\IIS.Compression.SiteExtension.nuspec' | ||
packDestination: '$(System.DefaultWorkingDirectory)/dist' | ||
versioningScheme: byEnvVar | ||
versionEnvVar: PackageVersion | ||
basePath: '.\build' | ||
verbosityPack: 'Normal' | ||
|
||
- publish: dist | ||
artifact: nupkg | ||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') | ||
|
||
- stage: Publish | ||
dependsOn: | ||
- Build | ||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) | ||
jobs: | ||
- deployment: Publish_Nupkg | ||
environment: nuget | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- task: NuGetCommand@2 | ||
displayName: 'NuGet push' | ||
inputs: | ||
command: push | ||
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg' | ||
nuGetFeedType: external | ||
publishFeedCredentials: NuGet | ||
verbosityPush: Normal |