Skip to content

Commit

Permalink
fix: resolve cross-compilation and artifact conflicts
Browse files Browse the repository at this point in the history
- Added PYO3_CROSS_PYTHON_VERSION for musl builds to fix cross-compilation
- Made artifact names unique per job/target/python-version
- Updated release job to gather all wheel artifacts
- Fixed artifact naming conflicts in upload steps

These changes resolve the musl build failures and the artifact upload
conflicts in the CI pipeline.
  • Loading branch information
dirvine committed Nov 29, 2024
1 parent de6100c commit aa4b81f
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error

Expand All @@ -76,11 +76,12 @@ jobs:
strategy:
matrix:
target: [x86_64, i686]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -97,19 +98,20 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist

linux-cross:
runs-on: ubuntu-latest
strategy:
matrix:
target: [aarch64, armv7, s390x, ppc64le, ppc64]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: messense/maturin-action@v1
with:
Expand All @@ -135,7 +137,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist

musllinux:
Expand All @@ -145,19 +147,22 @@ jobs:
target:
- x86_64-unknown-linux-musl
- i686-unknown-linux-musl
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Build wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
env:
PYO3_CROSS_PYTHON_VERSION: ${{ matrix.python-version }}
PYO3_CROSS: "1"
with:
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --out dist
maturin-version: "v0.13.0"
- name: Install built wheel
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
Expand All @@ -172,7 +177,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist

musllinux-cross:
Expand All @@ -184,11 +189,12 @@ jobs:
arch: aarch64
- target: armv7-unknown-linux-musleabihf
arch: armv7
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: messense/maturin-action@v1
with:
Expand All @@ -211,7 +217,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.platform.target }}-py${{ matrix.python-version }}
path: dist


Expand All @@ -231,7 +237,7 @@ jobs:
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist-py${{ env.PYTHON_VERSION }}
path: dist/*.tar.gz
if-no-files-found: error

Expand All @@ -246,8 +252,18 @@ jobs:
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
name: wheels-*
path: dist

# Add additional steps to download each artifact type
- uses: actions/download-artifact@v3
with:
name: wheels-sdist-py${{ env.PYTHON_VERSION }}
path: dist

# We might need multiple download steps or a different approach
# to combine all artifacts

- name: Display structure of downloaded files
run: ls -R dist
- name: Publish to PyPI
Expand Down

0 comments on commit aa4b81f

Please sign in to comment.