Skip to content

Add all updates #7659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 17, 2025
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
19 changes: 7 additions & 12 deletions packages/http-client-csharp/eng/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,13 @@ extends:
- checkout: self
- pwsh: |
# Determine the TypeSpec PR URL
$sourceBranch = '$(Build.SourceBranch)'
$repoUrl = '$(Build.Repository.Uri)'
$repoUrl = '$(Build.Repository.Uri)'.TrimEnd('/')
$commitSha = '$(Build.SourceVersion)'
$typeSpecCommitUrl = "$repoUrl/commit/$commitSha"

if ($sourceBranch -match "^refs/pull/(\d+)/(head|merge)$") {
$typeSpecPRUrl = "$repoUrl/pull/$($Matches[1])"
} elseif ($sourceBranch -match "^refs/heads/(.+)$") {
$typeSpecPRUrl = "$repoUrl/tree/$($Matches[1])"
} else {
$typeSpecPRUrl = "$repoUrl/tree/$sourceBranch"
}
Write-Host "TypeSpec PR URL: $typeSpecPRUrl"
Write-Host "##vso[task.setvariable variable=TypeSpecPRUrl]$typeSpecPRUrl"
Write-Host "Commit SHA: $commitSha"
Write-Host "TypeSpec Commit URL: $typeSpecCommitUrl"
Write-Host "##vso[task.setvariable variable=TypeSpecCommitUrl]$typeSpecCommitUrl"
displayName: Set variables for PR creation

- task: UseDotNet@2
Expand All @@ -101,5 +96,5 @@ extends:
filePath: $(Build.SourcesDirectory)/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1
arguments: >
-PackageVersion '$(PackageVersion)'
-TypeSpecPRUrl '$(TypeSpecPRUrl)'
-TypeSpecCommitUrl '$(TypeSpecCommitUrl)'
-AuthToken '$(azuresdk-github-pat)'
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param(
[string]$PackageVersion,

[Parameter(Mandatory = $true)]
[string]$TypeSpecPRUrl,
[string]$TypeSpecCommitUrl,

[Parameter(Mandatory = $true)]
[string]$AuthToken,
Expand All @@ -34,7 +34,6 @@ Import-Module (Join-Path $PSScriptRoot "Generation.psm1") -DisableNameChecking -
$RepoOwner = "Azure"
$RepoName = "azure-sdk-for-net"
$BaseBranch = "main"
$PROwner = "azure-sdk"
$PRBranch = $BranchName

$PRTitle = "Update UnbrandedGeneratorVersion to $PackageVersion"
Expand All @@ -43,13 +42,14 @@ This PR updates the UnbrandedGeneratorVersion property in eng/Packages.Data.prop

## Details

- Original TypeSpec PR: $TypeSpecPRUrl
- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl

## Changes

- Updated eng/Packages.Data.props UnbrandedGeneratorVersion property
- Updated eng/packages/http-client-csharp/package.json dependency version
- Ran npm install to update package-lock.json
- Ran eng/packages/http-client-csharp/eng/scripts/Generate.ps1 to regenerate test projects

This is an automated PR created by the TypeSpec publish pipeline.
"@
Expand Down Expand Up @@ -169,26 +169,17 @@ try {

# Commit the changes
Write-Host "Committing changes..."
if ($propsFileUpdated) {
git add eng/Packages.Data.props
}
if ($packageJsonUpdated) {
git add eng/packages/http-client-csharp/package.json
git add eng/packages/http-client-csharp/package-lock.json
}
git add eng/Packages.Data.props
git add eng/packages/http-client-csharp/package.json
git add eng/packages/http-client-csharp/package-lock.json
git add eng/packages/http-client-csharp/generator/TestProjects/

if ($LASTEXITCODE -ne 0) {
throw "Failed to add changes"
}

# Build commit message based on what was updated
$commitMessage = "Update UnbrandedGeneratorVersion to $PackageVersion`n"
if ($propsFileUpdated) {
$commitMessage += "`n- Updated eng/Packages.Data.props"
}
if ($packageJsonUpdated) {
$commitMessage += "`n- Updated eng/packages/http-client-csharp/package.json"
$commitMessage += "`n- Ran npm install to update package-lock.json"
}
$commitMessage = "Update UnbrandedGeneratorVersion to $PackageVersion"

git commit -m $commitMessage
if ($LASTEXITCODE -ne 0) {
Expand Down
Loading