-
Notifications
You must be signed in to change notification settings - Fork 317
Add Manual OneBranch Release Stage & Publish Support (Internal/Public) #3761
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
e89f1e7
dd21456
02cbe58
a693ea4
ccc9259
adae0fa
4bb2180
226f6e7
9875749
b53d379
22c55d6
ad30487
e22f320
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,108 @@ | ||||||||
| ################################################################################# | ||||||||
| # Licensed to the .NET Foundation under one or more agreements. # | ||||||||
| # The .NET Foundation licenses this file to you under the MIT license. # | ||||||||
| # See the LICENSE file in the project root for more information. # | ||||||||
| ################################################################################# | ||||||||
| parameters: | ||||||||
| # Approval aliases for manual validation before publishing packages | ||||||||
| - name: approvalAliases | ||||||||
| type: string | ||||||||
| default: '[ADO.Net]\\SqlClient Admins' | ||||||||
|
|
||||||||
| # Where to publish the packages: 'Internal' or 'Public' feed | ||||||||
| - name: publishDestination | ||||||||
| type: string | ||||||||
|
|
||||||||
| # Boolean value to indicate whether to perform a dry run or actual publish | ||||||||
| - name: dryRun | ||||||||
| type: boolean | ||||||||
|
|
||||||||
| # Boolean value to indicate if the build is a preview release build | ||||||||
| - name: isPreview | ||||||||
| type: boolean | ||||||||
|
|
||||||||
| # Internal feed source URL for publishing packages to Azure DevOps Feed | ||||||||
| - name: internalFeedSource | ||||||||
| type: string | ||||||||
|
|
||||||||
| # Public NuGet source URL for publishing packages to public feed | ||||||||
| - name: publicNuGetSource | ||||||||
| type: string | ||||||||
|
|
||||||||
| # Boolean value to indicate whether to publish symbols | ||||||||
| - name: publishSymbols | ||||||||
| type: boolean | ||||||||
|
|
||||||||
| # Name of the folder containing the packages to be published | ||||||||
| - name: packageFolderName | ||||||||
| type: string | ||||||||
|
|
||||||||
| # NuGet package version to be published | ||||||||
| - name: nugetPackageVersion | ||||||||
| type: string | ||||||||
|
|
||||||||
| # Product name associated with the packages | ||||||||
| - name: product | ||||||||
| type: string | ||||||||
|
|
||||||||
| jobs: | ||||||||
| - job: AwaitApproval | ||||||||
| displayName: "Await Release Approval" | ||||||||
| pool: server | ||||||||
| steps: | ||||||||
| - task: ManualValidation@0 | ||||||||
| displayName: "Manual Approval" | ||||||||
| timeoutInMinutes: 4320 # 3 days | ||||||||
| inputs: | ||||||||
| notifyUsers: ${{ parameters.approvalAliases }} | ||||||||
| instructions: | | ||||||||
| Release Checklist: | ||||||||
| * Destination: ${{ parameters.publishDestination }} | ||||||||
| * Preview build: ${{ parameters.isPreview }} | ||||||||
| * Dry run: ${{ parameters.dryRun }} | ||||||||
| * Symbols: ${{ parameters.publishSymbols }} | ||||||||
| * NuGet package version: ${{ parameters.nugetPackageVersion }} | ||||||||
| * Product: ${{ parameters.product }} | ||||||||
| Approve to continue or Reject to abort. | ||||||||
|
|
||||||||
| - job: PublishPackages | ||||||||
| displayName: "Publish Packages" | ||||||||
| variables: | ||||||||
| - name: targetDownloadPath | ||||||||
| value: "$(Pipeline.Workspace)/release/packages" | ||||||||
| dependsOn: AwaitApproval | ||||||||
| condition: succeeded() | ||||||||
| pool: | ||||||||
| vmImage: "ubuntu-latest" | ||||||||
| steps: | ||||||||
| - task: DownloadPipelineArtifact@2 | ||||||||
| displayName: "Download Signed Packages" | ||||||||
| inputs: | ||||||||
| buildType: current | ||||||||
| artifactName: ${{ parameters.packageFolderName }} | ||||||||
| targetPath: ${{ variables.targetDownloadPath }} | ||||||||
| - script: | | ||||||||
| echo "NuGet Package Version: ${{ parameters.nugetPackageVersion }}" | ||||||||
| echo "Downloaded signed packages to: ${{ variables.targetDownloadPath }}" | ||||||||
| displayName: "Echo NuGet Package Version" | ||||||||
| # Push to Public NuGet Feed if publishDestination is 'Public' | ||||||||
| - ${{ if eq(parameters.publishDestination, 'Public') }}: | ||||||||
| - template: ../steps/publish-public-nuget-step.yml | ||||||||
| parameters: | ||||||||
| dryRun: ${{ parameters.dryRun }} | ||||||||
| publicNuGetSource: ${{ parameters.publicNuGetSource }} | ||||||||
| packagesGlob: ${{ variables.targetDownloadPath }}/*.nupkg | ||||||||
| # Else Push to Internal Feed | ||||||||
| - ${{ else }}: | ||||||||
| - template: ../steps/publish-internal-feed-step.yml | ||||||||
| parameters: | ||||||||
| dryRun: ${{ parameters.dryRun }} | ||||||||
| internalFeedSource: ${{ parameters.internalFeedSource }} | ||||||||
| packagesGlob: ${{ variables.targetDownloadPath }}/*.nupkg | ||||||||
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| # Publish Symbols if publishSymbols is true and is not a dry run | ||||||||
| - ${{ if and(parameters.publishSymbols, not(parameters.dryRun)) }}: | ||||||||
|
||||||||
| - ${{ if and(parameters.publishSymbols, not(parameters.dryRun)) }}: | |
| - ${{ if and(eq(parameters.publishSymbols, true), not(eq(parameters.dryRun, true))) }}: |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a required parameter in the publish-symbols-step template. According to the template definition, "referenceType" is a required parameter but it's not being passed in this invocation. Add the referenceType parameter to match the expected interface.
| product: ${{ parameters.product }} | |
| product: ${{ parameters.product }} | |
| referenceType: 'branch' |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| ################################################################################# | ||||||
| # Licensed to the .NET Foundation under one or more agreements. # | ||||||
| # The .NET Foundation licenses this file to you under the MIT license. # | ||||||
| # See the LICENSE file in the project root for more information. # | ||||||
| ################################################################################# | ||||||
| parameters: | ||||||
| # Boolean value to indicate whether to run the release stage | ||||||
| - name: runRelease | ||||||
| type: boolean | ||||||
| default: false | ||||||
|
|
||||||
| # Where to publish the packages: 'Internal' or 'Public' feed | ||||||
| - name: publishDestination | ||||||
| type: string | ||||||
|
|
||||||
| # Boolean value to indicate whether to perform a dry run or actual publish | ||||||
| - name: dryRun | ||||||
| type: boolean | ||||||
| default: true | ||||||
|
|
||||||
| # Approval aliases for manual validation before publishing packages | ||||||
| - name: approvalAliases | ||||||
| type: string | ||||||
|
|
||||||
| # Internal feed source URL for publishing packages to Azure DevOps Feed | ||||||
| - name: internalFeedSource | ||||||
| type: string | ||||||
|
|
||||||
| # Public NuGet source URL for publishing packages to public feed | ||||||
| - name: publicNuGetSource | ||||||
| type: string | ||||||
|
|
||||||
| # Boolean value to indicate whether to publish symbols | ||||||
| - name: publishSymbols | ||||||
| type: boolean | ||||||
| default: false | ||||||
|
|
||||||
| # Boolean value to indicate if the build is a preview release build | ||||||
| - name: isPreview | ||||||
| type: boolean | ||||||
|
|
||||||
| # Product name associated with the packages | ||||||
| - name: product | ||||||
| type: string | ||||||
|
|
||||||
| # NuGet package version to be published | ||||||
| - name: nugetPackageVersion | ||||||
| type: string | ||||||
|
|
||||||
| # Name of the folder containing the packages to be published | ||||||
| - name: packageFolderName | ||||||
| type: string | ||||||
|
|
||||||
| stages: | ||||||
| - stage: Release ${{ parameters.product }} | ||||||
|
||||||
| - stage: Release ${{ parameters.product }} | |
| - stage: Release_${{ parameters.product }} |
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ################################################################################# | ||
| # Licensed to the .NET Foundation under one or more agreements. # | ||
| # The .NET Foundation licenses this file to you under the MIT license. # | ||
| # See the LICENSE file in the project root for more information. # | ||
| ################################################################################# | ||
|
|
||
| # Template to publish NuGet packages to an internal Azure DevOps feed | ||
|
|
||
| parameters: | ||
| # Boolean value to indicate whether to perform a dry run or actual publish | ||
| - name: dryRun | ||
| type: boolean | ||
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| default: true | ||
|
|
||
| # Internal feed source URL for publishing packages to Azure DevOps Feed | ||
| - name: internalFeedSource | ||
| type: string | ||
|
|
||
| # Glob pattern to identify packages to be published | ||
| - name: packagesGlob | ||
| type: string | ||
|
|
||
| steps: | ||
| - script: | | ||
| pwsh ./tools/scripts/publishPackagesToAzDOFeed.ps1 ` | ||
| -dryRun ${{ parameters.dryRun }} ` | ||
| -internalFeedSource '${{ parameters.internalFeedSource }}' ` | ||
| -packagesGlob '${{ parameters.packagesGlob }}' | ||
| displayName: "Publish to Internal Feed" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| ################################################################################# | ||
| # Licensed to the .NET Foundation under one or more agreements. # | ||
| # The .NET Foundation licenses this file to you under the MIT license. # | ||
| # See the LICENSE file in the project root for more information. # | ||
| ################################################################################# | ||
|
|
||
| # Template to publish NuGet packages to a public NuGet feed | ||
|
|
||
| parameters: | ||
| # Boolean value to indicate whether to perform a dry run or actual publish | ||
| - name: dryRun | ||
| type: boolean | ||
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| default: true | ||
|
|
||
| # Public NuGet source URL for publishing packages to public feed | ||
| - name: publicNuGetSource | ||
| type: string | ||
|
|
||
| # Service connection name for authenticating to NuGet.org | ||
| - name: nugetServiceConnection | ||
| type: string | ||
| default: "ADO Nuget Org Connection" | ||
|
|
||
| # Glob pattern to identify packages to be published | ||
| - name: packagesGlob | ||
| type: string | ||
|
|
||
| steps: | ||
| - task: NuGetToolInstaller@1 | ||
| displayName: "Install Latest Nuget" | ||
| inputs: | ||
| checkLatest: true | ||
| - script: | | ||
| echo "[DRY RUN] Listing packages targeted for push to: ${{ parameters.publicNuGetSource }}" | ||
| echo "Using glob pattern: ${{ parameters.packagesGlob }}" | ||
| # Derive directory and filename pattern from the glob for a precise find (handles nested patterns minimally) | ||
| glob='${{ parameters.packagesGlob }}' | ||
| dir="${glob%/*}" | ||
| name="${glob##*/}" | ||
| echo "Resolved directory: $dir" | ||
| echo "Filename pattern: $name" | ||
| if [ -d "$dir" ]; then | ||
| echo "Matched files:" || true | ||
| # Print all matched files to identify what would be pushed | ||
| find "$dir" -type f -name "$name" -print || true | ||
| else | ||
| echo "Directory does not exist yet: $dir" | ||
| fi | ||
| displayName: "Dry Run - List Packages" | ||
| condition: and(succeeded(), eq(${{ parameters.dryRun }}, true)) | ||
|
|
||
| - task: NuGetCommand@2 | ||
| displayName: "Push to Nuget.org" | ||
| condition: and(succeeded(), eq(${{ parameters.dryRun }}, false)) | ||
| inputs: | ||
| command: push | ||
| packagesToPush: "${{ parameters.packagesGlob }}" | ||
| nuGetFeedType: external | ||
| publishFeedCredentials: "${{ parameters.nugetServiceConnection }}" | ||
Uh oh!
There was an error while loading. Please reload this page.