|
| 1 | +name: Python package |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_wheel: |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, macos-14, windows-latest] |
| 12 | + build_type: [Release] |
| 13 | + c_compiler: [clang] |
| 14 | + python-version: ['3.11'] |
| 15 | + # python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - uses: actions/setup-python@v5 |
| 20 | + |
| 21 | + - name: Install cibuildwheel |
| 22 | + run: python -m pip install cibuildwheel==2.21.3 |
| 23 | + |
| 24 | + - name: MacOS dpendencies |
| 25 | + if: ${{ runner.os == 'macOS' }} |
| 26 | + run: | |
| 27 | + brew install gsl |
| 28 | + brew install hdf5 |
| 29 | + - name: Windows dependencies |
| 30 | + if: ${{ runner.os == 'Windows' }} |
| 31 | + uses: mamba-org/setup-micromamba@v1 |
| 32 | + with: |
| 33 | + environment-name: moose |
| 34 | + cache-environment: true |
| 35 | + cache-downloads: true |
| 36 | + create-args: >- |
| 37 | + python=${{ matrix.python-version }} |
| 38 | + pkg-config |
| 39 | + clang |
| 40 | + hdf5 |
| 41 | + pybind11[global] |
| 42 | + graphviz |
| 43 | + pytables |
| 44 | + numpy |
| 45 | + matplotlib |
| 46 | + vpython |
| 47 | + lxml |
| 48 | + doxygen |
| 49 | + setuptools |
| 50 | + wheel |
| 51 | + meson |
| 52 | + ninja |
| 53 | + meson-python |
| 54 | + gsl |
| 55 | + cibuildwheel |
| 56 | + post-cleanup: all |
| 57 | + generate-run-shell: false |
| 58 | + |
| 59 | + - name: Linux package |
| 60 | + if: runner.os == 'Linux' |
| 61 | + env: |
| 62 | + CIBW_BUILD_VERBOSITY: 1 |
| 63 | + CIBW_BEFORE_ALL: 'uname -a' |
| 64 | + CIBW_BEFORE_ALL_LINUX: > |
| 65 | + yum install -y epel-release && |
| 66 | + yum install -y pkgconfig && |
| 67 | + yum install -y gsl-devel && |
| 68 | + yum install -y hdf5-devel |
| 69 | + CIBW_BUILD: '*-manylinux_x86_64' |
| 70 | + CIBW_SKIP: 'pp*' |
| 71 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 |
| 72 | + CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28 |
| 73 | + run: | |
| 74 | + python -m cibuildwheel --output-dir wheelhouse |
| 75 | + ls wheelhouse |
| 76 | + - name: MacOS package |
| 77 | + if: runner.os == 'macOS' |
| 78 | + env: |
| 79 | + CIBW_BUILD_VERBOSITY: 1 |
| 80 | + CIBW_BEFORE_ALL: 'uname -a' |
| 81 | + CIBW_BEFORE_ALL_MACOS: > |
| 82 | + brew uninstall pkg-config || : |
| 83 | + brew uninstall pkg-config@0.29.2 || : |
| 84 | + brew install gsl hdf5 meson ninja cmake && |
| 85 | + export PKG_CONFIG=`which pkg-config` && |
| 86 | + echo "<<<<<<<<<#########################################>>>>>>>>>>" && |
| 87 | + echo "$$$$$ `pkg-config --libs gsl`" && |
| 88 | + echo "@@@@@ `pkg-config --cflags gsl`" |
| 89 | + CIBW_ARCHS: 'arm64' |
| 90 | + CIBW_BUILD: '*-macosx_arm64' |
| 91 | + CIBW_SKIP: 'pp* cp38*' |
| 92 | + run: | |
| 93 | + export "MACOSX_DEPLOYMENT_TARGET=$(echo ${{ matrix.os }} | cut -c 7-8).0" # required because gsl2.8 has minimum target of 14.0 |
| 94 | + python -m cibuildwheel --output-dir wheelhouse |
| 95 | + ls wheelhouse |
| 96 | + - name: Windows package |
| 97 | + if: runner.os == 'Windows' |
| 98 | + env: |
| 99 | + CIBW_BEFORE_ALL: 'uname -a' |
| 100 | + CIBW_BUILD: '*-win_*' |
| 101 | + CIBW_SKIP: '*-win32 pp*' |
| 102 | + run: | |
| 103 | + micromamba shell hook -s powershell | Out-String | Invoke-Expression |
| 104 | + micromamba activate moose |
| 105 | + python -m cibuildwheel --output-dir wheelhouse |
| 106 | + dir wheelhouse |
| 107 | + - name: Upload packages |
| 108 | + uses: xresloader/upload-to-github-release@v1 |
| 109 | + env: |
| 110 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + with: |
| 112 | + file: "wheelhouse/pymoose*.whl" |
0 commit comments