diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 473cb19b..a41fd2bf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,11 @@ jobs: - uses: "actions/setup-python@v1" with: python-version: 3.7 - - name: "Publish" + - name: "Install dependencies" + run: "scripts/install" + - name: "Build package & docs" + run: "scripts/build" + - name: "Publish to PyPI & deploy docs" run: "scripts/publish" env: TWINE_USERNAME: __token__ diff --git a/mkdocs.yml b/mkdocs.yml index 92b922ca..f7e7815b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,5 +15,7 @@ nav: - Tests & Migrations: 'tests_and_migrations.md' markdown_extensions: + - mkautodoc - admonition - - codehilite + - pymdownx.highlight + - pymdownx.superfences diff --git a/requirements.txt b/requirements.txt index 0f22a025..6fa62599 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,3 +23,12 @@ pytest pytest-cov starlette requests + +# Documentation +mkdocs +mkdocs-material +mkautodoc + +# Packaging +twine +wheel diff --git a/scripts/build b/scripts/build new file mode 100755 index 00000000..1c47d2cc --- /dev/null +++ b/scripts/build @@ -0,0 +1,13 @@ +#!/bin/sh -e + +if [ -d 'venv' ] ; then + PREFIX="venv/bin/" +else + PREFIX="" +fi + +set -x + +${PREFIX}python setup.py sdist bdist_wheel +${PREFIX}twine check dist/* +${PREFIX}mkdocs build diff --git a/scripts/publish b/scripts/publish index 29a5da61..c1b56e3f 100755 --- a/scripts/publish +++ b/scripts/publish @@ -1,7 +1,6 @@ #!/bin/sh -e VERSION_FILE="databases/__init__.py" -PYTHONPATH=. if [ -d 'venv' ] ; then PREFIX="venv/bin/" @@ -23,7 +22,5 @@ fi set -x -${PREFIX}pip install twine wheel mkdocs mkdocs-material mkautodoc -${PREFIX}python setup.py sdist bdist_wheel ${PREFIX}twine upload dist/* ${PREFIX}mkdocs gh-deploy --force