Skip to content

Commit 21d80eb

Browse files
authored
Update MSSQL publish.yml NuGet release step (#314)
1 parent dbf5a20 commit 21d80eb

1 file changed

Lines changed: 61 additions & 19 deletions

File tree

eng/ci/publish.yml

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,72 @@ extends:
7070
instructions: Confirm you want to push to NuGet
7171
onTimeout: 'reject'
7272

73-
# NuGet release
74-
- job: nugetRelease
75-
displayName: NuGet Release
76-
dependsOn:
77-
- nugetApproval
78-
- adoRelease
79-
condition: succeeded('nugetApproval', 'adoRelease')
73+
# NuGet release (Microsoft.DurableTask.SqlServer)
74+
- job: nugetRelease_Microsoft_DurableTask_SqlServer
75+
displayName: NuGet Release (Microsoft.DurableTask.SqlServer)
76+
dependsOn: nugetApproval
77+
condition: succeeded('nugetApproval') # nuget packages need to be on ADO first
8078
templateContext:
79+
type: releaseJob
80+
isProduction: true
8181
inputs:
8282
- input: pipelineArtifact
8383
pipeline: officialPipeline # Pipeline reference as defined in the resources section
8484
artifactName: drop
8585
targetPath: $(System.DefaultWorkingDirectory)/drop
86-
# Ideally, we would push to NuGet using the 1ES "template output" syntax, like we do for ADO.
87-
# Unfortunately, that syntax does not allow for skipping duplicates when pushing to NuGet feeds
88-
# (i.e; not failing the job when trying to push a package version that already exists on NuGet).
89-
# This is a problem for us because our pipelines often produce multiple packages, and we want to be able to
90-
# perform a 'nuget push *.nupkg' that skips packages already on NuGet while pushing the rest.
91-
# Therefore, we use a regular .NET Core ADO Task to publish the packages until that usability gap is addressed.
9286
steps:
93-
- task: DotNetCoreCLI@2
94-
displayName: 'Push to nuget.org'
87+
- task: 1ES.PublishNuget@1
88+
displayName: 'NuGet push (Microsoft.DurableTask.SqlServer)'
9589
inputs:
96-
command: custom
97-
custom: nuget
98-
arguments: 'push "*.nupkg" --api-key $(nuget_api_key) --skip-duplicate --source https://api.nuget.org/v3/index.json'
99-
workingDirectory: '$(System.DefaultWorkingDirectory)/drop'
90+
command: push
91+
nuGetFeedType: external
92+
publishFeedCredentials: 'DurableTask org NuGet API Key'
93+
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
94+
packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling
95+
96+
# NuGet release (Microsoft.DurableTask.SqlServer.AzureFunctions)
97+
- job: nugetRelease_Microsoft_DurableTask_SqlServer_AzureFunctions
98+
displayName: NuGet Release (Microsoft.DurableTask.SqlServer.AzureFunctions)
99+
dependsOn: nugetApproval
100+
condition: succeeded('nugetApproval') # nuget packages need to be on ADO first
101+
templateContext:
102+
type: releaseJob
103+
isProduction: true
104+
inputs:
105+
- input: pipelineArtifact
106+
pipeline: officialPipeline # Pipeline reference as defined in the resources section
107+
artifactName: drop
108+
targetPath: $(System.DefaultWorkingDirectory)/drop
109+
steps:
110+
- task: 1ES.PublishNuget@1
111+
displayName: 'NuGet push (Microsoft.DurableTask.SqlServer.AzureFunctions)'
112+
inputs:
113+
command: push
114+
nuGetFeedType: external
115+
publishFeedCredentials: 'DurableTask org NuGet API Key'
116+
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
117+
packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling
118+
119+
120+
# NuGet release (Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer)
121+
- job: nugetRelease_Microsoft_Azure_Functions_Worker_Extensions_DurableTask_SqlServer
122+
displayName: NuGet Release (Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer)
123+
dependsOn: nugetApproval
124+
condition: succeeded('nugetApproval') # nuget packages need to be on ADO first
125+
templateContext:
126+
type: releaseJob
127+
isProduction: true
128+
inputs:
129+
- input: pipelineArtifact
130+
pipeline: officialPipeline # Pipeline reference as defined in the resources section
131+
artifactName: drop
132+
targetPath: $(System.DefaultWorkingDirectory)/drop
133+
steps:
134+
- task: 1ES.PublishNuget@1
135+
displayName: 'NuGet push (Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer)'
136+
inputs:
137+
command: push
138+
nuGetFeedType: external
139+
publishFeedCredentials: 'DurableTask org NuGet API Key'
140+
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
141+
packageParentPath: $(System.DefaultWorkingDirectory) # This needs to be set to some prefix of the `packagesToPush` parameter. Apparently it helps with SDL tooling

0 commit comments

Comments
 (0)