Skip to content

Commit

Permalink
Fix Azure pipeline conditional template
Browse files Browse the repository at this point in the history
  • Loading branch information
blumu committed Aug 17, 2019
1 parent 19534b2 commit 4fe56e8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
14 changes: 14 additions & 0 deletions pipeline-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Azure DevOps Pipeline for continuous integration to build, test and package the nuget
#
# The following variables are settable at queue time.
# BuildConfiguration - Debug | Release
# NUGET_PACKAGE_VERSION - (Optional) Override the Nuget version tag that normally gets inferred from RELEASENOTES.md file

pool:
vmImage: windows-2019

steps:
- template: pipeline-template-build-test-sign.yml
parameters:
SignBuild: 'false'
PublishRelease: 'false'
20 changes: 20 additions & 0 deletions pipeline-signrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# VSTS pipeline to build, test, package, sign and release a new nuget package
#
# Requirements: define the following Azure DevOps connections
# FSharpLu-nuget - Nuget feed service connection (for pushing new packages)
# FSharpLu-Github - Github service connection (for pushing new releases)
#
# Variables overridden at queue time:
# NUGET_PACKAGE_VERSION - (Optional) Override the Nuget version tag that normally gets inferred from releasenotes.md file

pool:
vmImage: windows-2019

variables:
BuildConfiguration: 'release'

steps:
- template: pipeline-template-build-test-sign.yml
parameters:
SignBuild: true
PublishRelease: true
27 changes: 11 additions & 16 deletions CI-vsts.yml → pipeline-template-build-test-sign.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# VSTS pipeline to build, test, package, sign and release a new nuget package
#
# Requirements: define the following Azure DevOps connections
# FSharpLu-nuget - Nuget feed service connection (for pushing new packages)
# FSharpLu-Github - Github service connection (for pushing new releases)
# The following variables are used.
# BuildConfiguration - Debug | Release
# NUGET_PACKAGE_VERSION - (Optional) Override the Nuget version tag that normally gets inferred from releasenotes.md file
#
# The following variables are settable at queue time.
# BuildConfiguration
# BuildPlatform
# The following template parameters are consumed:
# SignBuild - Set to 'true' if code signing is required
# PublishRelease - Set to 'true' to publish a new release to Github and Nuget
# NUGET_PACKAGE_VERSION - (Optional) Override the Nuget version tag that normally gets inferred from releasenotes.md file

pool:
vmImage: windows-2019
parameters:
SignBuild: 'false'
PublishRelease: 'false'

steps:
- task: DotNetCoreInstaller@0
Expand Down Expand Up @@ -44,7 +40,7 @@ steps:
#-------------------------------------------------------------------------------------------------------------------#
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if eq(variables['SignBuild'], 'true') }}:
- ${{ if eq(parameters.SignBuild, 'true') }}:
- task: DotNetCoreCLI@2
displayName: dotnet build with delaysigning
inputs:
Expand Down Expand Up @@ -89,7 +85,7 @@ steps:
#-------------------------------------------------------------------------------------------------------------------#
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if eq(variables['SignBuild'], 'true') }}:
- ${{ if eq(parameters.SignBuild, 'true') }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP CodeSign Nuget Package
inputs:
Expand Down Expand Up @@ -146,9 +142,8 @@ steps:
#-------------------------------------------------------------------------------------------------------------------#
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if and(eq(variables['SignBuild'], 'true'), eq(variables['PublishRelease'], 'true')) }}:
- ${{ if and(eq(parameters.SignBuild, 'true'), eq(parameters.PublishRelease, 'true')) }}:
- task: GitHubRelease@0
condition: eq(variables['PublishRelease'], 'true')
inputs:
gitHubConnection: 'FSharpLu-Github'
repositoryName: '$(Build.Repository.Name)'
Expand All @@ -159,7 +154,7 @@ steps:
title: 'FSharpLu Release $(NUGET_PACKAGE_VERSION)'
releaseNotesSource: 'input'
releaseNotes: 'Signed release $(NUGET_PACKAGE_VERSION)
https://www.nuget.org/packages/Microsoft.FSharpLu/
https://www.nuget.org/packages/Microsoft.FSharpLu.Json/
https://www.nuget.org/packages/Microsoft.FSharpLu.Windows/'
Expand Down

0 comments on commit 4fe56e8

Please sign in to comment.