Skip to content

Update python-package.yml #8

Update python-package.yml

Update python-package.yml #8

name: Build and Publish Python Package
on:
push:
branches: [ "Master" ]
pull_request:
branches: [ "Master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build wheel cmake setuptools_scm[toml]
python -m pip install --upgrade setuptools
- name: Build the package using pyproject.toml
run: python -m build --wheel --no-isolation
- name: Upload Package to PyPI
if: github.ref == 'refs/heads/Master' && github.event_name == 'push'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install twine
python -m twine upload --verbose dist/*