@@ -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,11 +69,43 @@ extends:
6769 env :
6870 GH_TOKEN : $(azuresdk-github-pat)
6971
70- - script : |
71- npm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
72- ls *.tgz | npm publish -0 --access public
73- npm config delete //registry.npmjs.org/:_authToken
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+ # create npmrc file with auth
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
94+ - task : EsrpRelease@11
7495 displayName : ' Publish TypeSpec Java to NPM'
75- workingDirectory: ./typespec-extension
96+ inputs :
97+ ConnectedServiceName : Azure SDK PME Managed Identity
98+ ClientId : 5f81938c-2544-4f1f-9251-dd9de5b8a81b
99+ DomainTenantId : 975f013f-7f24-47e8-a7d3-abc4752bf346
100+ UseManagedIdentity : true
101+ KeyVaultName : kv-azuresdk-codesign
102+ SignCertName : azure-sdk-esrp-release-certificate
103+ Intent : PackageDistribution
104+ ContentType : npm
105+ FolderLocation : $(buildArtifactsPath)/packages
106+ Owners : ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
107+ Approvers : ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
108+ ServiceEndpointUrl : https://api.esrp.microsoft.com
109+ MainPublisher : ESRPRELPACMANTEST
76110
77111 - template : /eng/pipelines/steps/cleanup-maven-local-cache.yml
0 commit comments