Skip to content

ENH: Add linear interpolation of indices #170

ENH: Add linear interpolation of indices

ENH: Add linear interpolation of indices #170

Workflow file for this run

name: Build wheels
# Only build on tagged releases
on:
release:
types: [published]
# Also allow running this action on PRs if requested by applying the
# "Run cibuildwheel" label.
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
jobs:
build_wheels:
if: |
github.event_name == 'release' ||
(github.event_name == 'pull_request' && (
(
github.event.action == 'labeled' &&
github.event.label.name == 'CI: build wheels'
) ||
contains(github.event.pull_request.labels.*.name,
'CI: build wheels')
)
)
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-15-intel, macos-15, ubuntu-24.04-arm]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download source files
run: |
python .github/workflows/download_mirror.py
# sets up the compiler paths automatically for us
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 13
- name: Fix compiler symlinks for Intel Mac
if: matrix.os == 'macos-15-intel'
run: |
# setup-fortran creates broken symlinks on Intel Macs
# because it points to /opt/homebrew/bin but compilers are in /usr/local/bin
# Find where gcc-13 is actually installed
if [ -f /usr/local/bin/gcc-13 ]; then
GCC_PATH="/usr/local/bin/gcc-13"
GFORTRAN_PATH="/usr/local/bin/gfortran-13"
GXX_PATH="/usr/local/bin/g++-13"
elif [ -f /opt/homebrew/bin/gcc-13 ]; then
GCC_PATH="/opt/homebrew/bin/gcc-13"
GFORTRAN_PATH="/opt/homebrew/bin/gfortran-13"
GXX_PATH="/opt/homebrew/bin/g++-13"
else
echo "Error: Cannot find gcc-13"
exit 1
fi
echo "Found compilers at: $GCC_PATH"
# Remove any existing symlinks and create new ones
sudo rm -f /usr/local/bin/gcc /usr/local/bin/gfortran /usr/local/bin/g++
sudo ln -sf "$GCC_PATH" /usr/local/bin/gcc
sudo ln -sf "$GFORTRAN_PATH" /usr/local/bin/gfortran
sudo ln -sf "$GXX_PATH" /usr/local/bin/g++
echo "Created symlinks:"
ls -la /usr/local/bin/gcc /usr/local/bin/gfortran /usr/local/bin/g++
# Force /usr/local/bin to be first in PATH for all subsequent steps
echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV
# Also explicitly set the compiler environment variables to full paths
echo "CC=/usr/local/bin/gcc" >> $GITHUB_ENV
echo "CXX=/usr/local/bin/g++" >> $GITHUB_ENV
echo "FC=/usr/local/bin/gfortran" >> $GITHUB_ENV
- name: Compiler versions
run: |
which gcc
gcc --version
which gfortran
gfortran --version
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
env:
# The brew built gfortran linked libraries have minimum macOS versions
# of the macOS version they were built on. We would need to compile
# from source rather than use setup-fortran if we want to support
# lower macOS versions.
MACOSX_DEPLOYMENT_TARGET: "${{ (matrix.os == 'macos-15' || matrix.os == 'macos-15-intel') && '15.0' || (matrix.os == 'macos-13' && '13.0' || '14.0') }}"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: '3.14'
- name: Download source files
run: |
python .github/workflows/download_mirror.py
- name: Build sdist
run: |
python -m pip install meson-python meson ninja build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/pymsis
permissions:
id-token: write
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download sdist and wheels
uses: actions/download-artifact@v5
with:
# unpacks all CIBW artifacts into dist/
pattern: 'cibw-*'
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1