Modifications for automatic packaging on github (#494) #2
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: Python package | |
on: [push] | |
jobs: | |
build_wheel: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-14, windows-latest] | |
build_type: [Release] | |
c_compiler: [clang] | |
python-version: ['3.11'] | |
# python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.21.3 | |
- name: MacOS dpendencies | |
if: ${{ runner.os == 'macOS' }} | |
run: | | |
brew install gsl | |
brew install hdf5 | |
- name: Windows dependencies | |
if: ${{ runner.os == 'Windows' }} | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: moose | |
cache-environment: true | |
cache-downloads: true | |
create-args: >- | |
python=${{ matrix.python-version }} | |
pkg-config | |
clang | |
hdf5 | |
pybind11[global] | |
graphviz | |
pytables | |
numpy | |
matplotlib | |
vpython | |
lxml | |
doxygen | |
setuptools | |
wheel | |
meson | |
ninja | |
meson-python | |
gsl | |
cibuildwheel | |
post-cleanup: all | |
generate-run-shell: false | |
- name: Linux package | |
if: runner.os == 'Linux' | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BEFORE_ALL: 'uname -a' | |
CIBW_BEFORE_ALL_LINUX: > | |
yum install -y epel-release && | |
yum install -y pkgconfig && | |
yum install -y gsl-devel && | |
yum install -y hdf5-devel | |
CIBW_BUILD: '*-manylinux_x86_64' | |
CIBW_SKIP: 'pp*' | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28 | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
ls wheelhouse | |
- name: MacOS package | |
if: runner.os == 'macOS' | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BEFORE_ALL: 'uname -a' | |
CIBW_BEFORE_ALL_MACOS: > | |
brew uninstall pkg-config || : | |
brew uninstall pkg-config@0.29.2 || : | |
brew install gsl hdf5 meson ninja cmake && | |
export PKG_CONFIG=`which pkg-config` && | |
echo "<<<<<<<<<#########################################>>>>>>>>>>" && | |
echo "$$$$$ `pkg-config --libs gsl`" && | |
echo "@@@@@ `pkg-config --cflags gsl`" | |
CIBW_ARCHS: 'arm64' | |
CIBW_BUILD: '*-macosx_arm64' | |
CIBW_SKIP: 'pp* cp38*' | |
run: | | |
export "MACOSX_DEPLOYMENT_TARGET=$(echo ${{ matrix.os }} | cut -c 7-8).0" # required because gsl2.8 has minimum target of 14.0 | |
python -m cibuildwheel --output-dir wheelhouse | |
ls wheelhouse | |
- name: Windows package | |
if: runner.os == 'Windows' | |
env: | |
CIBW_BEFORE_ALL: 'uname -a' | |
CIBW_BUILD: '*-win_*' | |
CIBW_SKIP: '*-win32 pp*' | |
run: | | |
micromamba shell hook -s powershell | Out-String | Invoke-Expression | |
micromamba activate moose | |
python -m cibuildwheel --output-dir wheelhouse | |
dir wheelhouse | |
- name: Upload packages | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: "wheelhouse/pymoose*.whl" |