From 5930fedbd24c85f2215e7ac7c507f6787844c0bc Mon Sep 17 00:00:00 2001 From: Peter Ombwa Date: Wed, 6 May 2020 12:50:50 -0700 Subject: [PATCH] Update Azure pipelines --- .azure-pipelines/generate-beta-modules.yml | 2 +- tools/GenerateAuthenticationModule.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/generate-beta-modules.yml b/.azure-pipelines/generate-beta-modules.yml index 5004038375f..48b265ee889 100644 --- a/.azure-pipelines/generate-beta-modules.yml +++ b/.azure-pipelines/generate-beta-modules.yml @@ -42,7 +42,7 @@ jobs: displayName: 'Build Auth Modules' inputs: filePath: '$(System.DefaultWorkingDirectory)/tools/GenerateAuthenticationModule.ps1' - arguments: '-RepositoryApiKey $(Api_Key) -ArtifactsLocation $(Build.ArtifactStagingDirectory) -Build -EnableSigning' + arguments: '-RepositoryApiKey $(Api_Key) -ArtifactsLocation $(Build.ArtifactStagingDirectory) -Build -BuildWhenEqual -EnableSigning' pwsh: true - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 diff --git a/tools/GenerateAuthenticationModule.ps1 b/tools/GenerateAuthenticationModule.ps1 index c4a2fe022f7..c798a280c20 100644 --- a/tools/GenerateAuthenticationModule.ps1 +++ b/tools/GenerateAuthenticationModule.ps1 @@ -7,7 +7,8 @@ Param( [switch] $Build, [switch] $Pack, [switch] $Publish, - [switch] $EnableSigning + [switch] $EnableSigning, + [switch] $BuildWhenEqual ) enum VersionState { Invalid @@ -43,10 +44,10 @@ if ($null -eq $ManifestContent.ModuleVersion) { if ($VersionState.Equals([VersionState]::Invalid)) { Write-Error "The specified version in $ModulePrefix.$ModuleName module is either higher or lower than what's on $RepositoryName. Update 'ModuleVersion' in $AuthModulePath$AuthModuleManifest." } -elseif ($VersionState.Equals([VersionState]::EqualToFeed)) { +elseif ($VersionState.Equals([VersionState]::EqualToFeed) -and !$BuildWhenEqual) { Write-Warning "$ModulePrefix.$ModuleName module skipped. Version has not changed and is equal to what's on $RepositoryName." } -elseif ($VersionState.Equals([VersionState]::Valid) -or $VersionState.Equals([VersionState]::NotOnFeed)) { +elseif ($VersionState.Equals([VersionState]::Valid) -or $VersionState.Equals([VersionState]::NotOnFeed) -or $BuildWhenEqual) { $ModuleVersion = $VersionState.Equals([VersionState]::NotOnFeed) ? "0.1.1" : $ManifestContent.ModuleVersion # Build and pack generated module. if ($Build) {