Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 40 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wheelhouse-${{ strategy.job-index }}
name: cibw-wheels-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -71,33 +71,50 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ strategy.job-index }}
name: cibw-sdist-${{ strategy.job-index }}
path: dist/*.tar.gz

publish:
name: 'Upload to PyPI/TestPyPI'
runs-on: ubuntu-20.04
needs: [build_wheels, build_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Set up built items
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
# publish:
# name: 'Upload to PyPI/TestPyPI'
# runs-on: ubuntu-20.04
# needs: [build_wheels, build_sdist]
# steps:
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.9'

- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/*
# - name: Set up built items
# uses: actions/download-artifact@v4
# with:
# pattern: cibw-*
# path: dist
# merge-multiple: true

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install setuptools wheel twine

# - name: Publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/*