Skip to content

Commit

Permalink
Add build step (encode#66)
Browse files Browse the repository at this point in the history
* Add build step

* Remove unneeded parts of build script

* Add packaging requirements, twine check
  • Loading branch information
tomchristie authored Apr 30, 2020
1 parent 5c04534 commit cfde059
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ jobs:
run: "scripts/install"
- name: "Run checks"
run: "scripts/check"
- name: "Build package & docs"
run: "scripts/build"
- name: "Run tests"
run: "scripts/test"
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ mkdocs
mkautodoc
mkdocs-material

# Packaging
twine
wheel

# Tests & Linting
pytest
pytest-asyncio
Expand Down
15 changes: 15 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -e

PYTHONPATH=.

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
2 changes: 0 additions & 2 deletions scripts/publish
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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

0 comments on commit cfde059

Please sign in to comment.