From 5b393ac9a604114e9b65b2451a0ca2411297f3e3 Mon Sep 17 00:00:00 2001 From: Lindon Roberts Date: Thu, 30 May 2024 16:07:26 +1000 Subject: [PATCH] Build wheels for pypi upload (but no Windows) --- .github/workflows/python_testing_windows.yml | 30 -------------------- .github/workflows/upload_pypi.yml | 28 ++++++++++++++++-- 2 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/python_testing_windows.yml diff --git a/.github/workflows/python_testing_windows.yml b/.github/workflows/python_testing_windows.yml deleted file mode 100644 index 26daeb1..0000000 --- a/.github/workflows/python_testing_windows.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Python package unit testing (Windows) - -on: [push, pull_request] - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Setup GNU Fortran - uses: modflowpy/install-gfortran-action@v1 - - name: Install dependencies - run: | - python -m pip install . - pip install pytest - - name: Run unit tests - run: | - cd trustregion/tests - python -m pytest \ No newline at end of file diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index f91f875..61530f2 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -9,6 +9,30 @@ on: jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + + # Used to host cibuildwheel + - uses: actions/setup-python@v3 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.17.0 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + make_sdist: name: Make SDist runs-on: ubuntu-latest @@ -24,7 +48,7 @@ jobs: publish-to-pypi: name: Publish to PyPI - needs: make_sdist + needs: [build_wheels, make_sdist] runs-on: ubuntu-latest environment: name: pypi @@ -39,4 +63,4 @@ jobs: path: dist merge-multiple: true - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file