DEP: Drop Python 3.8 support #386
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish | |
on: | |
pull_request: | |
branches: [main, "version-*"] | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Python ${{ matrix.python[0] }} on ${{ matrix.os_arch[0] }}-${{ matrix.os_arch[1] }} | |
runs-on: ${{ matrix.os_arch[0] }} | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: | |
- ['3.9', cp39] | |
- ['3.10', cp310] | |
- ['3.11', cp311] | |
- ['3.12', cp312] | |
os_arch: | |
- [ubuntu-latest, manylinux_x86_64] | |
- [windows-latest, win_amd64] | |
- [macos-13, macosx_x86_64] # macos-13 is the last x86-64 runner | |
- [macos-latest, macosx_arm64] # macos-latest is always arm64 going forward | |
exclude: | |
- os_arch: [macos-latest, macosx_arm64] | |
python: ['3.9', cp39] | |
env: | |
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.os_arch[1] }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python[0] }} | |
- name: Install HDF5 for macOS arm64 | |
if: ${{ matrix.os_arch[1] == 'macosx_arm64' }} | |
run: | | |
brew install hdf5 | |
- name: Install cibuildwheel | |
run: python -m pip install -U pip wheel cibuildwheel twine | |
- name: Run cibuildwheel | |
run: cibuildwheel --output-dir wheelhouse | |
- name: Check metadata | |
run: twine check wheelhouse/* | |
- uses: actions/upload-artifact@v4 | |
if: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
with: | |
name: cibw-${{ env.CIBW_BUILD }} | |
path: wheelhouse/*.whl | |
publish: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
environment: | |
name: pypi | |
url: https://pypi.org/project/xtgeo | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: wheelhouse | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
packages-dir: wheelhouse | |
verbose: true |