msbuild
112 строк · 4.1 Кб
1parameters:
2# Optional: dependencies of the job
3dependsOn: ''
4
5# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
6pool: ''
7
8CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
9GithubPat: $(BotAccount-dotnet-bot-repo-PAT)
10
11SourcesDirectory: $(Build.SourcesDirectory)
12CreatePr: true
13AutoCompletePr: false
14ReusePr: true
15UseLfLineEndings: true
16UseCheckedInLocProjectJson: false
17SkipLocProjectJsonGeneration: false
18LanguageSet: VS_Main_Languages
19LclSource: lclFilesInRepo
20LclPackageId: ''
21RepoType: gitHub
22GitHubOrg: dotnet
23MirrorRepo: ''
24MirrorBranch: main
25condition: ''
26JobNameSuffix: ''
27
28jobs:
29- job: OneLocBuild${{ parameters.JobNameSuffix }}
30
31dependsOn: ${{ parameters.dependsOn }}
32
33displayName: OneLocBuild${{ parameters.JobNameSuffix }}
34
35variables:
36- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat
37- name: _GenerateLocProjectArguments
38value: -SourcesDirectory ${{ parameters.SourcesDirectory }}
39-LanguageSet "${{ parameters.LanguageSet }}"
40-CreateNeutralXlfs
41- ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
42- name: _GenerateLocProjectArguments
43value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson
44- template: /eng/common/templates-official/variables/pool-providers.yml
45
46${{ if ne(parameters.pool, '') }}:
47pool: ${{ parameters.pool }}
48${{ if eq(parameters.pool, '') }}:
49pool:
50# We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
51${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
52name: AzurePipelines-EO
53image: 1ESPT-Windows2022
54demands: Cmd
55os: windows
56# If it's not devdiv, it's dnceng
57${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
58name: $(DncEngInternalBuildPool)
59image: 1es-windows-2022
60os: windows
61
62steps:
63- ${{ if ne(parameters.SkipLocProjectJsonGeneration, 'true') }}:
64- task: Powershell@2
65inputs:
66filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1
67arguments: $(_GenerateLocProjectArguments)
68displayName: Generate LocProject.json
69condition: ${{ parameters.condition }}
70
71- task: OneLocBuild@2
72displayName: OneLocBuild
73env:
74SYSTEM_ACCESSTOKEN: $(System.AccessToken)
75inputs:
76locProj: eng/Localize/LocProject.json
77outDir: $(Build.ArtifactStagingDirectory)
78lclSource: ${{ parameters.LclSource }}
79lclPackageId: ${{ parameters.LclPackageId }}
80isCreatePrSelected: ${{ parameters.CreatePr }}
81isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }}
82${{ if eq(parameters.CreatePr, true) }}:
83isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
84${{ if eq(parameters.RepoType, 'gitHub') }}:
85isShouldReusePrSelected: ${{ parameters.ReusePr }}
86packageSourceAuth: patAuth
87patVariable: ${{ parameters.CeapexPat }}
88${{ if eq(parameters.RepoType, 'gitHub') }}:
89repoType: ${{ parameters.RepoType }}
90gitHubPatVariable: "${{ parameters.GithubPat }}"
91${{ if ne(parameters.MirrorRepo, '') }}:
92isMirrorRepoSelected: true
93gitHubOrganization: ${{ parameters.GitHubOrg }}
94mirrorRepo: ${{ parameters.MirrorRepo }}
95mirrorBranch: ${{ parameters.MirrorBranch }}
96condition: ${{ parameters.condition }}
97
98- task: 1ES.PublishBuildArtifacts@1
99displayName: Publish Localization Files
100inputs:
101PathtoPublish: '$(Build.ArtifactStagingDirectory)/loc'
102PublishLocation: Container
103ArtifactName: Loc
104condition: ${{ parameters.condition }}
105
106- task: 1ES.PublishBuildArtifacts@1
107displayName: Publish LocProject.json
108inputs:
109PathtoPublish: '$(Build.SourcesDirectory)/eng/Localize/'
110PublishLocation: Container
111ArtifactName: Loc
112condition: ${{ parameters.condition }}