From d5fb57108ed6b5f821a50686617cff154c01333c Mon Sep 17 00:00:00 2001 From: Kirstyn Joy Amperiadis Date: Fri, 2 Aug 2024 15:01:50 -0500 Subject: [PATCH] Refactor build number for releases --- eng/ci/code-mirror.yml | 3 --- eng/ci/official-build.yml | 3 --- eng/ci/templates/official/jobs/build-artifacts.yml | 12 ++++++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/eng/ci/code-mirror.yml b/eng/ci/code-mirror.yml index 1e7827f7..8ad6641e 100644 --- a/eng/ci/code-mirror.yml +++ b/eng/ci/code-mirror.yml @@ -1,7 +1,4 @@ trigger: - tags: - include: - - '*' # azure-functions-java-worker github repo restricts creation of tags, so using a pattern is safe here. branches: include: - dev diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 7a5f1043..12e6f64e 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -8,9 +8,6 @@ schedules: trigger: batch: true - tags: - include: - - '*' # azure-functions-java-worker github repo restricts creation of tags, so using a pattern is safe here. branches: include: - dev diff --git a/eng/ci/templates/official/jobs/build-artifacts.yml b/eng/ci/templates/official/jobs/build-artifacts.yml index 799377f2..d9c4a6b5 100644 --- a/eng/ci/templates/official/jobs/build-artifacts.yml +++ b/eng/ci/templates/official/jobs/build-artifacts.yml @@ -23,9 +23,9 @@ jobs: os: windows variables: - ${{ if contains(variables['Build.SourceBranch'], '/tags/' ) }}: - isTagTemp: true - isTag: $[variables.isTagTemp] + ${{ if contains(variables['Build.SourceBranch'], 'refs/heads/release/' ) }}: + isReleaseTemp: true + isRelease: $[variables.isReleaseTemp] steps: - task: NuGetToolInstaller@1 @@ -39,13 +39,13 @@ jobs: java -version displayName: 'Check default java version' - pwsh: | - if ("$(isTag)"){ + if ("$(isRelease)"){ $buildNumber="$(Build.SourceBranchName)" - Write-Host "Found git tag." + Write-Host "Triggered for release." } else { $buildNumber="$(Build.BuildNumber)-v4" - Write-Host "git tag not found. Setting package suffix to '$buildNumber'" + Write-Host "Not triggered for release. Setting package suffix to '$buildNumber'" } Write-Host "##vso[task.setvariable variable=buildNumber;isOutput=true;]$buildNumber" .\package-pipeline.ps1 -buildNumber $buildNumber