Skip to content

Commit

Permalink
.github/workflows/dist.yml: Separate step for each distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 25, 2024
1 parent bc5f3a6 commit 9b1a0b2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
if: env.CAN_DEPLOY == 'true'

build_wheels:
name: Build wheels on ${{ matrix.os }}, arch ${{ matrix.arch }} ${{ matrix.build }}
name: wheels ${{ matrix.arch }} ${{ matrix.build }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: sdists_for_pypi
strategy:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap)
./bootstrap
- name: Build platform wheels
- name: Unpack and prepare
# We build the wheels from the sdists so that MANIFEST filtering becomes effective.
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
# so that SAGE_ROOT is copied into the build containers.
Expand All @@ -228,18 +228,29 @@ jobs:
#
# omit sagemath-{meataxe,sirocco} for now -- needs sagemath-modules
run: |
"${{ steps.python.outputs.python-path }}" -m pip install pipx
"${{ steps.python.outputs.python-path }}" -m pip install cibuildwheel==2.18.0
export PATH=build/bin:$PATH
export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt"
echo CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt" >> "$GITHUB_ENV"
mkdir -p unpacked
for pkg in sagemath*objects sagemath*categories sagemath*bliss sagemath*coxeter3 sagemath*mcqd sagemath*tdlib; do
case "$pkg:${{ matrix.arch }}" in
sagemath*tdlib:i686) continue;; # broken - boost-related
esac
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.18.0 unpacked/$pkg*
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/$pkg*
done
- name: sagemath-objects
run: "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*objects*
- name: sagemath-categories
run: "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*categories*
- name: sagemath-bliss
run: "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*bliss*
- name: sagemath-coxeter3
run: "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*coxeter3*
- name: sagemath-mcqd
run: "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*mcqd*

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }}-wheels
Expand Down

0 comments on commit 9b1a0b2

Please sign in to comment.