onelocbuild.yml 3.8 KB
Newer Older
1 2 3 4 5
parameters:
  # Optional: dependencies of the job
  dependsOn: ''

  # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
6 7
  pool: ''
    
8 9 10 11 12
  CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
  GithubPat: $(BotAccount-dotnet-bot-repo-PAT)

  SourcesDirectory: $(Build.SourcesDirectory)
  CreatePr: true
13
  AutoCompletePr: false
14
  ReusePr: true
15
  UseLfLineEndings: true
16 17 18 19 20
  UseCheckedInLocProjectJson: false
  LanguageSet: VS_Main_Languages
  LclSource: lclFilesInRepo
  LclPackageId: ''
  RepoType: gitHub
21 22 23
  GitHubOrg: dotnet
  MirrorRepo: ''
  MirrorBranch: main
24
  condition: ''
25 26

jobs:
27
- job: OneLocBuild
28 29 30
  
  dependsOn: ${{ parameters.dependsOn }}

31
  displayName: OneLocBuild
32

33 34 35 36 37 38 39 40 41 42
  ${{ if ne(parameters.pool, '') }}:
    pool: ${{ parameters.pool }}
  ${{ if eq(parameters.pool, '') }}:
    pool:
      # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
      ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
        name: VSEngSS-MicroBuild2022-1ES
        demands: Cmd
      # If it's not devdiv, it's dnceng
      ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
43
        name: NetCore1ESPool-Svc-Internal
44
        demands: ImageOverride -equals windows.vs2019.amd64
45

46 47 48 49 50 51 52 53 54 55 56
  variables:
    - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat
    - name: _GenerateLocProjectArguments
      value: -SourcesDirectory ${{ parameters.SourcesDirectory }}
        -LanguageSet "${{ parameters.LanguageSet }}"
        -CreateNeutralXlfs
    - ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
      - name: _GenerateLocProjectArguments
        value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson
      

57
  steps:
58 59 60 61 62 63
    - task: Powershell@2
      inputs:
        filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1
        arguments: $(_GenerateLocProjectArguments)
      displayName: Generate LocProject.json
      condition: ${{ parameters.condition }}
64 65 66

    - task: OneLocBuild@2
      displayName: OneLocBuild
67 68
      env:
        SYSTEM_ACCESSTOKEN: $(System.AccessToken)
69
      inputs:
70
        locProj: eng/Localize/LocProject.json
71 72 73 74
        outDir: $(Build.ArtifactStagingDirectory)
        lclSource: ${{ parameters.LclSource }}
        lclPackageId: ${{ parameters.LclPackageId }}
        isCreatePrSelected: ${{ parameters.CreatePr }}
75
        isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }}
76
        ${{ if eq(parameters.CreatePr, true) }}:
77
          isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
78 79
          ${{ if eq(parameters.RepoType, 'gitHub') }}:
            isShouldReusePrSelected: ${{ parameters.ReusePr }}
80 81
        packageSourceAuth: patAuth
        patVariable: ${{ parameters.CeapexPat }}
82 83 84
        ${{ if eq(parameters.RepoType, 'gitHub') }}:
          repoType: ${{ parameters.RepoType }}
          gitHubPatVariable: "${{ parameters.GithubPat }}"
85 86 87 88 89
        ${{ if ne(parameters.MirrorRepo, '') }}:
          isMirrorRepoSelected: true
          gitHubOrganization: ${{ parameters.GitHubOrg }}
          mirrorRepo: ${{ parameters.MirrorRepo }}
          mirrorBranch: ${{ parameters.MirrorBranch }}
90
      condition: ${{ parameters.condition }}
91 92 93 94 95 96 97

    - task: PublishBuildArtifacts@1
      displayName: Publish Localization Files
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)/loc'
        PublishLocation: Container
        ArtifactName: Loc
98
      condition: ${{ parameters.condition }}
99 100 101 102

    - task: PublishBuildArtifacts@1
      displayName: Publish LocProject.json
      inputs:
103
        PathtoPublish: '$(Build.SourcesDirectory)/eng/Localize/'
104 105
        PublishLocation: Container
        ArtifactName: Loc
106
      condition: ${{ parameters.condition }}