Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-able the Localization steps and add new credentials #24629

Merged
merged 1 commit into from
Sep 9, 2024
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
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]
Loading