Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Before starting a release:
pipeline regardless of branch. Pick the build that corresponds to the
release branch and version you intend to ship.
- Each build's tags are shown alongside its number — verify the
`release-version:X.Y.Z` tag matches the version you intend to ship
`release-version - X.Y.Z` tag matches the version you intend to ship
**before** clicking Run. If the tag is missing, either re-run the
source build (after the tag-emitting change in `azure-pipelines.yml`
is on that release branch) or pass an explicit `ReleaseVersion`
Expand All @@ -75,7 +75,7 @@ Before starting a release:

| Parameter | Description | Example |
|-----------|-------------|---------|
| `ReleaseVersion` | Override for the version label (used as `v<version>` tag). **Leave as `auto` to derive from the source build's `release-version:*` tag** — the normal case. Only set this when re-shipping under a corrected tag. | `auto` |
| `ReleaseVersion` | Override for the version label (used as `v<version>` tag). **Leave as `auto` to derive from the source build's `release-version - *` tag** — the normal case. Only set this when re-shipping under a corrected tag. | `auto` |
| `IsPrerelease` | `true` for preview releases | `false` |
| `DryRun` | Set `true` to test without publishing or tagging | `false` |
| `GaChannelName` | Target GA channel | `Aspire 9.x GA` |
Expand Down
9 changes: 6 additions & 3 deletions eng/pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,14 @@ extends:
Write-Host "##vso[task.setvariable variable=aspireVersion;isOutput=true]$version"

# Tag the build so the release pipeline can auto-derive ReleaseVersion
# without operators retyping it. The 'release-version:' prefix avoids
# without operators retyping it. The 'release-version - ' prefix avoids
# collisions with other custom build tags (e.g., 1ES compliance tags),
# and the tag is visible in the AzDO source-build picker so operators
# can verify the version at queue time.
Write-Host "##vso[build.addbuildtag]release-version:$version"
# can verify the version at queue time. The format intentionally mirrors
# the ' - '-separated 'BAR ID - <id>' tag style: AzDO's 1ES PT request
# validator rejects ':' in tag names because the tag becomes part of the
# URL path of the addbuildtag REST call.
Write-Host "##vso[build.addbuildtag]release-version - $version"
name: computeVersion
displayName: 🟣Compute Aspire version from nupkg

Expand Down
25 changes: 12 additions & 13 deletions eng/pipelines/release-publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extends:
Write-Host "==============================="
displayName: 'Log Stage Info'

# Auto-derive ReleaseVersion from the source build's `release-version:*`
# Auto-derive ReleaseVersion from the source build's `release-version - *`
# tag (set by eng/pipelines/azure-pipelines.yml after the version is
# computed from the Aspire.Hosting.AppHost nupkg). This means operators
# don't have to retype the version when queuing a release — the tag
Expand All @@ -185,7 +185,7 @@ extends:
# escape hatch for re-shipping under a corrected tag.
#
# Failure semantics: hard-fail when no override is supplied AND the
# source build has no `release-version:*` tag (e.g., a pre-tagging
# source build has no `release-version - *` tag (e.g., a pre-tagging
# build was selected). The fix is either to backport the tag-add
# change to the relevant release branch and re-run the source build,
# or pass an explicit -ReleaseVersion override.
Expand Down Expand Up @@ -218,26 +218,29 @@ extends:

Write-Host "Build tags: $($response.value -join ', ')"

# Tags look like 'release-version:13.3.3'. Filter and parse.
# Tags look like 'release-version - 13.3.3'. Filter and parse.
# The ' - ' separator (rather than ':') matches the 'BAR ID - <id>'
# tag style and avoids AzDO's 1ES PT request validator rejecting ':'
# in tag names (it becomes part of the addbuildtag REST URL path).
# NB: variable named $tagMatches (not $matches) to avoid shadowing
# PowerShell's automatic $Matches hashtable.
$tagMatches = @($response.value | Where-Object { $_ -match '^release-version:(.+)$' })
$tagMatches = @($response.value | Where-Object { $_ -match '^release-version - (.+)$' })

$derived = $null
if ($tagMatches.Count -eq 0) {
if ([string]::IsNullOrWhiteSpace($override)) {
$msg = "Source build $buildId has no 'release-version:*' tag and no -ReleaseVersion was supplied. " +
$msg = "Source build $buildId has no 'release-version - *' tag and no -ReleaseVersion was supplied. " +
"Either re-queue with an explicit -ReleaseVersion <X.Y.Z> override, or run a newer source " +
"build that includes the tag-emitting step from eng/pipelines/azure-pipelines.yml."
Write-Error $msg
exit 1
}
Write-Host "##vso[task.logissue type=warning]No 'release-version:*' tag on source build $buildId; using operator-supplied -ReleaseVersion '$override'."
Write-Host "##vso[task.logissue type=warning]No 'release-version - *' tag on source build $buildId; using operator-supplied -ReleaseVersion '$override'."
} elseif ($tagMatches.Count -gt 1) {
Write-Error "Source build $buildId has multiple 'release-version:*' tags ($($tagMatches -join ', ')). Refusing to guess; pass -ReleaseVersion explicitly."
Write-Error "Source build $buildId has multiple 'release-version - *' tags ($($tagMatches -join ', ')). Refusing to guess; pass -ReleaseVersion explicitly."
exit 1
} else {
$derived = ($tagMatches[0] -replace '^release-version:', '').Trim()
$derived = ($tagMatches[0] -replace '^release-version - ', '').Trim()
if ($derived -notmatch '^\d+\.\d+\.\d+(-[A-Za-z0-9.-]+)?$') {
Write-Error "Derived release version '$derived' does not look like valid semver (X.Y.Z[-suffix])."
exit 1
Expand All @@ -248,7 +251,7 @@ extends:
# Resolve the effective value: operator override wins, derived is fallback.
if (-not [string]::IsNullOrWhiteSpace($override)) {
if ($derived -and $override -ne $derived) {
Write-Host "##vso[task.logissue type=warning]Operator-supplied -ReleaseVersion '$override' does NOT match source-build tag 'release-version:$derived'. Proceeding with operator override."
Write-Host "##vso[task.logissue type=warning]Operator-supplied -ReleaseVersion '$override' does NOT match source-build tag 'release-version - $derived'. Proceeding with operator override."
}
$effective = $override.Trim()
} else {
Expand All @@ -257,10 +260,6 @@ extends:

Write-Host "✓ ReleaseVersionEffective: $effective"
Write-Host "##vso[task.setvariable variable=releaseVersionEffective;isOutput=true]$effective"

# Surface the resolved version on the *release* run header too,
# so it shows up in the AzDO build list / pipeline summary.
Write-Host "##vso[build.addbuildtag]release-version:$effective"
name: deriveReleaseVersion
displayName: 'Derive ReleaseVersion from source build tag'
env:
Expand Down
Loading