Skip to content

Commit

Permalink
Merge branch 'master' into nuke-setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 committed Aug 31, 2024
2 parents 4c9b3a8 + 00f2212 commit d3c5282
Show file tree
Hide file tree
Showing 63 changed files with 1,925 additions and 1,297 deletions.
111 changes: 93 additions & 18 deletions .github/workflows/cibuildwheel.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build wheels using cibuildwheel (https://cibuildwheel.pypa.io/)
name: Build wheels
name: build-wheels

on:
# Run when a release has been created
Expand All @@ -11,6 +11,7 @@ on:

jobs:
build-sdist:
# NOTE(vytas): We actually build sdist and pure-Python wheel.
name: sdist
runs-on: ubuntu-latest

Expand All @@ -25,16 +26,31 @@ jobs:
with:
python-version: "3.12"

- name: Build sdist
- name: Build sdist and pure-Python wheel
env:
FALCON_DISABLE_CYTHON: "Y"
run: |
pip install --upgrade pip
pip install --upgrade build
python -m build
- name: Check built artifacts
run: |
tools/check_dist.py ${{ github.event_name == 'release' && format('-r {0}', github.ref) || '' }}
- name: Test sdist
run: |
tools/test_dist.py dist/*.tar.gz
- name: Test pure-Python wheel
run: |
pip install build
python -m build --sdist
tools/test_dist.py dist/*.whl
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
path: dist/falcon-*

build-wheels:
name: ${{ matrix.python }}-${{ matrix.platform.name }}
Expand Down Expand Up @@ -105,37 +121,96 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: cibw-wheel-${{ matrix.python }}-${{ matrix.platform.name }}
path: wheelhouse/*.whl
path: wheelhouse/falcon-*.whl

publish-sdist:
name: publish-sdist
needs:
- build-sdist
- build-wheels
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: cibw-sdist
path: dist
merge-multiple: true

- name: Check collected artifacts
run: |
tools/check_dist.py ${{ github.event_name == 'release' && format('-r {0}', github.ref) || '' }}
- name: Upload sdist to release
uses: AButler/[email protected]
if: github.event_name == 'release'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: 'dist/*.tar.gz'

- name: Publish sdist and pure-Python wheel to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'workflow_dispatch'
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish sdist and pure-Python wheel to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'
with:
password: ${{ secrets.PYPI_TOKEN }}

publish-wheels:
name: publish
name: publish-wheels
needs:
- build-sdist
- build-wheels
- publish-sdist
runs-on: ubuntu-latest

steps:
- name: Download packages
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: cibw-*
pattern: cibw-wheel-*
path: dist
merge-multiple: true

- name: Check collected artifacts
# TODO(vytas): Run a script to perform version sanity checks instead.
run: ls -l dist/
run: |
tools/check_dist.py ${{ github.event_name == 'release' && format('-r {0}', github.ref) || '' }}
- name: Publish artifacts to TestPyPI
- name: Publish binary wheels to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'workflow_dispatch'
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/

# TODO(vytas): Enable this nuclear option once happy with other tests.
# - name: Publish artifacts to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# if: github.event_name == 'release'
# with:
# password: ${{ secrets.PYPI_TOKEN }}
- name: Publish binary wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'
with:
password: ${{ secrets.PYPI_TOKEN }}
Loading

0 comments on commit d3c5282

Please sign in to comment.