Skip to content

Commit

Permalink
Tune CI
Browse files Browse the repository at this point in the history
  • Loading branch information
matz-e committed May 23, 2024
1 parent 82520d1 commit 912a649
Showing 1 changed file with 39 additions and 30 deletions.
69 changes: 39 additions & 30 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,6 @@ jobs:
name: dist
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50

# Used to host cibuildwheel
- uses: actions/setup-python@v5

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

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_TEST_COMMAND: "pytest ${{ github.event_name == 'push' && '--run-slow' || '' }} {project}/tests"

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

test_sdist:
name: Test source distribution

Expand Down Expand Up @@ -89,12 +60,41 @@ jobs:
run: |
pytest tests
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50

# Used to host cibuildwheel
- uses: actions/setup-python@v5

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

- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_TEST_COMMAND: "pytest ${{ github.event_name == 'push' && '--run-slow' || '' }} {project}/tests"

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

publish:
name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
needs: [build_sdist, test_sdist]
needs: [build_wheels, build_sdist, test_sdist]

environment:
name: publish_pypi
Expand All @@ -109,9 +109,18 @@ jobs:
with:
name: dist
path: dist/

- name: Download artifacts produced by the build_wheels job
uses: actions/download-artifact@v3
with:
pattern: cibw-wheels-*
path: dist/
merge-multiple: true

- name: Display structure of downloaded files
run: ls -R
working-directory: dist

- name: Publish source distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 912a649

Please sign in to comment.