diff --git a/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-49-50.md b/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-49-50.md new file mode 100644 index 00000000000..a25b49c1b0d --- /dev/null +++ b/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-49-50.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-java" +--- + +Update internal npm feed from azure-sdk-for-js-test-autorest to azure-sdk-for-js \ No newline at end of file diff --git a/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-50-1.md b/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-50-1.md new file mode 100644 index 00000000000..ab595f59673 --- /dev/null +++ b/.chronus/changes/jolov-publish-always-internal-2026-2-19-10-50-1.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-python" +--- + +Update internal npm feed from azure-sdk-for-js-test-autorest to azure-sdk-for-js \ No newline at end of file diff --git a/eng/emitters/pipelines/templates/stages/emitter-stages.yml b/eng/emitters/pipelines/templates/stages/emitter-stages.yml index 08805e737f0..9fc53174f91 100644 --- a/eng/emitters/pipelines/templates/stages/emitter-stages.yml +++ b/eng/emitters/pipelines/templates/stages/emitter-stages.yml @@ -7,7 +7,9 @@ parameters: - name: UseTypeSpecNext type: boolean - # Whether to publish to the internal feed. + # Whether and where to publish packages. Values: 'none', 'internal', 'public'. + # 'internal' publishes to the internal feed only. + # 'public' publishes to the internal feed AND to npmjs.org. - name: Publish type: string default: "none" @@ -281,27 +283,35 @@ stages: artifact: build_artifacts_${{ parameters.LanguageShortName }} displayName: Download build artifacts - # Create authenticated .npmrc file for publishing - - ${{ if eq(parameters.Publish, 'internal') }}: - - template: /eng/emitters/pipelines/templates/steps/create-authenticated-npmrc.yml - parameters: - npmrcPath: $(buildArtifactsPath)/packages/.npmrc - registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/ - - ${{ else }}: - - pwsh: | - "//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" | Out-File '.npmrc' - displayName: Authenticate .npmrc for npmjs.org - workingDirectory: $(buildArtifactsPath)/packages + # Always publish to internal feed + - template: /eng/emitters/pipelines/templates/steps/create-authenticated-npmrc.yml + parameters: + npmrcPath: $(buildArtifactsPath)/packages/.npmrc + registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ - # per package, publishing using appropriate tool - ${{ each package in parameters.Packages }}: - ${{ if eq(package.type, 'npm') }}: - pwsh: | $file = Resolve-Path "${{ package.file }}" Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages" npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages - displayName: Publish ${{ package.name }} + displayName: Publish ${{ package.name }} to internal feed workingDirectory: $(buildArtifactsPath)/packages + + # If publishing publicly, also publish to npmjs.org + - ${{ if eq(parameters.Publish, 'public') }}: + - pwsh: | + "//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" | Out-File '.npmrc' + displayName: Authenticate .npmrc for npmjs.org + workingDirectory: $(buildArtifactsPath)/packages + - ${{ each package in parameters.Packages }}: + - ${{ if eq(package.type, 'npm') }}: + - pwsh: | + $file = Resolve-Path "${{ package.file }}" + Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages" + npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages + displayName: Publish ${{ package.name }} to npmjs.org + workingDirectory: $(buildArtifactsPath)/packages - ${{ if parameters.HasNugetPackages }}: - task: 1ES.PublishNuget@1 displayName: Publish Nuget packages diff --git a/packages/http-client-csharp/eng/pipeline/publish.yml b/packages/http-client-csharp/eng/pipeline/publish.yml index 6a919676073..d22d0481e9d 100644 --- a/packages/http-client-csharp/eng/pipeline/publish.yml +++ b/packages/http-client-csharp/eng/pipeline/publish.yml @@ -123,7 +123,7 @@ extends: - task: NuGetAuthenticate@1 - pwsh: | - Write-Host "Creating .npmrc file $(Build.SourcesDirectory)/packages/http-client-csharp/.npmrc for registry https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/" + Write-Host "Creating .npmrc file $(Build.SourcesDirectory)/packages/http-client-csharp/.npmrc for registry https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" $parentFolder = Split-Path -Path '$(Build.SourcesDirectory)/packages/http-client-csharp/.npmrc' -Parent if (!(Test-Path $parentFolder)) { @@ -131,7 +131,7 @@ extends: New-Item -Path $parentFolder -ItemType Directory | Out-Null } - $content = "registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/`n`nalways-auth=true" + $content = "registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/`n`nalways-auth=true" $content | Out-File '$(Build.SourcesDirectory)/packages/http-client-csharp/.npmrc' Write-Host "##[section].npmrc file created successfully. Contents:" diff --git a/packages/http-client-csharp/eng/scripts/Build-Packages.ps1 b/packages/http-client-csharp/eng/scripts/Build-Packages.ps1 index 587a46bb1ce..e606da1c6f5 100644 --- a/packages/http-client-csharp/eng/scripts/Build-Packages.ps1 +++ b/packages/http-client-csharp/eng/scripts/Build-Packages.ps1 @@ -150,7 +150,7 @@ finally } if ($PublishType -eq "internal") { - $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry" + $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry" $overrides = @{ "@typespec/http-client-csharp" = "$feedUrl/@typespec/http-client-csharp/-/http-client-csharp-$emitterVersion.tgz" diff --git a/packages/http-client-java/eng/scripts/Build-Packages.ps1 b/packages/http-client-java/eng/scripts/Build-Packages.ps1 index d2063811459..1a2e3172bf2 100644 --- a/packages/http-client-java/eng/scripts/Build-Packages.ps1 +++ b/packages/http-client-java/eng/scripts/Build-Packages.ps1 @@ -93,7 +93,7 @@ finally { } if ($PublishType -eq "internal") { - $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry" + $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry" $overrides = @{ "@typespec/http-client-java" = "$feedUrl/@typespec/http-client-java/-/http-client-java-$emitterVersion.tgz" diff --git a/packages/http-client-python/eng/scripts/Build-Packages.ps1 b/packages/http-client-python/eng/scripts/Build-Packages.ps1 index 73b25b1f664..9200e8dac8f 100644 --- a/packages/http-client-python/eng/scripts/Build-Packages.ps1 +++ b/packages/http-client-python/eng/scripts/Build-Packages.ps1 @@ -77,7 +77,7 @@ finally { } if ($PublishType -eq "internal") { - $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry" + $feedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry" $overrides = @{ "@typespec/http-client-python" = "$feedUrl/@typespec/http-client-python/-/http-client-python-$emitterVersion.tgz"