Upload Python Package #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Python Package | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: run black | |
uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
jupyter: false | |
src: "./pydit" | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11.0" | |
- name: Install poetry and basic tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Install dependencies | |
run: | | |
python -m poetry install | |
- name: Run tests | |
run: | | |
python -m poetry run python -m pytest -sxv | |
- name: Build docs | |
run: | | |
python -m poetry run sphinx-build ./docs/source ./docs/build -a | |
- name: Build and publish | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry publish --build |