commit:     5fd8dcad9d55cdc1c98a3cd93c82e324e486bdc0
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 14 20:42:05 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 16:49:38 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=5fd8dcad

release: cleaner and cross support

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .github/workflows/manylinux.sh | 20 --------------------
 .github/workflows/release.yml  | 19 ++++++++++++-------
 pyproject.toml                 | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/.github/workflows/manylinux.sh b/.github/workflows/manylinux.sh
deleted file mode 100755
index c56892aa..00000000
--- a/.github/workflows/manylinux.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# Mangle the manylinux docker image to successfully build and test wheels.
-
-set -ex
-
-# install git
-if command -v apk; then
-    apk add --no-cache git bash py3-lxml
-elif command -v yum; then
-    yum update -y
-    yum install -y libxslt-devel libxml2-devel python-devel
-else
-    apt-get update
-    apt-get install -y git libxml2-dev libxslt-dev python-dev
-fi
-
-# download static build of recent bash release
-URL="https://github.com/robxu9/bash-static/releases/download/5.1.016-1.2.3/bash-linux-${1:-x86_64}";
-curl -L "$URL" > /usr/local/bin/bash
-chmod +x /usr/local/bin/bash

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4ffd6f50..6de38945 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -47,21 +47,26 @@ jobs:
 
   build-wheel:
     runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        arch: [x86_64, aarch64, ppc64le, s390x]
+
     steps:
     - name: Checkout code
       uses: actions/checkout@v3
 
+    - name: Set up QEMU
+      uses: docker/setup-qemu-action@v2
+      with:
+        platforms: ${{matrix.arch}}
+
     - name: Build wheels
-      uses: joerick/cibuildwheel@v2.10.0
+      uses: joerick/cibuildwheel@v2.11.2
       with:
         output-dir: dist
       env:
-        CIBW_BUILD: cp310-*
-        CIBW_ARCHS_LINUX: x86_64
-        CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24
-        CIBW_BEFORE_BUILD: "{project}/.github/workflows/manylinux.sh && pip 
install '{project}'"
-        CIBW_BEFORE_TEST: pip install '{project}[test]'
-        CIBW_TEST_COMMAND: pytest {project}/tests
+        CIBW_ARCHS_LINUX: ${{matrix.arch}}
 
     - name: Upload wheel artifacts
       uses: actions/upload-artifact@v3

diff --git a/pyproject.toml b/pyproject.toml
index bb6410bc..6245024e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -77,3 +77,39 @@ version = {attr = "pkgcheck.__version__"}
 minversion = "6.0"
 addopts = "-vv -ra -l"
 testpaths = ["tests"]
+
+[tool.cibuildwheel]
+build = "cp310-*"
+build-frontend = "build"
+
+before-build = [
+       "rm -f {project}/src/pkgcheck/bash/lang.so"
+]
+test-requires = ["pytest", "requests"]
+test-command = "pytest {project}/tests"
+
+# glibc 2.24
+manylinux-x86_64-image = "manylinux_2_24"
+manylinux-i686-image = "manylinux_2_24"
+manylinux-aarch64-image = "manylinux_2_24"
+manylinux-ppc64le-image = "manylinux_2_24"
+manylinux-s390x-image = "manylinux_2_24"
+test-skip = "*-*linux_{aarch64,ppc64le,s390x}"
+
+[[tool.cibuildwheel.overrides]]
+select = "*-musllinux*"
+before-all = [
+       "apk add --no-cache git bash libxml2-dev libxslt-dev",
+]
+
+[[tool.cibuildwheel.overrides]]
+select = "*-manylinux*"
+before-all = [
+       "apt-get update",
+       "apt-get install -y git libxml2-dev libxslt-dev",
+       # "yum update -y",
+       # "yum install -y git libxslt-devel libxml2-devel",
+
+       "curl -L 
\"https://github.com/robxu9/bash-static/releases/download/5.1.016-1.2.3/bash-linux-$(uname
 -m)\" -o /usr/local/bin/bash",
+       "chmod +x /usr/local/bin/bash",
+]

Reply via email to