Skip to content

Build and upload to PyPI #14

Build and upload to PyPI

Build and upload to PyPI #14

Workflow file for this run

name: Build and upload to PyPI
on:
push:
branches:
- wheels
release:
types:
- published
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11"]
poetry-version: [1.8.3]
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- if: ${{ matrix.os == 'ubuntu-latest' }}
uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
publish:
name: Upload to PyPI
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.10, 3.11]
poetry-version: [1.8.3]
runs-on: ${{ matrix.os }}
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build