diff --git a/azure-gitversion.ps1 b/azure-gitversion.ps1 index babbd4f..3c1c728 100644 --- a/azure-gitversion.ps1 +++ b/azure-gitversion.ps1 @@ -86,7 +86,7 @@ elseif ($CurrentBranch -match "release") throw "Could not extract version info from Git branch name " + $CurrentBranchName } } -elseif ($CurrentBranch -match "features") +elseif ($CurrentBranch -match "feature") { $VersionSuffix = if ($NumberOfCommits -eq 0) { "-" + $CurrentBranchName } else { "-" + $CurrentBranchName + "." + [string]$NumberOfCommits } $SemVersion = [string]$MajorVersion + "." + [string]$MinorVersion + "." + [string]$PatchVersion + $VersionSuffix diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f0ef4a5..bb48cb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,10 +16,12 @@ steps: secureFile: ClientCert.p12 - task: SSMClientToolsSetup@1 displayName: 'Setup DigiCert Tools' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) inputs: APIKey: '$(SM_API_KEY)' - task: PowerShell@2 displayName: 'Prepare DigiCert Code Signing' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) inputs: targetType: 'inline' script: | @@ -83,8 +85,10 @@ steps: modifyOutputPath: false - task: PowerShell@2 displayName: 'Sign EXE files' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) env: SM_CLIENT_CERT_FILE : $(SM_CLIENT_CERT_FILE.secureFilePath) + SM_HOST : $(SM_HOST) inputs: targetType: 'inline' script: | @@ -119,16 +123,18 @@ steps: pwsh: true - task: PowerShell@2 displayName: 'Sign MSI files' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) env: SM_CLIENT_CERT_FILE : $(SM_CLIENT_CERT_FILE.secureFilePath) + SM_HOST : $(SM_HOST) inputs: targetType: 'inline' script: | $env:PATH += ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64' - signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea Cli" $(Build.ArtifactStagingDirectory)/enbrea.cli-x64-de.msi - signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea Cli" $(Build.ArtifactStagingDirectory)/enbrea.cli-x64-en.msi - signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea Cli" $(Build.ArtifactStagingDirectory)/enbrea.cli-x86-de.msi - signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea Cli" $(Build.ArtifactStagingDirectory)/enbrea.cli-x86-en.msi + signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea CLI" $(Build.ArtifactStagingDirectory)/enbrea.cli-x64-de.msi + signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea CLI" $(Build.ArtifactStagingDirectory)/enbrea.cli-x64-en.msi + signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea CLI" $(Build.ArtifactStagingDirectory)/enbrea.cli-x86-de.msi + signtool.exe sign /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 /sha1 $(SM_CERT_FINGERPRINT) /d "Enbrea CLI" $(Build.ArtifactStagingDirectory)/enbrea.cli-x86-en.msi failOnStderr: true pwsh: true - task: ArchiveFiles@2