Skip to content

Commit 7758c68

Browse files
badrishcCopilot
andauthored
Bump version to 2.0.0-beta.4 and scope external-release pipeline to main only (#1793)
* Bump version from 2.0.0-beta.3 to 2.0.0-beta.4 Triggers the external-release ADO pipeline on merge to main, which will publish Microsoft.Garnet 2.0.0-beta.4 and garnet-server 2.0.0-beta.4 to NuGet.org and create GitHub Release v2.0.0-beta.4. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Scope external-release pipeline to main only (drop dev) Removes the dev branch path from the v2 release pipeline: - trigger.branches.include: drop 'dev', keep only 'main' - GitHubRelease/NuGet push conditions: simplified from or(main,dev) to a single eq on Build.SourceBranch == refs/heads/main - Drop the releaseTitle powershell shim and 'isPreRelease' flag (only mattered when dev was producing PREVIEW releases) dev pushes will no longer trigger the external release pipeline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Auto-derive GitHubRelease isPreRelease from version string Adds a powershell step right after extract_version.ps1 that sets a pipeline variable 'isPreRelease' = true when Build.BuildNumber contains a '-' (i.e., a SemVer prerelease label like '-beta.4'). GitHubRelease@1 now consumes 'isPreRelease: $(isPreRelease)' so: - 2.0.0-beta.x -> prerelease=true (does NOT become 'Latest') - 2.0.0 (GA) -> prerelease=false (becomes 'Latest') - 1.1.x patches -> prerelease=false No future maintenance needed when v2 GA ships. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Auto-derive GitHubRelease title PREVIEW prefix from version string Extends the powershell shim that already sets 'isPreRelease' to also set 'releaseTitle' = 'Garnet PREVIEW v$(Build.BuildNumber)' when the version is a SemVer prerelease (contains '-'), else 'Garnet v...'. GitHubRelease@1 now consumes 'title: $(releaseTitle)'. Net effect: - 2.0.0-beta.x -> 'Garnet PREVIEW v2.0.0-beta.x' + prerelease=true - 2.0.0 (GA) -> 'Garnet v2.0.0' + prerelease=false - 1.1.x patches -> 'Garnet v1.1.x' + prerelease=false Restores naming consistency with prior PREVIEW beta releases (v2.0.0-beta.{1,2,3}) without re-introducing branch-based logic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a3e692d commit 7758c68

2 files changed

Lines changed: 16 additions & 19 deletions

File tree

.azure/pipelines/azure-pipelines-external-release.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ trigger:
88
branches:
99
include:
1010
- main
11-
- dev
1211
paths:
1312
include:
1413
- Version.props
@@ -67,6 +66,18 @@ jobs:
6766
filePath: .azure/pipelines/extract_version.ps1
6867
workingDirectory: .azure/pipelines
6968

69+
- powershell: |
70+
$isPreRelease = "$(Build.BuildNumber)".Contains('-')
71+
if ($isPreRelease) {
72+
$releaseTitle = "Garnet PREVIEW v$(Build.BuildNumber)"
73+
} else {
74+
$releaseTitle = "Garnet v$(Build.BuildNumber)"
75+
}
76+
Write-Host "Build.BuildNumber=$(Build.BuildNumber); isPreRelease=$isPreRelease; releaseTitle=$releaseTitle"
77+
Write-Host "##vso[task.setvariable variable=isPreRelease]$($isPreRelease.ToString().ToLower())"
78+
Write-Host "##vso[task.setvariable variable=releaseTitle]$releaseTitle"
79+
displayName: 'Derive isPreRelease and releaseTitle from version (PREVIEW prefix iff SemVer prerelease)'
80+
7081
- task: UseDotNet@2
7182
displayName: Use .NET 6 SDK - needed for code signing
7283
inputs:
@@ -208,20 +219,9 @@ jobs:
208219
- task: PublishBuildArtifacts@1
209220
displayName: 'Publish Artifact: drop'
210221

211-
- powershell: |
212-
if ("$(Build.SourceBranchName)" -eq "main") {
213-
Write-Host "##vso[task.setvariable variable=releaseTitle]Garnet v$(Build.BuildNumber)"
214-
} else {
215-
Write-Host "##vso[task.setvariable variable=releaseTitle]Garnet PREVIEW v$(Build.BuildNumber)"
216-
}
217-
displayName: 'Set releaseTitle variable'
218-
219222
- task: GitHubRelease@1
220223
displayName: 'Create the GitHub release'
221-
condition: or(
222-
eq(variables['Build.SourceBranchName'], 'main'),
223-
eq(variables['Build.SourceBranchName'], 'dev')
224-
)
224+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
225225
inputs:
226226
action: 'create'
227227
gitHubConnection: ADO_to_Github_ServiceConnection
@@ -244,14 +244,11 @@ jobs:
244244
$(Build.ArtifactStagingDirectory)/*.zip
245245
$(Build.ArtifactStagingDirectory)/*.tar.xz
246246
$(Build.ArtifactStagingDirectory)/*.7z
247-
isPreRelease: ${{ eq(variables['Build.SourceBranchName'], 'dev') }}
247+
isPreRelease: $(isPreRelease)
248248

249249
- task: NuGetCommand@2
250250
displayName: 'Push both packages to NuGet.org'
251-
condition: or(
252-
eq(variables['Build.SourceBranchName'], 'main'),
253-
eq(variables['Build.SourceBranchName'], 'dev')
254-
)
251+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
255252
inputs:
256253
command: push
257254
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'

Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<!-- VersionPrefix property for builds and packages -->
33
<PropertyGroup>
4-
<VersionPrefix>2.0.0-beta.3</VersionPrefix>
4+
<VersionPrefix>2.0.0-beta.4</VersionPrefix>
55
</PropertyGroup>
66
</Project>

0 commit comments

Comments
 (0)