diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 20af6db..a8b9d22 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -247,9 +247,71 @@ jobs: path: ./quaddtype/wheelhouse/*.whl name: wheels-windows-${{ matrix.architecture }} + build_sdist: + name: Build SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ">=3.11.0" + + - name: Verify QuadBLAS submodule + run: | + ls -la quaddtype/numpy_quaddtype/QBLAS/ + ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + + - name: Install system dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y cmake gcc g++ make git pkg-config + + - name: Install SLEEF + run: | + git clone --branch 3.8 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build \ + -DSLEEF_BUILD_QUAD:BOOL=ON \ + -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + cmake --build build/ --clean-first -j + sudo cmake --install build --prefix /usr/local + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build + + - name: Build SDist + env: + CFLAGS: "-I/usr/local/include -I$(pwd)/numpy_quaddtype/QBLAS/include" + CXXFLAGS: "-I/usr/local/include -I$(pwd)/numpy_quaddtype/QBLAS/include -fext-numeric-literals" + LDFLAGS: "-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp" + LD_LIBRARY_PATH: "/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" + PKG_CONFIG_PATH: "/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + run: | + python -m build --sdist --outdir dist/ + working-directory: ./quaddtype + + - name: Upload SDist artifact + uses: actions/upload-artifact@v4 + with: + name: sdist + path: ./quaddtype/dist/*.tar.gz + publish_to_pypi: name: Publish to PyPI - needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows] + needs: + [ + build_wheels_linux, + build_wheels_macos, + build_wheels_windows, + build_sdist, + ] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/quaddtype-v') @@ -264,9 +326,9 @@ jobs: - name: Download all workflow run artifacts uses: actions/download-artifact@v4 with: + pattern: "*" path: dist + merge-multiple: true - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist/*