Skip to content

Build and Upload Python Package #13

Build and Upload Python Package

Build and Upload Python Package #13

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy-unix:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "ubuntu-latest"
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest setuptools wheel twine
- name: Run tests
run: pytest .
- name: Build and publish
run: |
python setup.py sdist
twine upload --skip-existing dist/*
deploy-windows-pip:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "windows-latest"
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest setuptools wheel twine
- name: Run tests
run: pytest .
- name: Build and publish
run: |
python setup.py bdist_wheel
twine upload --skip-existing dist/*