Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Dicklesworthstone committed Nov 5, 2023
1 parent e1f1e86 commit 46d1764
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ name: Build and Publish to PyPI
on:
push:
branches:
- main
- main
release:
types: [created]

jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -23,36 +18,16 @@ jobs:
with:
python-version: '3.x'

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

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

publish:
needs: build-wheels
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install twine
run: python -m pip install twine
- name: Build wheel
run: |
python -m pip install --upgrade build
python -m build
- name: Publish to PyPI
run: twine upload dist/*
if: github.event_name == 'release' && github.event.action == 'created'
run: |
python -m pip install --upgrade twine
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 46d1764

Please sign in to comment.