Skip to content

Commit

Permalink
🔨(tasks.py): only build wheel directly if cibuildwheel fails or is di…
Browse files Browse the repository at this point in the history
…sabled

Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Oct 25, 2024
1 parent 50edb3f commit 4565807
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ozi/tasks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Invoke tasks for OZI CI."""
# ozi/tasks.py
# Part of the OZI Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.txt for license information.
Expand Down Expand Up @@ -91,6 +92,7 @@ def release(
sdist: bool = False,
draft: bool = False,
cibuildwheel: bool = True,
wheel: bool = True,
sign: bool = False,
ozi: bool = False,
) -> None:
Expand All @@ -101,12 +103,14 @@ def release(
c.run('python -m build --sdist')
if sign:
c.run('sigstore sign --output-dir=sig dist/*.tar.gz')
(
c.run('cibuildwheel --prerelease-pythons --output-dir dist .', warn=True)
if cibuildwheel
else None
)
c.run('python -m build --wheel')

if cibuildwheel:
res = c.run('cibuildwheel --prerelease-pythons --output-dir dist .', warn=True)
if res.exited != 0 and wheel:
c.run('python -m build --wheel')
elif wheel:
c.run('python -m build --wheel')

if sign:
c.run('sigstore sign --output-dir=sig dist/*.whl')

Expand Down

0 comments on commit 4565807

Please sign in to comment.