-
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
Open
cheenamalhotra
wants to merge
13
commits into
main
Choose a base branch
from
dev/cheena/gov-release-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e89f1e7
Add publish support in OneBranch Official pipeline
cheenamalhotra dd21456
Improvements
cheenamalhotra 02cbe58
Cleanups
cheenamalhotra a693ea4
Minor touch-ups
cheenamalhotra ccc9259
Convert inline script to ps script file
cheenamalhotra adae0fa
More changes
cheenamalhotra 4bb2180
Minor changes
cheenamalhotra 226f6e7
Update official signing pipeline
cheenamalhotra 9875749
Code formattings
cheenamalhotra b53d379
Merge branch 'main' into dev/cheena/gov-release-templates
cheenamalhotra 22c55d6
Update release-stage.yml
cheenamalhotra ad30487
Update powershell task
cheenamalhotra e22f320
Update eng/pipelines/common/templates/steps/publish-symbols-step.yml
cheenamalhotra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| ################################################################################# | ||
| # 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: | ||
| - name: approvalAliases | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: string | ||
| default: '[ADO.Net]\\SqlClient Admins' | ||
|
|
||
| - name: publishDestination | ||
| type: string | ||
|
|
||
| - name: dryRun | ||
| type: boolean | ||
|
|
||
| - name: isPreview | ||
| type: boolean | ||
|
|
||
| - name: publishSymbols | ||
| type: boolean | ||
|
|
||
| - name: nugetPackageVersion | ||
| type: string | ||
|
|
||
| - 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. | ||
65 changes: 65 additions & 0 deletions
65
eng/pipelines/common/templates/jobs/publish-packages-job.yml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| ################################################################################# | ||
| # 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: | ||
| - name: publishDestination | ||
| type: string | ||
|
|
||
| - name: dryRun | ||
| type: boolean | ||
|
|
||
| - name: internalFeedSource | ||
| type: string | ||
|
|
||
| - name: publicNuGetSource | ||
| type: string | ||
|
|
||
| - name: publishSymbols | ||
| type: boolean | ||
|
|
||
| - name: packageFolderName | ||
| type: string | ||
|
|
||
| - name: nugetPackageVersion | ||
| type: string | ||
|
|
||
| - name: product | ||
| type: string | ||
|
|
||
| jobs: | ||
| - job: PublishPackages | ||
| displayName: 'Publish Packages' | ||
| dependsOn: AwaitApproval | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| condition: succeeded() | ||
| pool: | ||
| vmImage: 'ubuntu-latest' | ||
| steps: | ||
| - task: DownloadPipelineArtifact@2 | ||
| displayName: 'Download Signed Packages' | ||
| inputs: | ||
| buildType: current | ||
| artifactName: ${{ parameters.packageFolderName }} | ||
| targetPath: $(Pipeline.Workspace)/release/packages | ||
| - script: | | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "NuGet Package Version: ${{ parameters.nugetPackageVersion }}" | ||
| displayName: 'Echo NuGet Package Version' | ||
| - ${{ if ne(parameters.publishDestination, 'Public') }}: | ||
| - template: ../steps/publish-internal-feed-step.yml | ||
| parameters: | ||
| dryRun: ${{ parameters.dryRun }} | ||
| internalFeedSource: ${{ parameters.internalFeedSource }} | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| packagesGlob: $(System.DefaultWorkingDirectory)/_dotnet-sqlclient-Official/drop_buildMDS_build_signed_package/*.nupkg | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - ${{ if eq(parameters.publishDestination, 'Public') }}: | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - template: ../steps/publish-public-nuget-step.yml | ||
| parameters: | ||
| dryRun: ${{ parameters.dryRun }} | ||
| publicNuGetSource: ${{ parameters.publicNuGetSource }} | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| packagesGlob: $(System.DefaultWorkingDirectory)/_dotnet-sqlclient-Official/drop_buildMDS_build_signed_package/*.nupkg | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - ${{ if and(parameters.publishSymbols, ne(parameters.dryRun, true)) }}: | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - template: ../steps/publish-symbols-step.yml | ||
| parameters: | ||
| publishSymbols: ${{ parameters.publishSymbols }} | ||
| symbolsArtifactName: ${{ parameters.product }}_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_${{ parameters.nugetPackageVersion }}_$(System.TimelineId) | ||
| product: ${{ parameters.product }} | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| ################################################################################# | ||
| # 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: | ||
| - name: runRelease | ||
| type: boolean | ||
| default: false | ||
|
|
||
| - name: publishDestination | ||
| type: string | ||
|
|
||
| - name: dryRun | ||
| type: boolean | ||
| default: false | ||
|
|
||
| - name: approvalAliases | ||
| type: string | ||
|
|
||
| - name: internalFeedSource | ||
| type: string | ||
|
|
||
| - name: publicNuGetSource | ||
| type: string | ||
|
|
||
| - name: publishSymbols | ||
| type: boolean | ||
| default: false | ||
|
|
||
| - name: isPreview | ||
| type: boolean | ||
|
|
||
| - name: product | ||
| type: string | ||
|
|
||
| - name: nugetPackageVersion | ||
| type: string | ||
|
|
||
| - name: packageFolderName | ||
| type: string | ||
|
|
||
| stages: | ||
| - stage: releaseMDS | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| displayName: 'Release (Manual)' | ||
| condition: and(succeeded(), eq(variables['Build.Reason'],'Manual'), eq(${{ parameters.runRelease }}, true)) | ||
| jobs: | ||
| - template: ../jobs/approval-job.yml | ||
| parameters: | ||
| approvalAliases: ${{ parameters.approvalAliases }} | ||
| publishDestination: ${{ parameters.publishDestination }} | ||
| dryRun: ${{ parameters.dryRun }} | ||
| isPreview: ${{ parameters.isPreview }} | ||
| publishSymbols: ${{ parameters.publishSymbols }} | ||
| nugetPackageVersion: ${{ parameters.nugetPackageVersion }} | ||
| product: ${{ parameters.product }} | ||
| - template: ../jobs/publish-packages-job.yml | ||
| parameters: | ||
| publishDestination: ${{ parameters.publishDestination }} | ||
| dryRun: ${{ parameters.dryRun }} | ||
| internalFeedSource: ${{ parameters.internalFeedSource }} | ||
| publicNuGetSource: ${{ parameters.publicNuGetSource }} | ||
| publishSymbols: ${{ parameters.publishSymbols }} | ||
| packageFolderName: ${{ parameters.packageFolderName }} | ||
| nugetPackageVersion: ${{ parameters.nugetPackageVersion }} | ||
| product: ${{ parameters.product }} | ||
46 changes: 46 additions & 0 deletions
46
eng/pipelines/common/templates/steps/publish-internal-feed-step.yml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ################################################################################# | ||
| # 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: | ||
| - name: dryRun | ||
| type: boolean | ||
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: internalFeedSource | ||
| type: string | ||
|
|
||
| - name: packagesGlob | ||
| type: string | ||
| default: '$(System.DefaultWorkingDirectory)/_dotnet-sqlclient-Official/drop_buildMDS_build_signed_package/*.nupkg' | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| steps: | ||
| - script: | | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set -e | ||
| SRC='${{ parameters.internalFeedSource }}' | ||
| if [ -z "$SRC" ]; then | ||
| echo "Internal feed source parameter not set." | ||
| exit 1 | ||
| fi | ||
| if [ "${{ parameters.dryRun }}" = "true" ]; then | ||
| echo "[DRY RUN] Listing packages targeted for push to: ${{ parameters.publicNuGetSource }}" | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
| fi | ||
| for f in $(find "${{ parameters.packagesGlob }}" -name "*.nupkg"); do | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "Push $f" | ||
| dotnet nuget push --source "$SRC" --api-key az "$f" | ||
| done | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| displayName: 'Publish to Internal Feed' | ||
52 changes: 52 additions & 0 deletions
52
eng/pipelines/common/templates/steps/publish-public-nuget-step.yml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| ################################################################################# | ||
| # 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: | ||
| - name: dryRun | ||
| type: boolean | ||
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: publicNuGetSource | ||
| type: string | ||
|
|
||
| - name: nugetServiceConnection | ||
| type: string | ||
| default: 'ADO Nuget Org Connection' | ||
|
|
||
| - name: packagesGlob | ||
| type: string | ||
| default: '$(System.DefaultWorkingDirectory)/_dotnet-sqlclient-Official/drop_buildMDS_build_signed_package/*.nupkg' | ||
|
|
||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| steps: | ||
| - task: NuGetToolInstaller@1 | ||
paulmedynski marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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)) | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - task: NuGetCommand@2 | ||
| displayName: 'Push to Nuget.org' | ||
| condition: and(succeeded(), eq(${{ parameters.dryRun }}, false)) | ||
cheenamalhotra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inputs: | ||
| command: push | ||
| packagesToPush: '${{ parameters.packagesGlob }}' | ||
| nuGetFeedType: external | ||
| publishFeedCredentials: '${{ parameters.nugetServiceConnection }}' | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.