Skip to content

Commit d933c8f

Browse files
authored
[Pipeline][auto release] adopt tsp client (#35383)
* adopt tsp-client * fix * update for environment * update * remove npx in cmd * update auto release pipeline for tsp-client
1 parent 517acef commit d933c8f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

scripts/auto_release/PythonSdkLiveTest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
# install autorest
6363
sudo npm init -f
6464
sudo npm install -g autorest --save
65+
sudo npm install -g @azure-tools/typespec-client-generator-cli
6566
6667
mkdir temp_folder
6768

scripts/automation_init.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ export PATH
1515
python -m pip install -U pip
1616
python scripts/dev_setup.py -p azure-core
1717

18+
# install tsp-client globally (local install may interfere with tooling)
19+
echo Install tsp-client
20+
sudo npm install -g @azure-tools/typespec-client-generator-cli
21+
1822
echo "{}" >> $2
1923
echo "[Generate] init success!!!"

tools/azure-sdk-tools/packaging_tools/generate_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,9 @@ def gen_typespec(typespec_relative_path: str, spec_folder: str, head_sha: str, r
386386
autorest_python = "@autorest/python"
387387
# call scirpt to generate sdk
388388
try:
389-
check_output(f'pwsh {Path("eng/common/scripts/TypeSpec-Project-Process.ps1")} {(Path(spec_folder) / typespec_relative_path).resolve()} {head_sha} {rest_repo_url}', shell=True)
389+
tsp_dir = (Path(spec_folder) / typespec_relative_path).resolve()
390+
repo_url = rest_repo_url.replace('https://github.com/', "")
391+
check_output(f"tsp-client init --tsp-config {tsp_dir} --local-spec-repo {tsp_dir} --commit {head_sha} --repo {repo_url} --debug", shell=True)
390392
except CalledProcessError as e:
391393
_LOGGER.error(f"Failed to generate sdk from typespec: {e.output.decode('utf-8')}")
392394
raise e

0 commit comments

Comments
 (0)