11trigger : none
22pr : none
33
4- # OneLocBuild materializes packaged LCL handbacks under the artifact directory.
5- # Its manifests map those files to their native repository paths. After applying
6- # them, the diagnostics generator produces deterministic runtime gzip files.
7- # The resulting changes update a stable GitHub branch and pull request.
4+ # Before OneLoc assigns an LCL package ID, this pipeline publishes the initial
5+ # localization handoff. After the package ID is configured, it applies packaged
6+ # handbacks, generates deterministic runtime gzip files, and updates a pull request.
87schedules :
98 - cron : ' 0 7 * * *'
109 displayName : Daily localization update
@@ -14,6 +13,9 @@ schedules:
1413 - main
1514
1615variables :
16+ # Fill this in after the localization team assigns the LCL package ID.
17+ - name : OneLocLclPackageId
18+ value : ' '
1719 - name : TYPESCRIPT_AUTOMATION_GITHUB_APP_CLIENT_ID
1820 value : Iv23li4GolzJSEp1mzHI
1921 - name : TYPESCRIPT_AUTOMATION_GITHUB_APP_KEY_ID
5254 - task : AzureCLI@2
5355 displayName : Create OneLocBuild token
5456 inputs :
55- azureSubscription : devdiv -onelocbuild-ceapex
57+ azureSubscription : dnceng -onelocbuild-ceapex
5658 scriptType : pscore
5759 scriptLocation : inlineScript
5860 inlineScript : |
6163 $token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
6264 Write-Host "##vso[task.setvariable variable=OneLocBuildToken;issecret=true]$token"
6365
66+ - task : OneLocBuild@3
67+ displayName : Generate localization handoff
68+ condition : and(succeeded(), eq(variables['OneLocLclPackageId'], ''))
69+ inputs :
70+ locProj : tools/LocProject.json
71+ outDir : $(Build.ArtifactStagingDirectory)
72+ LclSource : lclFilesInRepo
73+ packageSourceAuth : patAuth
74+ patVariable : $(OneLocBuildToken)
75+ isCreatePrSelected : false
76+
6477 - task : OneLocBuild@3
6578 displayName : Generate localized files
79+ condition : and(succeeded(), ne(variables['OneLocLclPackageId'], ''))
6680 env :
6781 SYSTEM_ACCESSTOKEN : $(System.AccessToken)
6882 inputs :
@@ -115,12 +129,14 @@ jobs:
115129 Copy-Item -LiteralPath $source -Destination $destination -Force
116130 }
117131 displayName: Apply localized files
132+ condition: and(succeeded(), ne(variables['OneLocLclPackageId'], ''))
118133
119134 - pwsh : |
120135 $ErrorActionPreference = "Stop"
121136 $PSNativeCommandUseErrorActionPreference = $true
122137 npx hereby generate:diagnostics
123138 displayName: Generate localization artifacts
139+ condition: and(succeeded(), ne(variables['OneLocLclPackageId'], ''))
124140
125141 - task : CopyFiles@2
126142 displayName : Add localization project to handoff
@@ -140,6 +156,8 @@ jobs:
140156 azureSubscription : TypeScript-DevDiv-KeyVault
141157 repositories : TypeScript
142158 permissions : contents:write,pull_requests:write
159+ condition : and(succeeded(), ne(variables['OneLocLclPackageId'], ''))
160+ revokeCondition : and(always(), ne(variables['OneLocLclPackageId'], ''))
143161 insertSteps :
144162 - pwsh : |
145163 $ErrorActionPreference = "Stop"
@@ -194,5 +212,6 @@ jobs:
194212 gh pr create --repo microsoft/TypeScript --base main --head $branch --title "Update localization files" --body "Updates localization handbacks and their generated runtime artifacts."
195213 }
196214 displayName: Create or update localization pull request
215+ condition: and(succeeded(), ne(variables['OneLocLclPackageId'], ''))
197216 env:
198217 GH_TOKEN: $(GH_TOKEN)
0 commit comments