From 5de2fe39a955b135ae88d228110b9ff47847aa7f Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Tue, 12 Sep 2023 11:53:48 -0700 Subject: [PATCH] Streamline wheel builds, skipping muslinux, and adding source distribution. --- .github/workflows/build.yml | 44 +++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b539a70..cc1e23d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,11 @@ name: Build on: [push, pull_request] env: + CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy # CIBW_BUILD_VERBOSITY: 1 # CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: python -c "import sys, pyfastnoisesimd; sys.exit(0 if pyfastnoisesimd.test().wasSuccessful() else 1)" + CIBW_SKIP: "*musllinux*" jobs: build_wheels: @@ -14,6 +16,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + cibw_build: ["cp3{8,9,10,11}-*"] + p_ver: ["3.8-3.11"] steps: - uses: actions/checkout@v3 @@ -21,40 +25,28 @@ jobs: - uses: actions/setup-python@v3 name: Install Python with: - python-version: '3.10' + python-version: '3.x' - name: Install cibuildwheel run: | python -m pip install cibuildwheel - - name: Build wheels for CPython 3.8 + - name: Build wheels for Python run: | python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: "cp38-*" - CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy - - - name: Build wheels for CPython 3.9 - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: "cp39-*" - CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy - - - name: Build wheels for CPython 3.10 - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: "cp310-*" - CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy - - - name: Build wheels for CPython 3.11 + + - name: Make sdist + if: ${{ matrix.os == 'windows-latest' }} run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: "cp311-*" - CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy + python -m pip install build + python -m build --sdist --outdir wheelhouse . - uses: actions/upload-artifact@v3 with: - path: ./wheelhouse/*.whl \ No newline at end of file + path: ./wheelhouse/* + + - name: Upload to GitHub Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: wheelhouse/* \ No newline at end of file