From 35e102416b0717a52678d975c16069b752ae4f1d Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:30:28 +0200 Subject: [PATCH 1/3] Write output directly to `wheels` instead of `dist` --- .github/workflows/releases.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index 89be9f930..d08eab4c8 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -460,19 +460,19 @@ 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_test_taplo_cli: name: Test python wheels @@ -508,7 +508,7 @@ jobs: - uses: actions/download-artifact@v4 with: pattern: wheels-* - path: dist + path: wheels merge-multiple: true - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From c8d73f0324c29e2eb8f403517ed8848022d5f50c Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:30:28 +0200 Subject: [PATCH 2/3] Merge wheels in separate job --- .github/workflows/releases.yaml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index d08eab4c8..e94a2e9bc 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -474,9 +474,24 @@ jobs: name: wheels-${{ matrix.os }}-${{ matrix.arch }} path: wheels + pypi_merge_wheels: + name: Merge wheels + needs: [pypi_build_taplo_cli] + 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 @@ -488,9 +503,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" @@ -507,8 +521,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - pattern: wheels-* + name: wheels path: wheels - merge-multiple: true - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From b96a7bfa22841e74b31e523fc5aa4d632c4214b0 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:30:29 +0200 Subject: [PATCH 3/3] Build wheels for musl Linux --- .github/workflows/releases.yaml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index e94a2e9bc..c87cc9821 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -474,9 +474,40 @@ jobs: name: wheels-${{ matrix.os }}-${{ matrix.arch }} 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] + needs: [pypi_build_taplo_cli, pypi_build_taplo_cli_musl] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4