Skip to content

Commit

Permalink
chore: publish sdist & pure-Python wheel without waiting for binaries (
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 authored Nov 4, 2024
1 parent 6d7a45b commit 8d03fb5
Showing 1 changed file with 48 additions and 50 deletions.
98 changes: 48 additions & 50 deletions .github/workflows/cibuildwheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,54 @@ jobs:
name: cibw-sdist
path: dist/falcon-*

publish-sdist:
name: publish-sdist
needs:
- build-sdist
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 }}

build-wheels:
name: ${{ matrix.python }}-${{ matrix.platform.name }}
needs: build-sdist
Expand Down Expand Up @@ -123,59 +171,9 @@ jobs:
name: cibw-wheel-${{ matrix.python }}-${{ matrix.platform.name }}
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-wheels
needs:
- build-sdist
- build-wheels
- publish-sdist
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8d03fb5

Please sign in to comment.