Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
38 changes: 24 additions & 14 deletions eng/emitters/pipelines/templates/stages/emitter-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/http-client-csharp/eng/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ 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)) {
Write-Host "Creating folder $parentFolder"
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:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/http-client-java/eng/scripts/Build-Packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading