Skip to content
Closed
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
66 changes: 62 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['PartnerFeed'], 'true'))
dependsOn:
- ReleaseGate

Expand Down Expand Up @@ -94,7 +94,7 @@ stages:
PackageName: ${{artifact.name}}
SourceRootPath: $(Build.SourcesDirectory)

- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- ${{if and(ne(artifact.skipPublishDocGithubIo, 'true'), ne(variables['PartnerFeed'], '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'))
Expand Down Expand Up @@ -162,10 +162,10 @@ stages:
- ci-configs/packages-latest.json
- ci-configs/packages-preview.json

- ${{ if ne(artifact.skipPublishVcpkg, 'true') }}:
- ${{ if and(ne(artifact.skipPublishVcpkg, 'true'), ne(variables['PartnerFeed'], '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['PartnerFeed'], 'true'))
# This step requires the tag step
dependsOn:
- TagRepository
Expand Down Expand Up @@ -312,6 +312,64 @@ stages:
condition: and(succeeded(), eq(variables['PublishToVcpkg'], 'true'))
displayName: Comment notification to PR

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

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

steps:
- checkout: self

- 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

# There are potential race conditions if this script runs
# in parallel against the same branch name. Release only
# one package at a time.

# Clone Vcpkg partner feed
- template: /eng/pipelines/templates/steps/vcpkg-clone.yml
parameters:
RepoOwner: Azure
RepoName: azure-sdk-vcpkg-partner-feed
SetVcpkgRoot: false
Comment on lines +345 to +350

- 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
5 changes: 5 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 Down
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.

#>
10 changes: 10 additions & 0 deletions sdk/template/azure-template/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release History

## 1.1.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 1.0.0 (Unreleased)

### Other Changes
Expand Down
4 changes: 2 additions & 2 deletions sdk/template/azure-template/src/private/package_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#pragma once

#define AZURE_TEMPLATE_VERSION_MAJOR 1
#define AZURE_TEMPLATE_VERSION_MINOR 0
#define AZURE_TEMPLATE_VERSION_MINOR 1
#define AZURE_TEMPLATE_VERSION_PATCH 0
#define AZURE_TEMPLATE_VERSION_PRERELEASE ""
#define AZURE_TEMPLATE_VERSION_PRERELEASE "beta.1"

#define AZURE_TEMPLATE_VERSION_ITOA_HELPER(i) #i
#define AZURE_TEMPLATE_VERSION_ITOA(i) AZURE_TEMPLATE_VERSION_ITOA_HELPER(i)
Expand Down
Loading