Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdenobel authored Feb 15, 2024
1 parent 9d5a596 commit 1f6adea
Showing 1 changed file with 44 additions and 78 deletions.
122 changes: 44 additions & 78 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,85 +5,51 @@ on:
types: [created]

jobs:
publish-mac-windows:
strategy:
matrix:
python-version: ["3.6.x", "3.7.x", "3.8.x", "3.9.x", "3.10.x", "3.11.x", "3.12.x"]
os: [macos-latest, windows-latest]
exclude:
- os: macos-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
with:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-22.04, windows-2022, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
architecture: ${{matrix.architecture}}
- name: Install Ninja
if: startsWith(matrix.os, 'macOS')
run: |
brew install ninja
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine ninja mypy pybind11
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload --verbose dist/*
- name: Build wheels
uses: pypa/[email protected]

publish-unix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine mypy pybind11
- name: build manylinux
uses: RalfG/[email protected]_x86_64
with:
system-packages: 'ninja-build'
- name: Publish manylinux
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --verbose dist/*-manylinux*.whl
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1

publish-source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install ninja-build -y
python -m pip install --upgrade pip
pip install setuptools wheel twine mypy pybind11
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload --verbose dist/*.tar.gz

0 comments on commit 1f6adea

Please sign in to comment.