Skip to content

Commit

Permalink
change script
Browse files Browse the repository at this point in the history
  • Loading branch information
SAKURA-CAT committed Aug 18, 2024
1 parent f465fe7 commit 097b424
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

run: |
python -m build_pypi.py
python -m script/build_pypi.py
# python -m twine upload dist/*

- run: cp dist/*.whl .
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"name": "构建项目",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/build_pypi.py",
"program": "${workspaceFolder}/script/build_pypi.py",
"console": "integratedTerminal",
"justMyCode": true,
"cwd": "${workspaceFolder}"
Expand Down
6 changes: 3 additions & 3 deletions build_pypi.py → script/build_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import os

# 如果dist文件夹存在则删除
if os.path.exists("dist"):
shutil.rmtree("dist")
if os.path.exists("../dist"):
shutil.rmtree("../dist")

# 设置版本号
version = os.getenv("VERSION")
if not version:
raise ValueError("尚未指定构建版本号")
with open("swanlab/package.json", 'r+') as f:
with open("../swanlab/package.json", 'r+') as f:
p = json.load(f)
p["version"] = version
json.dump(p, f, indent=4)
Expand Down

0 comments on commit 097b424

Please sign in to comment.