Skip to content

Commit

Permalink
Re-able the Localization steps and add new credentials (#24629)
Browse files Browse the repository at this point in the history
  • Loading branch information
tj-devel709 authored Sep 9, 2024
1 parent cf00253 commit 68f6e4b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
21 changes: 14 additions & 7 deletions eng/pipelines/common/localization-handback.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
parameters:
CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
GithubPat: $(BotAccount-dotnet-bot-repo-PAT)

stages:
- stage: localization_handback
Expand All @@ -9,19 +12,23 @@ stages:
- job : generate_resx
displayName: 'Process incoming translations'
pool: $(HostedWinVS2019)

variables:
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat

steps:
- checkout: self
persistCredentials: true
clean: true

- powershell: |
$srcBranch = $(Build.SourceBranch)
$srcBranch = "$(Build.SourceBranch)"
Write-Host "Extracting branch name from $srcBranch..."
if ("$srcBranch" -eq "refs/heads/loc") {
if ($srcBranch -eq "refs/heads/loc") {
$baseBranchName = "main"
$locBranchName = "loc"
} elseif ("$srcBranch".StartsWith("refs/heads/loc-")) {
$baseBranchName = "$srcBranch".SubString("refs/heads/loc-".Length)
} elseif ($srcBranch.StartsWith("refs/heads/loc-")) {
$baseBranchName = $srcBranch.SubString("refs/heads/loc-".Length)
$locBranchName = "loc-$baseBranchName"
} else {
throw "Invalid branch name $srcBranch."
Expand All @@ -41,19 +48,19 @@ stages:
Invoke-Git merge origin/$(LOC_BRANCH_NAME) --no-commit
displayName: 'Merge loc Branch'
- task: cesve.one-loc-build.one-loc-build.OneLocBuild@2
- task: OneLocBuild@2
displayName: 'Localization Build'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: 'eng/automation/LocProject.json'
outDir: '$(Build.ArtifactStagingDirectory)'
packageSourceAuth: patAuth
patVariable: "$(OneLocBuildPAT)"
patVariable: ${{ parameters.CeapexPat }}
isCreatePrSelected: false
repoType: gitHub
prSourceBranchPrefix: $(LocBranchPrefix)
gitHubPatVariable: '$(GitHub.Token)'
gitHubPatVariable: "${{ parameters.GithubPat }}"
gitHubPrMergeMethod: merge

- powershell: |
Expand Down
13 changes: 10 additions & 3 deletions eng/pipelines/common/localization-handoff.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
parameters:
CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
GithubPat: $(BotAccount-dotnet-bot-repo-PAT)

stages:
- stage: localization_handoff
displayName: Localization Handoff
Expand All @@ -8,17 +12,20 @@ stages:
- job : generate_lci
displayName: 'Process outgoing strings'
pool: $(HostedWinVS2019)
steps:

- task: cesve.one-loc-build.one-loc-build.OneLocBuild@2
variables:
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat

steps:
- task: OneLocBuild@2
displayName: 'Localization Build'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: 'eng/automation/LocProject.json'
outDir: '$(Build.ArtifactStagingDirectory)'
packageSourceAuth: patAuth
patVariable: "$(OneLocBuildPAT)"
patVariable: ${{ parameters.CeapexPat }}

- task: PublishBuildArtifacts@1
inputs:
Expand Down
8 changes: 4 additions & 4 deletions eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ stages:
RunPlatforms: ${{ parameters.RunTemplatePlatforms }}
BuildPlatforms: ${{ parameters.BuilTemplatePlatforms }}

# - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
# - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff]
# - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback]
# - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff]
- template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback]
- template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]

0 comments on commit 68f6e4b

Please sign in to comment.