Skip to content

Commit 8a65361

Browse files
authored
[Fix] Fix publish workflow error by renaming wheel file (#38)
1. New start condition for publish workflow. Either branch name or tag works. Here's an [example](https://github.com/openxrlab/xrprimer/actions/runs/4795935957) triggered by tag. 2. Replace twine username from `__token__` to `secrets.PYPI_USERNAME`, works well in forked repo.
1 parent c9ddbc5 commit 8a65361

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: deploy
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- 'publish*'
7+
tags:
8+
- 'v*'
49

510
jobs:
611
build-n-publish:
712
runs-on: ubuntu-22.04
8-
if: startsWith(github.event.ref, 'refs/tags')
913
container:
1014
image: openxrlab/xrprimer_ci:manylinux2014_x86_64_torch1110_mmcv170
1115
strategy:
@@ -20,9 +24,7 @@ jobs:
2024
python setup.py bdist_wheel
2125
- name: Publish distribution to PyPI
2226
run: |
23-
source /opt/miniconda/etc/profile.d/conda.sh && conda activate py-${{ matrix.python-version }}
2427
for i in $( ls dist/*-linux_x86_64.whl ); do auditwheel repair $i; done
25-
for i in $( ls dist/*-linux_x86_64.whl ); do mv $i ${i%-linux*}-manylinux2014_x86_64.whl; done
2628
du -sh wheelhouse/*
2729
for i in $( ls wheelhouse/*.whl ); do auditwheel show $i; done
28-
twine upload wheelhouse/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
30+
twine upload wheelhouse/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)