Skip to content

Migrate from setuptools/pkg_resources to importlib #182

Migrate from setuptools/pkg_resources to importlib

Migrate from setuptools/pkg_resources to importlib #182

name: Build and upload to PyPI
on:
pull_request:
release:
types:
- published
jobs:
build_sdist_and_wheel:
name: Build sdist and wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v3
with:
path: dist/*
upload_pypi:
name: Upload to PyPI
needs: [build_sdist_and_wheel]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}