Publish to PyPI #38
Workflow file for this run
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: 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 |