Sync eng/common directory with azure-sdk-tools for PR 10241 (#6518)

* Use tsp-client in emitter CI

* include arg

* Check path

* remove lock scirpt

---------

Co-authored-by: jolov <jolov@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-04-08 16:10:59 -07:00 committed by GitHub
parent 86245d07e6
commit ce596aa50b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,6 +67,10 @@ parameters:
type: object
default: []
- name: EmitterPackageJsonPath
type: string
default: ""
extends:
template: /eng/pipelines/templates/stages/1es-redirect.yml
parameters:
@ -189,26 +193,25 @@ extends:
ServiceEndpointUrl: https://api.esrp.microsoft.com
MainPublisher: ESRPRELPACMANTEST
- task: PowerShell@2
displayName: Create emitter-package.json
inputs:
pwsh: true
filePath: ./eng/common/scripts/typespec/New-EmitterPackageJson.ps1
arguments: >
-PackageJsonPath '$(buildArtifactsPath)/lock-files/package.json'
-OverridesPath '$(buildArtifactsPath)/overrides.json'
-OutputDirectory '$(Build.ArtifactStagingDirectory)'
workingDirectory: $(Build.SourcesDirectory)
- pwsh: |
npm install -g @azure-tools/typespec-client-generator-cli@latest
displayName: Install tsp-client
- task: PowerShell@2
displayName: Create emitter-package-lock.json
inputs:
pwsh: true
filePath: ./eng/common/scripts/typespec/New-EmitterPackageLock.ps1
arguments: >
-EmitterPackageJsonPath '$(Build.ArtifactStagingDirectory)/emitter-package.json'
-OutputDirectory '$(Build.ArtifactStagingDirectory)'
workingDirectory: $(Build.SourcesDirectory)
- pwsh: |
if (Test-Path -Path '$(buildArtifactsPath)/overrides.json') {
Write-Host "Using overrides.json to generate emitter-package.json"
tsp-client generate-config-files
--package-json '$(buildArtifactsPath)/lock-files/package.json'
--output-dir '$(Build.ArtifactStagingDirectory)'
--emitter-package-json-path '${{ parameters.EmitterPackageJsonPath }}'
--overrides '$(buildArtifactsPath)/overrides.json'
} else {
tsp-client generate-config-files
--package-json '$(buildArtifactsPath)/lock-files/package.json'
--output-dir '$(Build.ArtifactStagingDirectory)'
--emitter-package-json-path '${{ parameters.EmitterPackageJsonPath }}'
}
displayName: Generate emitter-package.json and emitter-package-lock files
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters: