-
Notifications
You must be signed in to change notification settings - Fork 330
Add CI package pipeline for building and publishing NuGet packages #4292
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
Draft
paulmedynski
wants to merge
22
commits into
dev/paul/internals-package-mode
Choose a base branch
from
dev/paul/sqlclient-package
base: dev/paul/internals-package-mode
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.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3a8467d
Add SqlServer.Server as a sibling project reference
paulmedynski 9da60b7
Gate UDT tests on SqlServer.Server strong-name signing
paulmedynski e22b8b7
Tokenize SqlServer.Server version in nuspec and fix BuildTests
paulmedynski 01b0358
Plumb SqlServerPackageVersion through CI pipelines
paulmedynski 972665d
Fix net462 build: enable implicit usings in TestCommon, fix typo
paulmedynski 716a7a1
Add comments explaining Versions.props import-guard pattern
paulmedynski bb91c5f
Exclude UDT tests requiring signed assemblies on unsigned .NET Framew…
paulmedynski 7306a00
Bump sibling package versions and fix Package-mode dependency ordering
paulmedynski 5b3e87d
Updated CI package versions to match those in csproj.
paulmedynski 3a1792e
Fix incorrect MSBuild property name in Azure test job
paulmedynski 6dc9da5
Thread loggingPackageVersion through Azure test pipeline
paulmedynski ecbe841
Skipping the pack dependencies for Build* targets in build.proj for O…
paulmedynski 376eecb
Add SqlServer artifact dependency to downstream OneBranch jobs
paulmedynski d8ccb8d
Enable InternalsVisibleTo for test projects in Package mode
paulmedynski 2463f9a
Pipeline: run unit tests in both Project and Package modes
paulmedynski e91096e
Reverted some straggler leftover changes from previous attempts.
paulmedynski 900ed25
Added new sqlclient-package CI pipeline.
paulmedynski 21ad290
Updated pool choice to use the Azure DevOps project name.
paulmedynski 2d0937c
Add CI package pipeline for building and publishing NuGet packages
paulmedynski 60cfc11
Address Copilot review: declare signingKeyArg conditionally, remove d…
paulmedynski bef42de
Exclude the new CI pipeline files from PR checks.
paulmedynski c07c795
Address Copilot review: fix verbosity switch and boolean comparisons
paulmedynski 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
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 |
|---|---|---|
|
|
@@ -376,3 +376,6 @@ MigrationBackup/ | |
|
|
||
| # MDS "Not Supported" GenAPI code | ||
| **/notsupported/*.cs | ||
|
|
||
| # C# language server cache | ||
| *.lscache | ||
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,169 @@ | ||
| ################################################################################# | ||
| # 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. # | ||
| ################################################################################# | ||
|
|
||
| # This pipeline builds all packages using the build.proj Pack target with ReferenceType=Package, | ||
| # then publishes the resulting .nupkg and .snupkg files as a single pipeline artifact. | ||
| # | ||
| # It runs: | ||
| # - On pushes to GitHub main and ADO internal/main (batched) | ||
| # - Nightly at 00:00 UTC on both branches | ||
| # | ||
| # On internal/main the strong-name signing key is downloaded and used to sign assemblies during the | ||
| # build. | ||
| # | ||
| # GOTCHA: This pipeline definition is triggered by GitHub _and_ ADO CI. We distinguish the two via | ||
| # branch filters: | ||
| # | ||
| # - Only the GitHub repo has a 'main' branch. | ||
| # - Only the ADO repo has an 'internal/main' branch. | ||
|
|
||
| name: $(DayOfYear)$(Rev:rr) | ||
|
|
||
| # Do not trigger this pipeline for PRs. | ||
| pr: none | ||
|
|
||
| # Trigger on pushes to main and internal/main, batching concurrent commits. | ||
| trigger: | ||
| batch: true | ||
| branches: | ||
| include: | ||
| - main | ||
| - internal/main | ||
|
|
||
| # Nightly schedule at 00:00 UTC. | ||
| schedules: | ||
| - cron: '0 0 * * *' | ||
| displayName: Nightly Build | ||
| branches: | ||
| include: | ||
| - main | ||
| - internal/main | ||
| always: true | ||
|
|
||
| # Pipeline parameters visible in the Azure DevOps UI. | ||
| parameters: | ||
|
|
||
| # The agent image to use for the build. This must exist in both the ADO-1ES-Pool and | ||
| # ADO-CI-1ES-Pool agent pools. | ||
| - name: agentImage | ||
| displayName: Agent Image | ||
| type: string | ||
| default: ADO-UB24 | ||
|
paulmedynski marked this conversation as resolved.
|
||
| values: | ||
| - ADO-UB24 | ||
| - ADO-Win25 | ||
|
|
||
| # The build configuration to use, either Debug or Release. | ||
| - name: buildConfiguration | ||
| displayName: Build Configuration | ||
| type: string | ||
| default: Release | ||
| values: | ||
| - Debug | ||
| - Release | ||
|
|
||
| # True to enable debug steps and output. | ||
| - name: debug | ||
| displayName: Enable debug output | ||
| type: boolean | ||
| default: false | ||
|
|
||
| # The verbosity level of dotnet CLI commands. | ||
| - name: dotnetVerbosity | ||
| displayName: dotnet CLI Verbosity | ||
| type: string | ||
| default: normal | ||
| values: | ||
| - quiet | ||
| - minimal | ||
| - normal | ||
| - detailed | ||
| - diagnostic | ||
|
|
||
| variables: | ||
| # Whether this is an internal (ADO.Net project) or public (Public project) build. | ||
| - name: isInternalBuild | ||
| value: ${{ eq(variables['System.TeamProject'], 'ADO.Net') }} | ||
|
|
||
| # Signing key argument passed to build.proj. On internal builds this references the secure file | ||
| # downloaded by DownloadSecureFile@1; on public builds it expands to empty. | ||
| - name: signingKeyArg | ||
| ${{ if eq(variables.isInternalBuild, true) }}: | ||
| value: '-p:SigningKeyPath="$(keyFile.secureFilePath)"' | ||
|
paulmedynski marked this conversation as resolved.
|
||
| ${{ else }}: | ||
| value: '' | ||
|
|
||
| jobs: | ||
| - job: pack_all_packages | ||
| displayName: Pack All Packages | ||
|
|
||
| pool: | ||
| ${{ if eq(variables.isInternalBuild, true) }}: | ||
| name: ADO-1ES-Pool | ||
| ${{ else }}: | ||
| name: ADO-CI-1ES-Pool | ||
| demands: | ||
| - ImageOverride -equals ${{ parameters.agentImage }} | ||
|
|
||
|
paulmedynski marked this conversation as resolved.
|
||
| steps: | ||
|
|
||
| # Emit environment variables if debug is enabled. | ||
| - ${{ if eq(parameters.debug, true) }}: | ||
| - pwsh: | | ||
| Get-ChildItem Env: | Sort-Object Name | Format-Table -AutoSize -Wrap | ||
| displayName: '[Debug] Print Environment Variables' | ||
|
|
||
| # Install the .NET SDK from global.json. | ||
| - template: /eng/pipelines/steps/install-dotnet.yml@self | ||
| parameters: | ||
| debug: ${{ parameters.debug }} | ||
|
|
||
| # Clean any pre-existing .nupkg / .snupkg files from the packages/ directory | ||
| # to ensure we only publish packages produced by this run. | ||
| - pwsh: | | ||
| Write-Host 'Cleaning packages/ directory...' | ||
| Remove-Item -Force "$(Build.SourcesDirectory)/packages/*.nupkg" -ErrorAction SilentlyContinue | ||
| Remove-Item -Force "$(Build.SourcesDirectory)/packages/*.snupkg" -ErrorAction SilentlyContinue | ||
| Write-Host 'Done.' | ||
| displayName: Clean packages/ directory | ||
|
|
||
| # On internal builds, download the strong-name signing key. | ||
| - ${{ if eq(variables.isInternalBuild, true) }}: | ||
| - task: DownloadSecureFile@1 | ||
| displayName: Download Signing Key | ||
| inputs: | ||
| secureFile: netfxKeypair.snk | ||
| name: keyFile | ||
|
|
||
| # Run the Pack target via build.proj. | ||
| - task: DotNetCoreCLI@2 | ||
| displayName: build.proj - Pack (ReferenceType=Package) | ||
| inputs: | ||
| command: build | ||
| projects: '$(Build.SourcesDirectory)/build.proj' | ||
| arguments: >- | ||
| -t:Pack | ||
| -p:Configuration=${{ parameters.buildConfiguration }} | ||
| -p:ReferenceType=Package | ||
| -p:BuildNumber="$(Build.BuildNumber)" | ||
| -p:BuildSuffix=ci | ||
| $(signingKeyArg) | ||
| --verbosity ${{ parameters.dotnetVerbosity }} | ||
|
|
||
| # List produced packages for diagnostics. | ||
| - pwsh: | | ||
| Write-Host 'Packages produced:' | ||
| Get-ChildItem "$(Build.SourcesDirectory)/packages/*.nupkg" -ErrorAction SilentlyContinue | Format-Table Name, Length -AutoSize -Wrap | ||
| Get-ChildItem "$(Build.SourcesDirectory)/packages/*.snupkg" -ErrorAction SilentlyContinue | Format-Table Name, Length -AutoSize -Wrap | ||
| displayName: List produced packages | ||
|
|
||
| # Publish all .nupkg and .snupkg files from packages/ as a pipeline artifact. | ||
| - task: PublishPipelineArtifact@1 | ||
| displayName: Publish NuGet Packages | ||
| inputs: | ||
| targetPath: '$(Build.SourcesDirectory)/packages' | ||
| artifactName: Packages | ||
| publishLocation: pipeline | ||
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
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
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.