From 351eea1f785716bf7b95ed8df712ec26d374e773 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 13:59:08 +0800 Subject: [PATCH] fix macos package name error --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 287f7db21..eda4b6de4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -35,16 +35,16 @@ jobs: python -c " from pathlib import Path import subprocess - import shutil replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0' for whl_file in Path('./dist').glob('*.whl'): parts = whl_file.name.split('_') be_replaced = '_'.join(parts[1:3]) new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.resolve().parent.parent.joinpath(whl_file.with_name(new_name)) - shutil.copy(whl_file.resolve(), new_whl_file) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " + make build - name: Build and publish env: TWINE_USERNAME: __token__