Skip to content

Commit

Permalink
Refactor build.yaml workflow: Add step to rename wheel file
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Oct 19, 2024
1 parent 414b1b7 commit 8441c5e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ jobs:
run: |
python -c "import simpler_whisper; print(simpler_whisper.__file__)"
- name: Rename wheel file
shell: python
run: |
import os
import glob
wheel_file = glob.glob('dist/*.whl')[0]
base_name = os.path.basename(wheel_file)
name_parts = base_name.split('-')
# Insert acceleration and platform before the last part (which is like 'any.whl')
new_name_parts = name_parts[:-1] + ['${{ matrix.acceleration }}', '${{ matrix.platform }}'] + [name_parts[-1]]
new_name = '-'.join(new_name_parts)
new_path = os.path.join('dist', new_name)
os.rename(wheel_file, new_path)
print(f"Renamed {base_name} to {new_name}")
- name: Set wheel name
shell: pwsh
run: |
Expand Down

0 comments on commit 8441c5e

Please sign in to comment.