Skip to content
Merged
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
46 changes: 44 additions & 2 deletions .ado/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ resources:
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
settings:
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2025
Expand All @@ -44,11 +46,51 @@ extends:
steps:
- checkout: self
clean: false


# The Azure Artifacts feed requires authentication, which GitHub
# Actions and external contributors do not have. Configure the
# registry at build time here only, so the committed sources keep
# working on the public npm registry.
- task: PowerShell@2
displayName: Point Yarn at the Azure Artifacts feed
inputs:
targetType: inline
workingDirectory: ./website
script: |
$feed = 'https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/'
$enc = [Text.UTF8Encoding]::new($false)

[IO.File]::WriteAllText(
(Join-Path (Get-Location) '.npmrc'),
"registry=$feed`nalways-auth=true`n",
$enc)

[IO.File]::WriteAllText(
(Join-Path (Get-Location) '.yarnrc'),
"registry `"$feed`"`n",
$enc)

# Yarn v1 fetches the exact `resolved` URLs recorded in
# yarn.lock regardless of registry config, so rewrite them
# or network isolation will block the restore.
$lock = Get-Content -Path yarn.lock -Raw
$lock = $lock.Replace('https://registry.yarnpkg.com/', $feed)
$lock = $lock.Replace('https://registry.npmjs.org/', $feed)
[IO.File]::WriteAllText((Join-Path (Get-Location) 'yarn.lock'), $lock, $enc)

if (Select-String -Path yarn.lock -Pattern 'registry\.yarnpkg\.com|registry\.npmjs\.org') {
throw 'yarn.lock still references a public npm registry.'
}

- task: npmAuthenticate@0
displayName: Authenticate to Azure Artifacts feed
inputs:
workingFile: ./website/.npmrc

- script: yarn install --frozen-lockfile
displayName: Yarn Install (Website)
workingDirectory: ./website

- script: yarn build
displayName: Yarn Build (Website)
workingDirectory: ./website
Loading