mirror of
https://github.com/microsoft/mcp.git
synced 2026-11-04 12:01:31 +00:00
* Use minor-increment GA versioning for Fabric MCP post-release auto-bump
Fabric MCP Server follows a GA-only, minor-increment versioning strategy. The post-release Update-Version.ps1 auto-increment now reuses the shared IncrementAndSetToPrerelease('Minor') to bump the minor segment and reset patch, then strips the prerelease label so the result is a stable GA release for Fabric.Mcp.Server (e.g. 1.1.0 -> 1.2.0). All other servers keep the existing patch + prerelease behavior. The synced eng/common SemVer.ps1 is intentionally left untouched.
* Use explicit minor bump for Fabric GA increment
Address PR review feedback: IncrementAndSetToPrerelease is designed to produce a prerelease and bumps the prerelease number when the input already has a label, so reusing it for a GA minor bump is fragile. Use a direct Minor++/Patch=0 instead, which has no dependency on the input being GA and no conflict with the 0.x prerelease rule.
* Use csproj version for Fabric MCP VSIX instead of Major.0.X
The VSIX version was computed independently of the csproj version using a Major.0.<next-marketplace-patch> scheme, so Fabric's 1.1.0 release published the extension as 1.0.1. Fabric MCP Server follows a GA-only, minor-increment strategy and drives its own explicit versions, so use the .csproj version verbatim for the VSIX to keep it in sync with the npm, NuGet, ADO feed, and MCR targets. Other servers keep the existing marketplace-derived patch behavior.
* Correct post-release version bump to 1.2.0
The post-release auto-increment (#2881) ran before the new minor-increment GA strategy landed and set the in-development version to 1.1.1-beta.1. Correct it to 1.2.0 in the csproj and CHANGELOG to match Fabric's GA-only, minor-increment strategy.
67 lines
2.6 KiB
PowerShell
67 lines
2.6 KiB
PowerShell
#!/bin/env pwsh
|
|
#Requires -Version 7
|
|
[CmdletBinding(DefaultParameterSetName='default')]
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string] $ServerName,
|
|
[Parameter(Mandatory=$true, ParameterSetName='Release')]
|
|
[string] $Version,
|
|
[Parameter(Mandatory=$true, ParameterSetName='Release')]
|
|
[string] $ReleaseDate,
|
|
[Parameter(ParameterSetName='Release')]
|
|
[boolean] $ReplaceLatestEntryTitle=$true
|
|
)
|
|
|
|
. "$PSScriptRoot/../common/scripts/common.ps1"
|
|
$RepoRoot = $RepoRoot.Path.Replace('\', '/')
|
|
|
|
$projectFile = "$RepoRoot/servers/$ServerName/src/$ServerName.csproj"
|
|
$changeLogPath = "$RepoRoot/servers/$ServerName/CHANGELOG.md"
|
|
if(!(Test-Path $projectFile)) {
|
|
Write-Error "Project file $projectFile does not exist."
|
|
exit 1
|
|
}
|
|
|
|
$project = [xml](Get-Content $projectFile)
|
|
$currentVersion = $project.Project.PropertyGroup.Version | Select-Object -First 1
|
|
|
|
$autoVersion = $false
|
|
if (!$Version) {
|
|
# get the number of commits since the last tag
|
|
$nextVersion = [AzureEngSemanticVersion]::new($currentVersion)
|
|
if ($ServerName -eq 'Fabric.Mcp.Server') {
|
|
# Fabric MCP Server follows a GA-only, minor-increment versioning strategy.
|
|
# Bump the minor segment and reset patch so the next version is a stable GA
|
|
# release (e.g. 1.1.0 -> 1.2.0). The shared IncrementAndSetToPrerelease helper
|
|
# always produces a prerelease for non-zero major versions, so a direct minor
|
|
# bump is used here instead.
|
|
$nextVersion.Minor++
|
|
$nextVersion.Patch = 0
|
|
}
|
|
else {
|
|
$nextVersion.IncrementAndSetToPrerelease('patch')
|
|
}
|
|
$Version = $nextVersion.ToString()
|
|
$autoVersion = $true
|
|
}
|
|
|
|
Write-Host "Current Version: $currentVersion"
|
|
Write-Host "New Version: $Version"
|
|
Write-Host "Updating project file $projectFile"
|
|
|
|
$projectText = Get-Content $projectFile -Raw
|
|
$projectText = $projectText -replace "<Version>$([Regex]::Escape($currentVersion))</Version>", "<Version>$Version</Version>"
|
|
$projectText | Set-Content $projectFile -Force -NoNewLine
|
|
|
|
if ($autoVersion) {
|
|
Write-Host "> Update-ChangeLog.ps1 -Version '$Version' -ChangelogPath '$changeLogPath' -Unreleased `$True"
|
|
& "$RepoRoot/eng/common/scripts/Update-ChangeLog.ps1" -Version $Version `
|
|
-ChangelogPath $changeLogPath -Unreleased $True
|
|
}
|
|
else {
|
|
Write-Host "> Update-ChangeLog.ps1 -Version '$Version' -ChangelogPath '$changeLogPath' -Unreleased `$False -ReplaceLatestEntryTitle `$$ReplaceLatestEntryTitle -ReleaseDate '$ReleaseDate'"
|
|
& "$RepoRoot/eng/common/scripts/Update-ChangeLog.ps1" -Version $Version `
|
|
-ChangelogPath $changeLogPath -Unreleased $False `
|
|
-ReplaceLatestEntryTitle $ReplaceLatestEntryTitle -ReleaseDate $ReleaseDate
|
|
}
|