Skip to content

Commit

Permalink
[Pipeline][auto release] adopt tsp client (#35383)
Browse files Browse the repository at this point in the history
* adopt tsp-client

* fix

* update for environment

* update

* remove npx in cmd

* update auto release pipeline for tsp-client
  • Loading branch information
msyyc authored Apr 28, 2024
1 parent 517acef commit d933c8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/auto_release/PythonSdkLiveTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
# install autorest
sudo npm init -f
sudo npm install -g autorest --save
sudo npm install -g @azure-tools/typespec-client-generator-cli
mkdir temp_folder
Expand Down
4 changes: 4 additions & 0 deletions scripts/automation_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ export PATH
python -m pip install -U pip
python scripts/dev_setup.py -p azure-core

# install tsp-client globally (local install may interfere with tooling)
echo Install tsp-client
sudo npm install -g @azure-tools/typespec-client-generator-cli

echo "{}" >> $2
echo "[Generate] init success!!!"
4 changes: 3 additions & 1 deletion tools/azure-sdk-tools/packaging_tools/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ def gen_typespec(typespec_relative_path: str, spec_folder: str, head_sha: str, r
autorest_python = "@autorest/python"
# call scirpt to generate sdk
try:
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)
tsp_dir = (Path(spec_folder) / typespec_relative_path).resolve()
repo_url = rest_repo_url.replace('https://github.com/', "")
check_output(f"tsp-client init --tsp-config {tsp_dir} --local-spec-repo {tsp_dir} --commit {head_sha} --repo {repo_url} --debug", shell=True)
except CalledProcessError as e:
_LOGGER.error(f"Failed to generate sdk from typespec: {e.output.decode('utf-8')}")
raise e
Expand Down

0 comments on commit d933c8f

Please sign in to comment.