Skip to content

Commit 73c70a3

Browse files
committed
Fix wheel upload
1 parent d140cee commit 73c70a3

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,11 @@ jobs:
196196
fetch-depth: 0 # Fetch everything to get accurately versioned tag.
197197
- uses: actions/setup-python@v5
198198
name: Install Python
199-
- name: Install cibuildwheel twine wheel
200-
run: python -m pip install cibuildwheel twine wheel
199+
- name: Install cibuildwheel build
200+
run: python -m pip install cibuildwheel build
201+
- name: Build sdist
202+
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
203+
run: python -m build --sdist
201204
- name: Install build dependencies (Macos)
202205
run: brew install nasm
203206
if: runner.os == 'macOS'
@@ -251,26 +254,20 @@ jobs:
251254
PYTHON_ISAL_BUILD_CACHE=True
252255
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
253256
CFLAGS="-g0 -DNDEBUG"
254-
- name: Build sdist
255-
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
256-
run: |
257-
pip install build
258-
python -m build --sdist
259257
- uses: actions/upload-artifact@v4
260258
with:
261259
name: "dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.cibw_archs_linux }}"
262260
path: "dist/"
263261
- name: Publish package to TestPyPI
264-
# pypa/gh-action-pypi-publish@master does not work on OSX
265-
# Alpha, Beta and dev releases contain a - in the tag.
266262
if: contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')
267-
run: twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
268-
env:
269-
TWINE_USERNAME: __token__
270-
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
263+
uses: pypa/gh-action-pypi-publish@release/v1
264+
with:
265+
repository-url: "https://test.pypi.org/legacy/"
266+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
267+
skip-existing: true
271268
- name: Publish package to PyPI
272269
if: "!contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')"
273-
run: twine upload --skip-existing dist/*
274-
env:
275-
TWINE_USERNAME: __token__
276-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
270+
uses: pypa/gh-action-pypi-publish@release/v1
271+
with:
272+
password: ${{ secrets.PYPI_API_TOKEN }}
273+
skip-existing: true

0 commit comments

Comments
 (0)