Skip to content

Commit

Permalink
Update azure-pipelines.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny authored Sep 17, 2018
1 parent eb68d13 commit f711412
Showing 1 changed file with 61 additions and 9 deletions.
70 changes: 61 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,66 @@
# ASP.NET Core
# Build and test ASP.NET Core web applications targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/vsts/pipelines/languages/dotnet-core
trigger:
- master
- rel/*

pool:
vmImage: 'Ubuntu 16.04'
vmImage: vs2017-win2016

variables:
buildConfiguration: 'Release'
variables:
BuildConfiguration: Release

steps:
- script: dotnet build src/Humanizer.sln --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

- script: nbgv cloud
displayName: Set Version
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

- task: NuGetToolInstaller@0
displayName: Use NuGet 4.7.0
inputs:
versionSpec: 4.7.0

- task: DotNetCoreCLI@2
inputs:
command: build
projects: .\src\Humanizer.sln
arguments: -c $(BuildConfiguration)
displayName: Build

- powershell: |
mkdir $(Build.ArtifactStagingDirectory)\Packages
$version = .\nbgv get-version -f json | ConvertFrom-Json
ls .\NuSpecs\*.nuspec | %{ nuget pack $_.FullName -version "$($version.NuGetPackageVersion)" -BasePath "src" -NoPackageAnalysis -OutputDirectory $(Build.ArtifactStagingDirectory)\Packages -Properties "RepositoryType=git;RepositoryCommit=$($version.GitCommitId);RepositoryUrl=https://github.com/Humanizr/Humanizer"}
displayName: Create packages
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

- task: DotNetCoreCLI@2
inputs:
command: test
projects: .\src\Humanizer.Tests\Humanizer.Tests.csproj
arguments: -c $(BuildConfiguration) --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/src/CodeCoverage.runsettings /p:DebugType=portable
displayName: Run Tests

- task: PowerShell@2
displayName: Authenticode Sign artifacts
inputs:
filePath: scripts/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: $(Build.ArtifactStagingDirectory)\Packages
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))

- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\Packages
artifactType: container
artifactName: Packages
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

0 comments on commit f711412

Please sign in to comment.