From 92d1d4fa8e0393c29d3893203759c30b04d5fcc6 Mon Sep 17 00:00:00 2001 From: jolov Date: Wed, 18 Mar 2026 20:17:11 -0700 Subject: [PATCH 1/4] ci: always publish to internal feed in emitter publish stage Update the emitter publish pipeline to always publish npm packages to the internal Azure Artifacts feed, even when also publishing to public npm. Previously the publish step used either/or logic that only published to one registry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../templates/stages/emitter-stages.yml | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/eng/emitters/pipelines/templates/stages/emitter-stages.yml b/eng/emitters/pipelines/templates/stages/emitter-stages.yml index 08805e737f0..dc15cf8beb1 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-test-autorest/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 From d9a7c3c4eebb2f9cb1acb283fd4fed3bfe29d74e Mon Sep 17 00:00:00 2001 From: jolov Date: Thu, 19 Mar 2026 08:45:44 -0700 Subject: [PATCH 2/4] ci: switch internal feed from azure-sdk-for-js-test-autorest to azure-sdk-for-js Address PR feedback to use the azure-sdk-for-js feed instead of the retiring azure-sdk-for-js-test-autorest feed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/emitters/pipelines/templates/stages/emitter-stages.yml | 2 +- packages/http-client-csharp/eng/pipeline/publish.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/emitters/pipelines/templates/stages/emitter-stages.yml b/eng/emitters/pipelines/templates/stages/emitter-stages.yml index dc15cf8beb1..9fc53174f91 100644 --- a/eng/emitters/pipelines/templates/stages/emitter-stages.yml +++ b/eng/emitters/pipelines/templates/stages/emitter-stages.yml @@ -287,7 +287,7 @@ stages: - 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/ + registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ - ${{ each package in parameters.Packages }}: - ${{ if eq(package.type, 'npm') }}: diff --git a/packages/http-client-csharp/eng/pipeline/publish.yml b/packages/http-client-csharp/eng/pipeline/publish.yml index 37e8b562677..f8fd7dc3749 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:" From 5b886cbba956f43c62d492ba98b68c8af12b6d8d Mon Sep 17 00:00:00 2001 From: jolov Date: Thu, 19 Mar 2026 09:25:37 -0700 Subject: [PATCH 3/4] Update remaining old feed references in Build-Packages.ps1 scripts Switch http-client-csharp, http-client-python, and http-client-java Build-Packages.ps1 scripts from azure-sdk-for-js-test-autorest to azure-sdk-for-js feed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/http-client-csharp/eng/scripts/Build-Packages.ps1 | 2 +- packages/http-client-java/eng/scripts/Build-Packages.ps1 | 2 +- packages/http-client-python/eng/scripts/Build-Packages.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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" From 81352e74c718cce420d72337b1420bcb3fc3710b Mon Sep 17 00:00:00 2001 From: jolov Date: Thu, 19 Mar 2026 10:50:10 -0700 Subject: [PATCH 4/4] Add chronus changesets for Java and Python emitters Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../jolov-publish-always-internal-2026-2-19-10-49-50.md | 7 +++++++ .../jolov-publish-always-internal-2026-2-19-10-50-1.md | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 .chronus/changes/jolov-publish-always-internal-2026-2-19-10-49-50.md create mode 100644 .chronus/changes/jolov-publish-always-internal-2026-2-19-10-50-1.md 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