Skip to content

Commit

Permalink
Fix Python build in CI (#651)
Browse files Browse the repository at this point in the history
* Fix Python build in CI

* Try to fix the Python build in CI on macOS
  • Loading branch information
miikka authored Aug 6, 2024
1 parent 62cb81a commit ce22257
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true

macos:
runs-on: macos-latest
# actions/setup-python with Python <3.11 does not work with macos-latest
runs-on: macos-13
needs:
- should-publish
if: needs.should-publish.outputs.is_new_version == 'yes'
Expand All @@ -85,6 +88,8 @@ jobs:
- name: Build wheels - x86_64
uses: messense/maturin-action@v1
with:
# version pinned until https://github.com/PyO3/maturin/issues/2154 is fixed
maturin-version: v1.6.0
target: x86_64
args: --release --interpreter python --out dist --sdist -m pytrustfall/Cargo.toml
- name: Install built wheel - x86_64
Expand All @@ -94,16 +99,17 @@ jobs:
- name: Build wheels - universal2
uses: messense/maturin-action@v1
with:
args: --release --interpreter python --universal2 --out dist -m pytrustfall/Cargo.toml
target: universal2
args: --release --interpreter python --out dist -m pytrustfall/Cargo.toml
- name: Install built wheel - universal2
run: |
pip install trustfall --no-index --find-links dist --force-reinstall
python -c "import trustfall"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
name: wheels-macos-${{ matrix.python-version }}
path: dist/*.whl

windows:
runs-on: windows-latest
Expand Down Expand Up @@ -140,8 +146,8 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
name: wheels-windows-${{ matrix.python-version }}
path: dist/*.whl

linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -179,8 +185,8 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
name: wheels-linux-${{ matrix.python-version }}
path: dist/*.whl

# musllinux:
# runs-on: ubuntu-latest
Expand Down Expand Up @@ -221,8 +227,8 @@ jobs:
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels
# path: /io/dist
# name: wheels-musllinux-${{ matrix.python-version }}
# path: /io/dist/*.whl

should-publish:
name: Did version change
Expand Down

0 comments on commit ce22257

Please sign in to comment.