Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
239deec
Add support for releasing into Partner Feed vcpkg
antkmsft Oct 15, 2026
894038a
Rename job
antkmsft Oct 16, 2026
56b19b2
Drop succeeded()
antkmsft Oct 16, 2026
1a7a8a3
succeededOrFailed()
antkmsft Oct 16, 2026
aa9af64
use artifact.
antkmsft Oct 16, 2026
993350f
Tempoprarily remove real release steps
antkmsft Oct 16, 2026
13fd630
Combine everything under one roof
antkmsft Oct 16, 2026
ccd088f
Always set variables
antkmsft Oct 16, 2026
94ab2db
Add variable
antkmsft Oct 16, 2026
2dce134
Rewrite as before
antkmsft Oct 16, 2026
237a880
Use parameter
antkmsft Oct 16, 2026
d3237b5
parameters[] syntax
antkmsft Oct 16, 2026
b2aad81
Syntax
antkmsft Oct 16, 2026
339613c
Use variables, compile time
antkmsft Oct 16, 2026
1571ac1
Drop variables section
antkmsft Oct 16, 2026
9b6a0d7
Syntax
antkmsft Oct 16, 2026
420c3fc
Initialize
antkmsft Oct 16, 2026
046d7e2
Run-time eval
antkmsft Oct 16, 2026
d9700e3
Add extra condition
antkmsft Oct 16, 2026
fa018cb
if-else
antkmsft Oct 16, 2026
5b0726d
-
antkmsft Oct 16, 2026
5b734fe
Try going via params
antkmsft Oct 16, 2026
cb44aef
different condition
antkmsft Oct 16, 2026
b6c1b4f
Go via powershell
antkmsft Oct 16, 2026
fa4a0a1
Different way
antkmsft Oct 16, 2026
38e9a9e
Login to GutHub
antkmsft Oct 16, 2026
3456c15
Hardcode false
antkmsft Oct 16, 2026
2d38a69
Drop else
antkmsft Oct 16, 2026
36f74f4
Handle as strings
antkmsft Oct 16, 2026
39bdc02
Only evaulatee at run-time
antkmsft Oct 16, 2026
615fd04
Clone main repo
antkmsft Oct 16, 2026
7988460
Target cloned repo
antkmsft Oct 16, 2026
9829729
Target cloned repo
antkmsft Oct 16, 2026
f890dc3
Update back
antkmsft Oct 16, 2026
46ef22c
Auth
antkmsft Oct 16, 2026
8922559
Use GH PAT
antkmsft Oct 19, 2026
ff25308
Use GH PAT
antkmsft Oct 19, 2026
7e71bf9
yaml condition
antkmsft Oct 19, 2026
b8e04c6
Use AuthToken param
antkmsft Oct 19, 2026
b1f2c97
Add GitHub to network isolation
antkmsft Oct 19, 2026
287830f
Test GitHub policy
antkmsft Oct 19, 2026
d46f87f
Debug PAT
antkmsft Oct 19, 2026
808e938
Debug print
antkmsft Oct 19, 2026
aaa58b8
quote
antkmsft Oct 19, 2026
1e595cb
More dignostic output
antkmsft Oct 19, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
{
Write-Host "##vso[task.LogIssue type=error;]Changes to selected workflow and shared skill files under '.github/' should not be made in this Repo`n${filesInCommonDir}"
Write-Host "##vso[task.LogIssue type=error;]Follow the workflow at https://github.com/Azure/azure-sdk-tools/blob/main/doc/engsys_workflows_and_skills.md"
exit 1
# exit 1
}
}
displayName: Prevent changes to eng/common and selected .github/* files outside of azure-sdk-tools repo
Expand Down
96 changes: 92 additions & 4 deletions eng/pipelines/templates/stages/archetype-cpp-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stages:

- job: TagRepository
displayName: "Create release tag"
condition: ne(variables['Skip.TagRepository'], 'true')
condition: and(ne(variables['Skip.TagRepository'], 'true'), ne(variables['PublishToVcpkgPartnerFeed'], 'true'))
dependsOn:
- ReleaseGate

Expand Down Expand Up @@ -97,7 +97,7 @@ stages:
- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- job: PublishDocs
displayName: Publish Docs to GitHub pages
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'))
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'), ne(variables['PublishToVcpkgPartnerFeed'], 'true'))
# Release tag must exist for link substitution to work
dependsOn:
- TagRepository
Expand Down Expand Up @@ -130,7 +130,7 @@ stages:

- job: PublishDocsMs
displayName: Docs.MS Release
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'))
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'), ne(variables['PublishToVcpkgPartnerFeed'], 'true'))

# C++ learn docs are generated from hosted doxygen docs so this
# can only run after the static docs have been published.
Expand Down Expand Up @@ -165,7 +165,7 @@ stages:
- ${{ if ne(artifact.skipPublishVcpkg, 'true') }}:
- job: PublishVcpkg
displayName: Publish to vcpkg
condition: and(succeeded(), ne(variables['Skip.PublishVcpkg'], 'true'))
condition: and(succeeded(), ne(variables['Skip.PublishVcpkg'], 'true'), ne(variables['PublishToVcpkgPartnerFeed'], 'true'))
# This step requires the tag step
dependsOn:
- TagRepository
Expand Down Expand Up @@ -312,6 +312,94 @@ stages:
condition: and(succeeded(), eq(variables['PublishToVcpkg'], 'true'))
displayName: Comment notification to PR

- job: PublishVcpkgPartnerFeed
displayName: Publish to vcpkg-partner-feed
condition: and(succeeded(), eq(variables['PublishToVcpkgPartnerFeed'], 'true'))
dependsOn:
- ReleaseGate
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows

templateContext:
inputs:
- input: pipelineArtifact
artifactName: packages
targetPath: $(Pipeline.Workspace)/packages

steps:
- checkout: self

- pwsh: |
$branchName = "azure-sdk-for-cpp-${{ artifact.Name }}-$(Build.BuildId)"
if ('$(VcpkgForkBranchName)') {
Write-Host "Using queue time branch name"
$branchName = '$(VcpkgForkBranchName)'
}
Write-Host "##vso[task.setvariable variable=PrBranchName]$branchName"
displayName: Set fork branch name

- pwsh: |
$packageSpec = Get-Content -Raw -Path "$(Pipeline.Workspace)/packages/${{artifact.Name}}/package-info.json" | ConvertFrom-Json
$version = $packageSpec.version
Write-Host "##vso[task.setvariable variable=PackageVersion]$version"
displayName: Set PackageVersion variable

- pwsh: |
$title = "[${{ artifact.VcpkgPortName }}] publish version $(PackageVersion)"

if ('$(VcpkgPRTitle)') {
Write-Host "Using queue time PR title"
$title = '$(VcpkgPRTitle)'
}
Write-Host "##vso[task.setvariable variable=PrTitle]$title"
displayName: Set PR title

# There are potential race conditions if this script runs
# in parallel against the same branch name. Release only
# one package at a time.
# Clone main vcpkg repo
- template: /eng/pipelines/templates/steps/vcpkg-clone.yml
parameters:
RepoOwner: azure-sdk
PRBranchName: $(PrBranchName)

- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
AlwaysUseOwnerSuffix: true
TokenOwners:
- Azure

# Clone Vcpkg partner feed
- template: /eng/pipelines/templates/steps/vcpkg-clone.yml
parameters:
RepoOwner: Azure
RepoName: azure-sdk-vcpkg-partner-feed
SetVcpkgRoot: false
AuthToken: $(GH_TOKEN_Azure)

- template: /eng/pipelines/templates/steps/vcpkg-publish.yml
parameters:
ArtifactName: ${{ artifact.Name }}
VcpkgPortName: ${{ artifact.VcpkgPortName }}
UpdateVcpkgBeta: false
PartnerRelease: true
PartnerReleaseRef: $(Build.SourceVersion)

- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
parameters:
WorkingDirectory: $(Pipeline.Workspace)/azure-sdk-vcpkg-partner-feed

# Push changes to vcpkg partner feed
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
WorkingDirectory: $(Pipeline.Workspace)/azure-sdk-vcpkg-partner-feed
TargetRepoName: azure-sdk-vcpkg-partner-feed
BaseRepoOwner: Azure
CommitMsg: Update vcpkg-configuration.json
BaseRepoBranch: $(DefaultBranch)

- ${{if ne(artifact.skipUpdatePackageVersion, 'true')}}:
- job: UpdatePackageVersion
displayName: "Update Package Version"
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extends:
parameters:
settings:
skipBuildTagsForGitHubPullRequests: true
networkIsolationPolicy: Permissive, CFSClean
networkIsolationPolicy: Permissive, CFSClean, GitHub
sdl:
${{ if and(eq(variables['Build.DefinitionName'], 'cpp - core'), eq(variables['Build.SourceBranchName'], 'main'), eq(variables['System.TeamProject'], 'internal')) }}:
autobaseline:
Expand Down
31 changes: 23 additions & 8 deletions eng/pipelines/templates/steps/vcpkg-clone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,31 @@ parameters:
RepoName: vcpkg
PRBranchName: not-set
SetVcpkgRoot: true
AuthToken: ''

steps:
- pwsh: |
Write-Host "git clone https://github.com/${{ parameters.RepoOwner }}/${{ parameters.RepoName }} ${{ parameters.Workspace }}/${{ parameters.RepoName }}"
git clone https://github.com/${{ parameters.RepoOwner }}/${{ parameters.RepoName }} ${{ parameters.Workspace }}/${{ parameters.RepoName }}
if ($LASTEXITCODE -ne 0) {
Write-Error "Unable to check out vcpkg fork repo"
exit $LASTEXITCODE
}
displayName: Clone vcpkg (${{ parameters.RepoOwner }}/${{ parameters.RepoName }})
- ${{ if ne(parameters.AuthToken, '') }}:
- pwsh: |
$tokenLength = "${{ parameters.AuthToken }}".Length
$startsWithGhp = "${{ parameters.AuthToken }}".Substring(0, 4) -eq "ghp_"

Write-Host "git clone https://github.com/${{ parameters.RepoOwner }}/${{ parameters.RepoName }} ${{ parameters.Workspace }}/${{ parameters.RepoName }}"
Write-Host "Using GitHub token for authentication (Token length: $tokenLength, Starts with 'ghp_': $startsWithGhp)."

git clone https://${{ parameters.AuthToken }}@github.com/${{ parameters.RepoOwner }}/${{ parameters.RepoName }} ${{ parameters.Workspace }}/${{ parameters.RepoName }}
if ($LASTEXITCODE -ne 0) {
Write-Error "Unable to check out vcpkg fork repo"
exit $LASTEXITCODE
}
displayName: Clone vcpkg (${{ parameters.RepoOwner }}/${{ parameters.RepoName }})
- ${{ else }}:
- pwsh: |
git clone https://github.com/${{ parameters.RepoOwner }}/${{ parameters.RepoName }} ${{ parameters.Workspace }}/${{ parameters.RepoName }}
if ($LASTEXITCODE -ne 0) {
Write-Error "Unable to check out vcpkg fork repo"
exit $LASTEXITCODE
}
displayName: Clone vcpkg (${{ parameters.RepoOwner }}/${{ parameters.RepoName }})

- ${{ if eq(parameters.SetVcpkgRoot, true) }}:
- pwsh: |
Expand Down
19 changes: 19 additions & 0 deletions eng/pipelines/templates/steps/vcpkg-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ parameters:
VcpkgPortName: not-set
DisplayNameExtension:
DailyReleaseRef:
PartnerReleaseRef:
DailyRelease: false
UpdateVcpkgBeta: true
PartnerRelease: false

steps:
- task: Powershell@2
Expand All @@ -17,6 +19,7 @@ steps:
-PackageSpecPath ${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}/package-info.json
-SourceDirectory ${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}/vcpkg
-DailyReleaseRef '${{ parameters.DailyReleaseRef }}'
-PartnerReleaseRef '${{ parameters.PartnerReleaseRef }}'
-Verbose
pwsh: true
displayName: Initialize vcpkg release ${{ parameters.DisplayNameExtension }}
Expand All @@ -33,6 +36,7 @@ steps:
-VcpkgFolder ${{ parameters.Workspace }}/vcpkg
-VcpkgPortName '${{ parameters.VcpkgPortName }}'
-DailyRelease:$${{ parameters.DailyRelease }}
-PartnerRelease:$${{ parameters.PartnerRelease }}
displayName: Check whether to release to vcpkg

- task: Powershell@2
Expand All @@ -46,6 +50,7 @@ steps:
-VcpkgPortName '${{ parameters.VcpkgPortName }}'
-GitCommitParameters '-c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com"'
-DailyRelease:$${{ parameters.DailyRelease }}
-PartnerRelease:$${{ parameters.PartnerRelease }}
workingDirectory: ${{ parameters.Workspace }}/vcpkg
condition: and(succeeded(), eq(variables['PublishToVcpkg'], 'true'))
displayName: Update vcpkg port ${{ parameters.DisplayNameExtension }}
Expand All @@ -64,3 +69,17 @@ steps:
-VcpkgPortName '${{ parameters.VcpkgPortName }}'
-GitCommitParameters '-c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com"'
displayName: Update Vcpkg Betas port ${{ parameters.DisplayNameExtension }}

- ${{ if eq(parameters.PartnerRelease, 'true') }}:
- task: Powershell@2
inputs:
pwsh: true
targetType: filePath
filePath: eng/scripts/Update-VcpkgBeta.ps1
arguments: >-
-VcpkgBetaFolder ${{ parameters.Workspace }}/azure-sdk-vcpkg-partner-feed
-VcpkgFolder ${{ parameters.Workspace }}/vcpkg
-ReleaseArtifactSourceDirectory "${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}"
-VcpkgPortName '${{ parameters.VcpkgPortName }}'
-GitCommitParameters '-c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com"'
displayName: Update Vcpkg Partner Feed port ${{ parameters.DisplayNameExtension }}
18 changes: 17 additions & 1 deletion eng/scripts/Initialize-VcpkgRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Name of the GitHub repo (of the form Azure/azure-sdk-for-cpp)
If supplied update the portfile.cmake file's REF and SHA512 with values
associated with the given ref.

.PARAMETER PartnerReleaseRef
If supplied update the portfile.cmake file's REF and SHA512 with values
associated with the given ref.

#>
[CmdletBinding()]
param (
Expand All @@ -31,7 +35,9 @@ param (
[ValidateNotNullOrEmpty()]
[string] $GitHubRepo,

[string] $DailyReleaseRef
[string] $DailyReleaseRef,

[string] $PartnerReleaseRef
)

# If there's nothing in the "port" folder to upload set SkipVcpkgUpdate to true
Expand All @@ -50,6 +56,11 @@ if ($DailyReleaseRef) {
$tarGzUri = "https://github.com/$GitHubRepo/archive/$DailyReleaseRef.tar.gz"
}

if ($PartnerReleaseRef) {
Write-Verbose "Initializing Partner Release"
$tarGzUri = "https://github.com/$GitHubRepo/archive/$PartnerReleaseRef.tar.gz"
}

Write-Host "Downloading tarball to compute hash from $tarGzUri"
$localTarGzPath = New-TemporaryFile
Invoke-WebRequest -Uri $tarGzUri -OutFile $localTarGzPath
Expand All @@ -72,5 +83,10 @@ if ($DailyReleaseRef) {
$newContent = $newContent -replace '(?m)^(\s+)REF .+$', "`${1}REF $DailyReleaseRef"
}

if ($PartnerReleaseRef) {
Write-Verbose "Overriding REF with partner release ref: $PartnerReleaseRef"
$newContent = $newContent -replace '(?m)^(\s+)REF .+$', "`${1}REF $PartnerReleaseRef"
}

$newContent = $newContent.Replace("`r`n", "`n")
$newContent | Set-Content $portfileLocation -NoNewLine
9 changes: 8 additions & 1 deletion eng/scripts/Test-ShouldReleaseToVcpkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ param(
[string] $ReleaseArtifactSourceDirectory,
[string] $VcpkgFolder,
[string] $VcpkgPortName,
[switch] $DailyRelease
[switch] $DailyRelease,
[switch] $PartnerRelease
)

."$PSScriptRoot/../common/scripts/common.ps1"
Expand All @@ -15,6 +16,12 @@ if ($DailyRelease) {
exit 0
}

if ($PartnerRelease) {
Write-Host "Partner release, publish to vcpkg"
Write-Host "##vso[task.setvariable variable=PublishToVcpkg]true"
exit 0
}

$packageJsonContents = Get-Content `
-Path "$ReleaseArtifactSourceDirectory/package-info.json" `
-Raw
Expand Down
10 changes: 8 additions & 2 deletions eng/scripts/Update-VcpkgPort.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ param (

[string] $GitCommitParameters,

[switch] $DailyRelease
[switch] $DailyRelease,

[switch] $PartnerRelease
)

."$PSScriptRoot/../common/scripts/common.ps1"
Expand Down Expand Up @@ -105,7 +107,7 @@ Write-Host "git reset HEAD^"
git reset HEAD^

# Only perform the final commit if this is not a test release
if (!$DailyRelease) {
if (!$DailyRelease -and !$PartnerRelease) {
# Grab content needed for commit message and place in a temporary file
$packageVersion = (Get-Content $ReleaseArtifactSourceDirectory/package-info.json -Raw | ConvertFrom-Json).version
$commitMessageFile = New-TemporaryFile
Expand Down Expand Up @@ -174,4 +176,8 @@ In the case of a test release set this to ensure that the x-add-version step
includes `--overwrite-version` to ensure daily packages are properly updated
in the vcpkg repo.

.PARAMETER PartnerRelease
In the case of a partner release set this so that the release gets created
according to the partner release process.

#>
Loading