Skip to content

Commit

Permalink
update python-publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Jul 23, 2024
1 parent f82a3a6 commit 968359e
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ '3.8', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install flake8 pytest setuptools
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Test with pytest
run: |
# pytest test
cd unittest
cd test
pytest
build_wheels:
Expand All @@ -53,33 +53,38 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-2019, macos-13]
#os: [macos-10.15, windows-2019]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.17.0

- name: Build wheels
uses: pypa/cibuildwheel@v2.4.0
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: pip install numpy==1.19.5
CIBW_BEFORE_BUILD: pip install numpy==1.19.5 setuptools
CIBW_BUILD: cp38-*

- name: Build wheels
uses: pypa/cibuildwheel@v2.4.0
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: pip install numpy==1.21.6
CIBW_BEFORE_BUILD: pip install numpy==1.21.6 setuptools
CIBW_BUILD: cp39-* cp310-*
CIBW_ARCHS_MACOS: x86_64 universal2

- name: Build wheels
uses: pypa/cibuildwheel@v2.4.0
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: pip install numpy setuptools
CIBW_BUILD: cp311-*
CIBW_ARCHS_MACOS: x86_64 universal2

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -99,8 +104,9 @@ jobs:
- name: Build sdist
run: |
python setup.py sdist
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
Expand All @@ -112,10 +118,12 @@ jobs:
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
Expand Down

0 comments on commit 968359e

Please sign in to comment.