Skip to content

Commit 53b505d

Browse files
committed
Push NPM package to Public CI as well
And stop pushing NuGet package on PRs
1 parent abdc80b commit 53b505d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

azure-pipelines.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,25 @@ stages:
146146
command: push
147147
packagesToPush: $(Build.ArtifactStagingDirectory)/deployables/*.*nupkg
148148
nuGetFeedType: internal
149-
publishVstsFeed: 6ed146e5-8e9c-46d6-a40f-da9367ed50cd/c20edbb7-8403-4456-8f43-f46b47e360b1
149+
publishVstsFeed: OSS/PublicCI
150150
allowPackageConflicts: true
151-
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'true'))
151+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
152+
153+
- pwsh: Set-Content -Path "$(Agent.TempDirectory)/.npmrc" -Value "registry=https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/npm/registry/`nalways-auth=true"
154+
displayName: Prepare to push to PublicCI
155+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
156+
- task: npmAuthenticate@0
157+
displayName: Authenticate to PublicCI
158+
inputs:
159+
workingFile: $(Agent.TempDirectory)/.npmrc
160+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
161+
- pwsh: |
162+
$tgz = (Get-ChildItem "$(Build.ArtifactStagingDirectory)/deployables/*.tgz")[0].FullName
163+
Write-Host "Will publish $tgz"
164+
npm publish $tgz
165+
workingDirectory: $(Agent.TempDirectory)
166+
displayName: npm publish to PublicCI feed
167+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
152168
153169
- stage: Test
154170
jobs:

0 commit comments

Comments
 (0)