Skip to content

Commit

Permalink
Attempt rework of PyPI release workflow
Browse files Browse the repository at this point in the history
Temporarily disable the event_name='release' requirement so that runs
from web interface will still try to push package.
  • Loading branch information
ajjackson committed Jan 31, 2024
1 parent 54ba34a commit 8a3ccdc
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/build_upload_pypi_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,35 @@ jobs:
output-dir: wheelhouse

- name: Create source distribution
if: matrix.os == 'windows-latest' && matrix.python-version == '3.11'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
shell: bash -l {0}
run: |
python setup.py sdist
- name: Upload as build artifacts
- name: Upload source dist as build artifact
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' # && github.event_name == 'release'
uses: actions/upload-artifact@v3
with:
name: wheels
name: python source distribution
path: dist

- name: Upload wheels as build artifacts
uses: actions/upload-artifact@v3
with:
name: binary wheels
path: wheelhouse/*-${{ matrix.wheelname }}*.whl

- name: Upload source dist to PyPI
if: github.event_name == 'release' && matrix.os == 'windows-latest' && matrix.python-version == '3.11'
uses: pypa/gh-action-pypi-publish@release/v1
publish:
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
steps:
- name: Download build artifacts to Ubuntu environment
uses: actions/download-artifact@v4
with:
packages-dir: dist/
path: dist/

- name: Upload wheel to PyPI
if: github.event_name == 'release'
- name: Upload wheels to PyPI
# if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/

0 comments on commit 8a3ccdc

Please sign in to comment.