Skip to content

Commit 1c0a58e

Browse files
iscai-msftiscai-msft
andauthored
[core] add pipeline to sync tsp spec in azure-core with latest tsp release (Azure#41482)
Co-authored-by: iscai-msft <[email protected]>
1 parent fb0ac00 commit 1c0a58e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

eng/pipelines/tsp-spec-sync.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
trigger: none
2+
3+
extends:
4+
template: /eng/pipelines/templates/stages/1es-redirect.yml
5+
parameters:
6+
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
7+
stages:
8+
- stage: TspSpecSync
9+
jobs:
10+
- job: TspSpecSync
11+
displayName: 'TSP Spec Sync Job'
12+
pool:
13+
name: 'azsdk-pool'
14+
image: 'ubuntu-24.04'
15+
os: 'linux'
16+
steps:
17+
- task: UsePythonVersion@0
18+
displayName: 'Set up Python'
19+
inputs:
20+
versionSpec: '3.10'
21+
addToPath: true
22+
23+
- script: |
24+
npm install -g @azure-tools/typespec-client-generator-cli@latest
25+
displayName: 'Install tsp-client'
26+
27+
- script: |
28+
git config --global user.name "ADO Pipeline"
29+
git config --global user.email "[email protected]"
30+
displayName: 'Configure Git'
31+
32+
- script: |
33+
tsp-client update --local-spec-repo ../../specs/scratch/
34+
displayName: 'Run TSP Client Update'
35+
workingDirectory: ./sdk/core/azure-core/tests/specs_sdk/scratch
36+
37+
- script: |
38+
changes=$(git status --porcelain)
39+
if [ -n "$changes" ]; then
40+
echo "##vso[task.setvariable variable=hasChanges]true"
41+
else
42+
echo "##vso[task.setvariable variable=hasChanges]false"
43+
fi
44+
displayName: 'Check for changes'
45+
46+
- template: /eng/common/pipelines/templates/steps/create-pull-request.yml
47+
parameters:
48+
PRBranchName: 'automated/tsp-update-$(date +%Y%m%d%H%M%S)'
49+
PRTitle: 'Auto-update TSP client generated code'
50+
PRBody: |
51+
This PR was automatically created in response to changes in `emitter-package.json`.
52+
53+
It updates the TSP client generated code. Tests should run automatically as part of the PR validation.
54+
55+
Generated from workflow triggered by PR #$(System.PullRequest.PullRequestNumber).
56+
CommitMsg: 'Auto-update TSP client generated code'
57+
condition: eq(variables['hasChanges'], 'true')

0 commit comments

Comments
 (0)