Skip to content

Commit 081ff91

Browse files
build: enable pushing emitter nuget packages (#40646)
Co-authored-by: Jorge Rangel <[email protected]>
1 parent 892002e commit 081ff91

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

eng/common/pipelines/templates/archetype-typespec-emitter.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ parameters:
3737
type: boolean
3838
default: true
3939

40+
# Whether the built packages contain nuget packages. If true, the publish stage will publish the nuget packages to the internal nuget feed.
41+
- name: HasNugetPackages
42+
type: boolean
43+
default: false
44+
4045
# Indicates if the Publish stage should depend on the Test stage
4146
- name: PublishDependsOnTest
4247
type: boolean
@@ -57,7 +62,7 @@ parameters:
5762
type: number
5863
default: 10
5964

60-
# Indicates if regenration matrix should only contain folders with typespec files
65+
# Indicates if regeneration matrix should only contain folders with typespec files
6166
- name: OnlyGenerateTypespec
6267
type: boolean
6368
default: false
@@ -126,6 +131,7 @@ extends:
126131
-OutputDirectory "$(Build.ArtifactStagingDirectory)/packages"
127132
-TargetNpmJsFeed:$${{ parameters.PublishPublic }}
128133
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
134+
-GeneratorVersion: $(initialize.emitterVersion)
129135
130136
- pwsh: |
131137
$sourceBranch = '$(Build.SourceBranch)'
@@ -186,6 +192,16 @@ extends:
186192
displayName: Publish to DevOps feed
187193
workingDirectory: $(buildArtifactsPath)/packages
188194
195+
# Publish to https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net
196+
- ${{ if parameters.HasNugetPackages }}:
197+
- task: 1ES.PublishNuget@1
198+
displayName: Publish NuGet Packages to DevOps feed
199+
inputs:
200+
packagesToPush: $(buildArtifactsPath)/packages/*.nupkg;!$(buildArtifactsPath)/packages/*.symbols.nupkg
201+
packageParentPath: $(buildArtifactsPath)/packages
202+
publishVstsFeed: "29ec6040-b234-4e31-b139-33dc4287b756/fa8c16a3-dbe0-4de2-a297-03065ec1ba3f"
203+
nuGetFeedType: internal
204+
189205
- ${{ if parameters.PublishPublic }}:
190206
# publish to npmjs.org using ESRP
191207
- task: EsrpRelease@9
@@ -244,7 +260,7 @@ extends:
244260
--overrides '$(buildArtifactsPath)/packages/overrides.json'
245261
} else {
246262
Write-Host "No overrides.json found. Running tsp-client without overrides."
247-
263+
248264
tsp-client generate-config-files `
249265
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
250266
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}'

0 commit comments

Comments
 (0)