Skip to content

Commit d2f7eb0

Browse files
authored
Update package.yml for package.yaml
1 parent 0462d1a commit d2f7eb0

1 file changed

Lines changed: 27 additions & 47 deletions

File tree

.github/workflows/package.yml

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python package
1+
name: Python Package
22

33
on: [push]
44

@@ -15,35 +15,40 @@ jobs:
1515
build_type: [Release]
1616
c_compiler: [clang]
1717
python-version: ['3.11']
18+
gsl_version: ["2.6", "2.7", "2.8"] # Multiple GSL versions
19+
1820
steps:
1921
- uses: actions/checkout@v4
2022

2123
- uses: actions/setup-python@v5
2224
with:
2325
python-version: ${{ matrix.python-version }}
2426

25-
- name: Install cibuildwheel
26-
run: python -m pip install cibuildwheel==2.21.3
27+
- name: Install cibuildwheel and Twine
28+
run: python -m pip install cibuildwheel==2.21.3 twine
2729

28-
- name: Install Twine
29-
run: python -m pip install twine # Install Twine for uploading the package
30+
- name: Install GSL (MacOS)
31+
if: runner.os == 'macOS'
32+
run: |
33+
brew install gsl@${{ matrix.gsl_version }}
34+
brew install hdf5
3035
31-
- name: MacOS dependencies
32-
if: ${{ runner.os == 'macOS' }}
36+
- name: Install GSL (Linux)
37+
if: runner.os == 'Linux'
3338
run: |
34-
brew uninstall pkg-config || echo "pkg-config not installed, skipping uninstallation."
35-
brew uninstall pkg-config@0.29.2 || echo "pkg-config@0.29.2 not available, skipping uninstallation."
36-
brew install gsl hdf5
37-
38-
- name: Windows dependencies
39-
if: ${{ runner.os == 'Windows' }}
39+
sudo apt-get update
40+
sudo apt-get -y install libgsl-dev libhdf5-dev
41+
42+
- name: Setup Micromamba (Windows)
43+
if: runner.os == 'Windows'
4044
uses: mamba-org/setup-micromamba@v1
4145
with:
4246
environment-name: moose
4347
cache-environment: true
4448
cache-downloads: true
4549
create-args: >-
4650
python=${{ matrix.python-version }}
51+
gsl=${{ matrix.gsl_version }}
4752
pkg-config
4853
clang
4954
hdf5
@@ -60,54 +65,34 @@ jobs:
6065
meson
6166
ninja
6267
meson-python
63-
gsl
6468
cibuildwheel
6569
post-cleanup: all
6670
generate-run-shell: false
6771

68-
- name: Linux package
72+
- name: Build Linux Wheel
6973
if: runner.os == 'Linux'
7074
env:
71-
CIBW_BUILD_VERBOSITY: 1
72-
CIBW_BEFORE_ALL: 'uname -a'
7375
CIBW_BEFORE_ALL_LINUX: >
74-
yum install -y epel-release &&
75-
yum install -y pkgconfig &&
76-
yum install -y gsl-devel &&
77-
yum install -y hdf5-devel
76+
yum install -y gsl-devel hdf5-devel
7877
CIBW_BUILD: '*-manylinux_x86_64'
7978
CIBW_SKIP: 'pp*'
80-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
81-
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28
8279
run: |
8380
python -m cibuildwheel --output-dir wheelhouse
8481
ls wheelhouse
8582
86-
- name: MacOS package
83+
- name: Build MacOS Wheel
8784
if: runner.os == 'macOS'
8885
env:
89-
CIBW_BUILD_VERBOSITY: 1
90-
CIBW_BEFORE_ALL: 'uname -a'
91-
CIBW_BEFORE_ALL_MACOS: >
92-
brew uninstall pkg-config || :
93-
brew uninstall pkg-config@0.29.2 || :
94-
brew install gsl hdf5 meson ninja cmake &&
95-
export PKG_CONFIG=`which pkg-config` &&
96-
echo "<<<<<<<<<<##########################################>>>>>>>>>>" &&
97-
echo "$$$$$ `pkg-config --libs gsl`" &&
98-
echo "@@@@@ `pkg-config --cflags gsl`"
99-
CIBW_ARCHS: 'arm64'
10086
CIBW_BUILD: '*-macosx_arm64'
10187
CIBW_SKIP: 'pp* cp38*'
10288
run: |
103-
export "MACOSX_DEPLOYMENT_TARGET=$(echo ${{ matrix.os }} | cut -c 7-8).0" # required because gsl2.8 has minimum target of 14.0
89+
export "MACOSX_DEPLOYMENT_TARGET=14.0"
10490
python -m cibuildwheel --output-dir wheelhouse
10591
ls wheelhouse
10692
107-
- name: Windows package
108-
if: runner.os == 'Windows'
93+
- name: Build Windows Wheel
94+
if: runner.os == 'Windows'
10995
env:
110-
CIBW_BEFORE_ALL: 'uname -a'
11196
CIBW_BUILD: '*-win_*'
11297
CIBW_SKIP: '*-win32 pp*'
11398
run: |
@@ -117,13 +102,8 @@ jobs:
117102
dir wheelhouse
118103
119104
- name: Upload to PyPI
120-
if: always()
121105
env:
122-
TWINE_USERNAME: __token__ # Use __token__ as the username
123-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Use the secret with your PyPI token as the password
106+
TWINE_USERNAME: __token__
107+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
124108
run: |
125-
python -m pip install --upgrade twine # Ensure Twine is installed again
126-
python -m twine --version # Debug: Check Twine version
127-
which python # Debug: Ensure Python is available
128-
which twine # Debug: Check if Twine is correctly installed
129-
python -m twine upload wheelhouse/*.whl # Upload the built wheels to PyPI
109+
python -m twine upload wheelhouse/*.whl

0 commit comments

Comments
 (0)