diff --git a/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml index 9fb3620bf6..b09e8e1555 100644 --- a/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml +++ b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml @@ -98,18 +98,19 @@ jobs: - ${{ parameters.prebuildSteps }} # If we're testing in Package mode, then we must download dependent package artifacts. + # Downloads go to localFeedPath (local NuGet source), not $(packagePath) (build output). - ${{ if eq(parameters.referenceType, 'Package') }}: - task: DownloadPipelineArtifact@2 displayName: Download Abstractions Package Artifacts inputs: artifactName: ${{ parameters.abstractionsArtifactsName }} - targetPath: $(packagePath) + targetPath: $(localFeedPath) - task: DownloadPipelineArtifact@2 displayName: Download Logging Package Artifacts inputs: artifactName: ${{ parameters.loggingArtifactsName }} - targetPath: $(packagePath) + targetPath: $(localFeedPath) # Install the .NET SDK. - template: /eng/pipelines/steps/install-dotnet.yml@self @@ -149,6 +150,16 @@ jobs: properties: 'AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }};LoggingPackageVersion=${{ parameters.loggingPackageVersion }}' referenceType: ${{ parameters.referenceType }} + # When building in Package mode, the AKV restore needs to find the MDS package + # we just built. Copy it to the local NuGet feed so NuGet.config can resolve it. + - ${{ if eq(parameters.referenceType, 'Package') }}: + - task: CopyFiles@2 + displayName: Copy MDS Package to Local Feed + inputs: + sourceFolder: $(packagePath) + contents: 'Microsoft.Data.SqlClient.*.nupkg' + targetFolder: $(localFeedPath) + - template: /eng/pipelines/common/templates/steps/ci-project-build-step.yml@self parameters: platform: ${{ parameters.platform }} diff --git a/eng/pipelines/jobs/pack-azure-package-ci-job.yml b/eng/pipelines/jobs/pack-azure-package-ci-job.yml index fc0e2a6b3d..95853d43e0 100644 --- a/eng/pipelines/jobs/pack-azure-package-ci-job.yml +++ b/eng/pipelines/jobs/pack-azure-package-ci-job.yml @@ -19,6 +19,13 @@ parameters: type: string default: Abstractions.Artifacts + # The name of the Logging pipeline artifacts to download. + # + # This is used when the referenceType is 'Package'. + - name: loggingArtifactsName + type: string + default: Logging.Artifacts + # The Abstractions package verion to depend on. # # This is used when the referenceType is 'Package'. @@ -126,7 +133,7 @@ jobs: - pwsh: 'Get-ChildItem Env: | Sort-Object Name' displayName: '[Debug] Print Environment Variables' - # For Package reference builds, we must first download the Abstractions package artifacts. + # For Package reference builds, we must first download the dependency package artifacts. - ${{ if eq(parameters.referenceType, 'Package') }}: - task: DownloadPipelineArtifact@2 displayName: Download Abstractions Package Artifacts @@ -134,6 +141,12 @@ jobs: artifactName: ${{ parameters.abstractionsArtifactsName }} targetPath: $(Build.SourcesDirectory)/packages + - task: DownloadPipelineArtifact@2 + displayName: Download Logging Package Artifacts + inputs: + artifactName: ${{ parameters.loggingArtifactsName }} + targetPath: $(Build.SourcesDirectory)/packages + # Install the .NET SDK. - template: /eng/pipelines/steps/install-dotnet.yml@self parameters: diff --git a/eng/pipelines/jobs/test-azure-package-ci-job.yml b/eng/pipelines/jobs/test-azure-package-ci-job.yml index 13db1e9b31..53ca26366f 100644 --- a/eng/pipelines/jobs/test-azure-package-ci-job.yml +++ b/eng/pipelines/jobs/test-azure-package-ci-job.yml @@ -19,6 +19,13 @@ parameters: type: string default: Abstractions.Artifacts + # The name of the Logging pipeline artifacts to download. + # + # This is used when the referenceType is 'Package'. + - name: loggingArtifactsName + type: string + default: Logging.Artifacts + # The Abstractions package verion to depend on. # # This is used when the referenceType is 'Package'. @@ -187,6 +194,13 @@ jobs: artifactName: ${{ parameters.abstractionsArtifactsName }} targetPath: $(Build.SourcesDirectory)/packages + # Download the Logging package artifacts into packages/. + - task: DownloadPipelineArtifact@2 + displayName: Download Logging Package Artifacts + inputs: + artifactName: ${{ parameters.loggingArtifactsName }} + targetPath: $(Build.SourcesDirectory)/packages + # Download the MDS package artifacts into packages/. # # The Azure project doesn't depend on MDS, but the test project does. diff --git a/eng/pipelines/libraries/ci-build-variables.yml b/eng/pipelines/libraries/ci-build-variables.yml index 6f93e5a292..2779277678 100644 --- a/eng/pipelines/libraries/ci-build-variables.yml +++ b/eng/pipelines/libraries/ci-build-variables.yml @@ -62,10 +62,17 @@ variables: - name: mdsPackageVersion value: 7.0.0.$(Build.BuildNumber)-ci - # Output path for built NuGet packages - - name: packagePath + # Local NuGet feed directory where downloaded pipeline artifacts are placed. + # NuGet.config references this as a local package source for restore. + - name: localFeedPath value: $(Build.SourcesDirectory)/packages + # Output path for built NuGet packages. This is intentionally separate from + # localFeedPath (where downloaded pipeline artifacts go) so that artifact + # publishing only uploads packages built by the current job. + - name: packagePath + value: $(Build.SourcesDirectory)/output + # Disable codesign validation injection for CI builds - name: runCodesignValidationInjection value: false