Skip to content

Commit

Permalink
Merge pull request #6975 from Cosifne/dev/shech/1ESLOCpipeline
Browse files Browse the repository at this point in the history
Move LOC pipeline to 1ES
  • Loading branch information
Cosifne committed Mar 18, 2024
2 parents c771e6b + 0edd01d commit 8651f54
Showing 1 changed file with 68 additions and 59 deletions.
127 changes: 68 additions & 59 deletions azure-pipelines/loc.yml
Expand Up @@ -20,67 +20,76 @@ parameters:
type: boolean
default: true

resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

variables:
# Variable group contains the PAT to LOC
- group: OneLocBuildVariables

stages:
- stage: LocalizationStage
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: Localization
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2022preview.amd64
steps:
- task: NodeTool@0
displayName: 'Install Node.js 18.x'
inputs:
# Octokit client needs 18.x to have 'fetch' function.
versionSpec: '18.x'
- checkout: self
clean: true
submodules: true
fetchTags: false
fetchDepth: 0
- pwsh: |
npm install
npm install -g gulp
displayName: 'Install tools'
- pwsh: npm run compile
displayName: 'Compile'
- pwsh: npm run l10nDevGenerateLocalizationBundle
displayName: 'Generate bundle.l10.json'
- pwsh: npm run l10nDevGenerateXlf
displayName: 'Generate xlf files from bundle.10n.json'
- task: OneLocBuild@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: loc/LocProject.json
outDir: '$(Build.SourcesDirectory)/loc'
isCreatePrSelected: false
patVariable: $(dn-bot-ceapex-package-r)
packageSourceAuth: patAuth
lclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-VSCODECS'
- pwsh: npm run l10nDevImportXlf
displayName: 'Import xlf to json.'
- pwsh: gulp 'publish localization content' --userName dotnet-bot --email dotnet-bot@dotnetfoundation.org --commitSha $(Build.SourceVersion) --targetRemoteRepo vscode-csharp --baseBranch 'main'
displayName: 'Create PR in GitHub.'
env:
GitHubPAT: $(BotAccount-dotnet-bot-repo-PAT)
- task: PublishBuildArtifacts@1
displayName: 'Publish Localization Files'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/loc'
PublishLocation: Container
ArtifactName: Loc
condition: ${{ parameters.publishLocalizationFile }}
- task: PublishBuildArtifacts@1
displayName: 'Publish l10n file'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/l10n'
PublishLocation: Container
ArtifactName: l10n
condition: ${{ parameters.publishLocalizationFile }}
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022-pt
os: windows
stages:
- stage: LocalizationStage
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: Localization
templateContext:
outputs:
- output: pipelineArtifact
displayName: LOC
targetPath: '$(Build.SourcesDirectory)/loc'
condition: ${{ parameters.publishLocalizationFile }}
artifactName: loc
- output: pipelineArtifact
displayName: l10n
targetPath: '$(Build.SourcesDirectory)/l10n'
condition: ${{ parameters.publishLocalizationFile }}
artifactName: l10n
steps:
- task: NodeTool@0
displayName: 'Install Node.js 18.x'
inputs:
# Octokit client needs 18.x to have 'fetch' function.
versionSpec: '18.x'
- checkout: self
clean: true
submodules: true
fetchTags: false
fetchDepth: 0
- pwsh: |
npm install
npm install -g gulp
displayName: 'Install tools'
- pwsh: npm run compile
displayName: 'Compile'
- pwsh: npm run l10nDevGenerateLocalizationBundle
displayName: 'Generate bundle.l10.json'
- pwsh: npm run l10nDevGenerateXlf
displayName: 'Generate xlf files from bundle.10n.json'
- task: OneLocBuild@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: loc/LocProject.json
outDir: '$(Build.SourcesDirectory)/loc'
isCreatePrSelected: false
patVariable: $(dn-bot-ceapex-package-r)
packageSourceAuth: patAuth
lclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-VSCODECS'
- pwsh: npm run l10nDevImportXlf
displayName: 'Import xlf to json.'
- pwsh: gulp 'publish localization content' --userName dotnet-bot --email dotnet-bot@dotnetfoundation.org --commitSha $(Build.SourceVersion) --targetRemoteRepo vscode-csharp --baseBranch 'main'
displayName: 'Create PR in GitHub.'
env:
GitHubPAT: $(BotAccount-dotnet-bot-repo-PAT)

0 comments on commit 8651f54

Please sign in to comment.