Skip to content

Publish to PyPI

Publish to PyPI #38

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name : Print GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine mkdocs
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
echo Running in $PWD
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build docs
run: |
mkdocs build
mv site ../site
git fetch --all
git checkout gh-pages -f
cp -r ../site/* .
- name: Deploy Docs
uses: EndBug/add-and-commit@v7
with:
message: 'Updated documentation'
add: "."
branch: gh-pages