@@ -15,6 +15,8 @@ extends:
1515 variables :
1616 - template : /eng/pipelines/variables/globals.yml
1717 - template : /eng/pipelines/variables/image.yml
18+ - name : buildArtifactsPath
19+ value : $(Pipeline.Workspace)/build_artifacts
1820
1921 pool :
2022 name : $(LINUXPOOL)
@@ -67,6 +69,28 @@ extends:
6769 env :
6870 GH_TOKEN : $(azuresdk-github-pat)
6971
72+ - pwsh : |
73+ New-Item -ItemType Directory -Path "$(buildArtifactsPath)/packages" -Force
74+ Copy-Item -Path "./typespec-extension/*.tgz" -Destination "$(buildArtifactsPath)/packages"
75+ displayName: 'Copy packages to artifacts staging directory'
76+
77+ # Always publish to internal feed
78+ - template : /eng/pipelines/templates/steps/create-authenticated-npmrc.yml
79+ parameters :
80+ npmrcPath : $(buildArtifactsPath)/packages/.npmrc
81+ registryUrl : https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/
82+
83+ # publish to devops feed
84+ - pwsh : |
85+ $packageFiles = Get-ChildItem -Path . -Filter '*.tgz'
86+ foreach ($file in $packageFiles.Name) {
87+ Write-Host "npm publish $file --verbose --access public"
88+ npm publish $file --verbose --access public
89+ }
90+ displayName: Publish to DevOps feed
91+ workingDirectory: $(buildArtifactsPath)/packages
92+
93+ # publish to npmjs.org
7094 - task : EsrpRelease@11
7195 displayName : ' Publish TypeSpec Java to NPM'
7296 inputs :
@@ -78,7 +102,7 @@ extends:
78102 SignCertName : azure-sdk-esrp-release-certificate
79103 Intent : PackageDistribution
80104 ContentType : npm
81- FolderLocation : $(System.DefaultWorkingDirectory)/typespec-extension
105+ FolderLocation : $(buildArtifactsPath)/packages
82106 Owners : ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
83107 Approvers : ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
84108 ServiceEndpointUrl : https://api.esrp.microsoft.com
0 commit comments