1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-30 17:41:18 +08:00

rewrite deploy with macos

This commit is contained in:
Linlang
2024-12-19 23:17:54 +08:00
parent 5222de4934
commit 7e6bdc9493
3 changed files with 75 additions and 42 deletions

View File

@@ -128,45 +128,45 @@ jobs:
# make build
- name: Build 1
run: |
make build
- name: Rename 1
run: |
python -c "
from pathlib import Path
plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1]
sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1]
replaced = f'{sys_ver_info}_0_{plat_info}'
print(replaced)
for whl_file in Path('./dist').glob('*.whl'):
parts = whl_file.stem.split('_')
print(parts)
be_replaced = '_'.join(parts[1:])
print(be_replaced)
new_name = whl_file.name.replace(be_replaced, replaced)
print(new_name)
new_whl_file = whl_file.with_name(new_name)
print(new_whl_file)
whl_file.rename(new_whl_file)
print(f'Renamed: {whl_file} -> {new_whl_file}')
"
- name: Build 2
if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }}
run: |
make build
- name: Rename 2
if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }}
run: |
python -c "
from pathlib import Path
plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1]
for whl_file in Path('./dist').glob('*.whl'):
parts = whl_file.stem.split('_', 3)
be_replaced = parts[-1]
new_name = whl_file.name.replace(be_replaced, plat_info)
new_whl_file = whl_file.with_name(new_name)
whl_file.rename(new_whl_file)
print(f'Renamed: {whl_file} -> {new_whl_file}')
"
python setup.py bdist_wheel
# - name: Rename 1
# run: |
# python -c "
# from pathlib import Path
# plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1]
# sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1]
# replaced = f'{sys_ver_info}_0_{plat_info}'
# print(replaced)
# for whl_file in Path('./dist').glob('*.whl'):
# parts = whl_file.stem.split('_')
# print(parts)
# be_replaced = '_'.join(parts[1:])
# print(be_replaced)
# new_name = whl_file.name.replace(be_replaced, replaced)
# print(new_name)
# new_whl_file = whl_file.with_name(new_name)
# print(new_whl_file)
# whl_file.rename(new_whl_file)
# print(f'Renamed: {whl_file} -> {new_whl_file}')
# "
# - name: Build 2
# if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }}
# run: |
# make build
# - name: Rename 2
# if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }}
# run: |
# python -c "
# from pathlib import Path
# plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1]
# for whl_file in Path('./dist').glob('*.whl'):
# parts = whl_file.stem.split('_', 3)
# be_replaced = parts[-1]
# new_name = whl_file.name.replace(be_replaced, plat_info)
# new_whl_file = whl_file.with_name(new_name)
# whl_file.rename(new_whl_file)
# print(f'Renamed: {whl_file} -> {new_whl_file}')
# "
# - name: Build 3
# run: |
# make build