Skip to content

Commit

Permalink
👷 fix build wheel with correct platform naming and publish only wheel…
Browse files Browse the repository at this point in the history
…, not the .tar.gz

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Aug 21, 2024
1 parent c988001 commit 48f4338
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,19 @@ jobs:
shell: sh
run: |
poetry install --no-dev
python -m build --wheel --plat-name=${{ matrix.plat-name }}
poetry build
### Platform-specific wheel renaming:
wheel_file=$(find dist/ -type f -name '*.whl')
echo "Original wheel file: ${wheel_file}"
platform_name="${{ matrix.plat-name }}"
echo "Using platform name: ${platform_name}"
new_wheel_file=$(echo ${wheel_file} | sed "s/\(-any\)\?\.whl$/-${platform_name}.whl/")
echo "Renaming wheel file to: ${new_wheel_file}"
mv "${wheel_file}" "${new_wheel_file}"
working-directory: wrappers/python

- name: Run tests
Expand All @@ -297,18 +309,19 @@ jobs:
- if: ${{ runner.os == 'Linux' }}
name: Audit wheel
run: |
auditwheel show wrappers/python/dist/* | tee auditwheel.log
pip install auditwheel
auditwheel show wrappers/python/dist/*.whl | tee auditwheel.log
grep -q manylinux_2_17_ auditwheel.log
- if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-python-wrapper == 'true')
name: Publish
name: Publish wheel
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*
twine upload --skip-existing dist/*.whl
working-directory: wrappers/python
build-javascript:
Expand Down

0 comments on commit 48f4338

Please sign in to comment.