Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Python wheels for musl Linux #659

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 53 additions & 9 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,23 +460,69 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
args: --out wheels
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.arch }}
args: --release --out dist
args: --release --out wheels
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: dist
path: wheels

pypi_build_taplo_cli_musl:
name: Build python wheels for musl
runs-on: ubuntu-latest
container:
image: docker://messense/rust-musl-cross:${{ matrix.platform.image_tag }}
strategy:
fail-fast: false
matrix:
# https://github.com/messense/auditwheel-symbols/blob/0447596/.github/workflows/CI.yml#L95-L99
# target: https://peps.python.org/pep-0491/#file-name-convention
# image_tag: https://github.com/rust-cross/rust-musl-cross?tab=readme-ov-file#prebuilt-images
platform: [
{ target: "x86_64-unknown-linux-musl", image_tag: "x86_64-musl" },
{ target: "i686-unknown-linux-musl", image_tag: "i686-musl" },
{ target: "aarch64-unknown-linux-musl", image_tag: "aarch64-musl" },
]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out wheels
container: off
manylinux: musllinux_1_1
target: ${{ matrix.platform.target }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: wheels

pypi_merge_wheels:
name: Merge wheels
needs: [pypi_build_taplo_cli, pypi_build_taplo_cli_musl]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: wheels
merge-multiple: true
- uses: actions/upload-artifact@v4
with:
name: wheels
path: wheels

pypi_test_taplo_cli:
name: Test python wheels
needs: ["pypi_build_taplo_cli"]
needs: [pypi_merge_wheels]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -488,9 +534,8 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
name: wheels
path: wheels
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: "3"
Expand All @@ -507,8 +552,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
name: wheels
path: wheels
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading