7979 python-version : " 3.9 - 3.13"
8080 update-environment : false
8181
82+ - name : Retrieve configure tarball cache
83+ id : cache-configure
84+ uses : actions/cache/restore@v4
85+ with :
86+ path : |
87+ build/pkgs/configure
88+ upstream/configure*
89+ key : >-
90+ configure-build=${{
91+ hashFiles('build',
92+ 'configure.ac',
93+ 'm4')
94+ }}
95+
96+ - name : Bootstrap
97+ if : steps.cache-configure.outputs.cache-hit != 'true'
98+ # Patch python3 spkg-configure to allow Python 3.8.0 during the CIBW_BEFORE_ALL phase
99+ run : |
100+ export PATH=$(pwd)/build/bin:$PATH
101+ eval $(sage-print-system-package-command auto --sudo --yes update)
102+ eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap bzip2 xz liblzma)
103+ sed -i.bak '/m4_pushdef.*MIN_VERSION/s/3[0-9.]*/3.8.0/' build/pkgs/python3/spkg-configure.m4
104+ ./bootstrap -s
105+
106+ - name : Save configure tarball cache
107+ if : steps.cache-configure.outputs.cache-hit != 'true'
108+ uses : actions/cache/save@v4
109+ with :
110+ path : |
111+ build/pkgs/configure
112+ upstream/configure*
113+ key : ${{ steps.cache-configure.outputs.cache-primary-key }}
114+
82115 - name : Build platform wheels
83116 # We build the wheel from the sdist.
84117 # But we must run cibuildwheel with the unpacked source directory, not a tarball,
@@ -88,22 +121,26 @@ jobs:
88121 # https://cibuildwheel.readthedocs.io/en/stable/options/#before-all
89122 run : |
90123 "${{ steps.python.outputs.python-path }}" -m pip install pipx
124+ if [ ! -x ./configure ]; then ./bootstrap -D; fi
125+ touch configure
91126 export PATH=build/bin:$PATH
92- 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) ) && ./bootstrap && ./ configure --enable-build-as-root --enable-fat-binary && MAKE=\"make -j6\" make V=0 $TARGETS_PRE"
127+ 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) ) && ./configure --enable-build-as-root --enable-fat-binary --disable-python-distutils-check && MAKE=\"make -j6\" make V=0 $TARGETS_PRE"
93128 mkdir -p unpacked
94129 for pkg in pplitepy; do
95130 (cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
96131 "${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.21.3 unpacked/$pkg*
97132 done
98133
99134 - uses : actions/upload-artifact@v4
135+ if : always()
100136 with :
101137 name : ${{ matrix.os }}-${{ matrix.arch }}-wheels
102138 path : ./wheelhouse/*.whl
103-
139+
104140 pypi-publish :
105141 needs : build_wheels
106142 name : Upload release to PyPI
143+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
107144 runs-on : ubuntu-latest
108145 environment :
109146 name : pypi
@@ -129,4 +166,3 @@ jobs:
129166 # # password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }}
130167 skip_existing : true
131168 verbose : true
132- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
0 commit comments