-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishing automation for vcpkg x-add-version (#1649)
* Add azure-template2 to validate publishing multiple packages to vcpkg * Update versions to avoid release conflict * Add custom port naming logic * fix changelogs * compute path * Add azure-core-cpp dependency back in * package name in control file * Add changes to support vcpkg x-add-version * Add azure-sdk identity to commit * Remove old conditions/comments and use -am for commit * remove -c parameters * Use --author * git config local * space * work around HasChanges=false * Bump versions for verification * Bump versions, update portfile to use azure-template2-cpp ref * Add PackageVersion * Revert template2 * Finish reverting template2 * Revert "Finish reverting template2" This reverts commit aa1461f. * Revert "Revert template2" This reverts commit 3a91e82. * Commit without setting user.name and user.email * bump version * git commands on same line * Revert "Revert "Revert template2"" This reverts commit 1721a62. * Revert "Revert "Finish reverting template2"" This reverts commit 461a57c. * Finish reverting template2
- Loading branch information
1 parent
cda5d62
commit 2d4d766
Showing
2 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,24 @@ stages: | |
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 | ||
$title = "[${{ artifact.VcpkgPortName }}] publish version $version" | ||
if ('$(VcpkgPRTitle)') { | ||
Write-Host "Using queue time PR title" | ||
$title = '$(VcpkgPRTitle)' | ||
} | ||
Write-Host "##vso[task.setvariable variable=PrTitle]$title" | ||
displayName: Set PR title | ||
- 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 | ||
- task: Powershell@2 | ||
inputs: | ||
filePath: eng/scripts/Initialize-VcpkgRelease.ps1 | ||
|
@@ -139,21 +157,42 @@ stages: | |
Write-Host "git status" | ||
git status | ||
displayName: Copy updated files into vcpkg fork for PR | ||
condition: ne(variables['SkipVcpkgUpdate'], 'true') | ||
# This template does not need to check the | ||
# SkipVcpkgUpdate variable, it will stop if there are no | ||
# changes in the git repo. | ||
# Commit changes | ||
Write-Host "git add -A" | ||
git add -A | ||
Write-Host "git -c user.name=`"azure-sdk`" -c user.email=`"[email protected]`" commit -m `"Initial vcpkg commit for ${{ artifact.VcpkgPortName }}`"" | ||
git -c user.name="azure-sdk" -c user.email="[email protected]" commit -m "Initial vcpkg commit for ${{ artifact.VcpkgPortName }}" | ||
# Run vcpkg x-add-version to add version to vcpkg file | ||
Write-Host "./bootstrap-vcpkg.bat" | ||
./bootstrap-vcpkg.bat | ||
Write-Host "./vcpkg.exe x-add-version ${{ artifact.VcpkgPortName }}" | ||
./vcpkg.exe x-add-version ${{ artifact.VcpkgPortName }} | ||
# Amend commit to include results of x-add-version | ||
Write-Host "git status" | ||
git status | ||
Write-Host "git add -A" | ||
git add -A | ||
Write-Host "git -c user.name=`"azure-sdk`" -c user.email=`"[email protected]`" commit --amend -m `"[${{ artifact.VcpkgPortName }}] Update to $(PackageVersion)`"" | ||
git -c user.name="azure-sdk" -c user.email="[email protected]" commit --amend -m "[${{ artifact.VcpkgPortName }}] Update to $(PackageVersion)" | ||
# Work around create-pull-request.yml logic that | ||
# checks for changes | ||
Write-Host "##vso[task.setvariable variable=HasChanges]$true" | ||
displayName: Commit changes for PR | ||
- template: /eng/common/pipelines/templates/steps/create-pull-request.yml | ||
parameters: | ||
RepoOwner: Microsoft | ||
RepoName: vcpkg | ||
WorkingDirectory: $(Pipeline.Workspace)/vcpkg | ||
PrBranchName: $(PrBranchName) | ||
CommitMsg: "Update port for ${{ artifact.VcpkgPortName }}" | ||
PRTitle: "Update port for ${{ artifact.VcpkgPortName }}" | ||
CommitMsg: "[${{ artifact.VcpkgPortName }}] Update to $(PackageVersion)" | ||
PRTitle: $(PrTitle) | ||
BaseBranchName: master | ||
SkipCheckingForChanges: true | ||
|
||
- ${{if ne(artifact.skipUpdatePackageVersion, 'true')}}: | ||
- deployment: UpdatePackageVersion | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters