diff --git a/eng/ci/publish.yml b/eng/ci/publish.yml index c6de906..6a14eb3 100644 --- a/eng/ci/publish.yml +++ b/eng/ci/publish.yml @@ -1,6 +1,6 @@ # This is our package-publishing pipeline. # When executed, it automatically publishes the output of the 'official pipeline' (the nupkgs) to our internal ADO feed. -# It may optionally also publish the packages to NuGet, but that is gated behind a manual approval. +# It may optionally also publish the signed packages to NuGet through ESRP, gated behind a manual approval. trigger: none # only trigger is manual pr: none # only trigger is manual @@ -43,7 +43,7 @@ extends: targetPath: $(System.DefaultWorkingDirectory)/drop # The preferred method of release on 1ES is by populating the 'output' section of a 1ES template. - # We use this method to release to ADO, but not to release to NuGet; this is explained in the 'nugetRelease' job. + # Public NuGet publishing uses ESRP Release in the jobs below. # To read more about the 'output syntax', see: # - https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs # - https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs/nuget-packages @@ -76,20 +76,42 @@ extends: templateContext: type: releaseJob isProduction: true + environment: durabletask-pypi-prod inputs: - input: pipelineArtifact pipeline: officialPipeline # Pipeline reference as defined in the resources section artifactName: drop targetPath: $(System.DefaultWorkingDirectory)/drop steps: - - task: 1ES.PublishNuget@1 - displayName: 'NuGet push (Microsoft.DurableTask.SqlServer)' + - task: CopyFiles@2 + displayName: Stage Microsoft.DurableTask.SqlServer for ESRP inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: 'DurableTask org NuGet API Key' - packagesToPush: '$(System.DefaultWorkingDirectory)/drop/Microsoft.DurableTask.SqlServer.*.nupkg;!$(System.DefaultWorkingDirectory)/drop/Microsoft.DurableTask.SqlServer.AzureFunctions*.nupkg;!$(System.DefaultWorkingDirectory)/**/*.symbols.nupkg' # Excludes Microsoft.DurableTask.SqlServer.AzureFunctions.nupkg - packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling + SourceFolder: '$(System.DefaultWorkingDirectory)/drop' + Contents: | + Microsoft.DurableTask.SqlServer.*.nupkg + !Microsoft.DurableTask.SqlServer.AzureFunctions*.nupkg + !**/*.symbols.nupkg + TargetFolder: '$(Agent.TempDirectory)/esrp-nuget' + CleanTargetFolder: true + - task: SFP.release-tasks.custom-build-release-task.EsrpRelease@14 + displayName: 'ESRP Release Microsoft.DurableTask.SqlServer' + inputs: + connectedservicename: 'dtfx-internal-esrp-prod' + usemanagedidentity: true + keyvaultname: 'durable-esrp-akv' + signcertname: 'dts-esrp-cert' + clientid: '0b3ed1a4-0727-4a50-b82a-02c2bd9dec89' + intent: 'PackageDistribution' + contenttype: 'NuGet' + organizationname: 'durabletask' + contentsource: 'Folder' + folderlocation: '$(Agent.TempDirectory)/esrp-nuget' + waitforreleasecompletion: true + owners: $(Build.RequestedForEmail) + approvers: $(Build.RequestedForEmail) + serviceendpointurl: 'https://api.esrp.microsoft.com' + mainpublisher: 'ESRPRELPACMAN' + domaintenantid: '33e01921-4d64-4f8c-a055-5bdaffd5e33d' # NuGet release (Microsoft.DurableTask.SqlServer.AzureFunctions) - job: nugetRelease_Microsoft_DurableTask_SqlServer_AzureFunctions @@ -101,20 +123,41 @@ extends: templateContext: type: releaseJob isProduction: true + environment: durabletask-pypi-prod inputs: - input: pipelineArtifact pipeline: officialPipeline # Pipeline reference as defined in the resources section artifactName: drop targetPath: $(System.DefaultWorkingDirectory)/drop steps: - - task: 1ES.PublishNuget@1 - displayName: 'NuGet push (Microsoft.DurableTask.SqlServer.AzureFunctions)' + - task: CopyFiles@2 + displayName: Stage Microsoft.DurableTask.SqlServer.AzureFunctions for ESRP inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: 'DurableTask org NuGet API Key' - packagesToPush: '$(System.DefaultWorkingDirectory)/drop/Microsoft.DurableTask.SqlServer.AzureFunctions.*.nupkg;!$(System.DefaultWorkingDirectory)/**/*.symbols.nupkg' # Despite this being a custom command, we need to keep this for 1ES validation - packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling + SourceFolder: '$(System.DefaultWorkingDirectory)/drop' + Contents: | + Microsoft.DurableTask.SqlServer.AzureFunctions.*.nupkg + !**/*.symbols.nupkg + TargetFolder: '$(Agent.TempDirectory)/esrp-nuget' + CleanTargetFolder: true + - task: SFP.release-tasks.custom-build-release-task.EsrpRelease@14 + displayName: 'ESRP Release Microsoft.DurableTask.SqlServer.AzureFunctions' + inputs: + connectedservicename: 'dtfx-internal-esrp-prod' + usemanagedidentity: true + keyvaultname: 'durable-esrp-akv' + signcertname: 'dts-esrp-cert' + clientid: '0b3ed1a4-0727-4a50-b82a-02c2bd9dec89' + intent: 'PackageDistribution' + contenttype: 'NuGet' + organizationname: 'durabletask' + contentsource: 'Folder' + folderlocation: '$(Agent.TempDirectory)/esrp-nuget' + waitforreleasecompletion: true + owners: $(Build.RequestedForEmail) + approvers: $(Build.RequestedForEmail) + serviceendpointurl: 'https://api.esrp.microsoft.com' + mainpublisher: 'ESRPRELPACMAN' + domaintenantid: '33e01921-4d64-4f8c-a055-5bdaffd5e33d' # NuGet release (Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer) @@ -127,17 +170,38 @@ extends: templateContext: type: releaseJob isProduction: true + environment: durabletask-pypi-prod inputs: - input: pipelineArtifact pipeline: officialPipeline # Pipeline reference as defined in the resources section artifactName: drop targetPath: $(System.DefaultWorkingDirectory)/drop steps: - - task: 1ES.PublishNuget@1 - displayName: 'NuGet push (Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer)' + - task: CopyFiles@2 + displayName: Stage Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer for ESRP inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: 'DurableTask org NuGet API Key' - packagesToPush: '$(System.DefaultWorkingDirectory)/drop/Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer.*.nupkg;!$(System.DefaultWorkingDirectory)/**/*.symbols.nupkg' # Despite this being a custom command, we need to keep this for 1ES validation - packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling + SourceFolder: '$(System.DefaultWorkingDirectory)/drop' + Contents: | + Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer.*.nupkg + !**/*.symbols.nupkg + TargetFolder: '$(Agent.TempDirectory)/esrp-nuget' + CleanTargetFolder: true + - task: SFP.release-tasks.custom-build-release-task.EsrpRelease@14 + displayName: 'ESRP Release Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer' + inputs: + connectedservicename: 'dtfx-internal-esrp-prod' + usemanagedidentity: true + keyvaultname: 'durable-esrp-akv' + signcertname: 'dts-esrp-cert' + clientid: '0b3ed1a4-0727-4a50-b82a-02c2bd9dec89' + intent: 'PackageDistribution' + contenttype: 'NuGet' + organizationname: 'durabletask' + contentsource: 'Folder' + folderlocation: '$(Agent.TempDirectory)/esrp-nuget' + waitforreleasecompletion: true + owners: $(Build.RequestedForEmail) + approvers: $(Build.RequestedForEmail) + serviceendpointurl: 'https://api.esrp.microsoft.com' + mainpublisher: 'ESRPRELPACMAN' + domaintenantid: '33e01921-4d64-4f8c-a055-5bdaffd5e33d'