Browse Source

Add testing installation step

enhancement/pypi-publish-workflow
Hironsan 1 year ago
parent
commit
4fd75c59fa
2 changed files with 20 additions and 9 deletions
  1. 26
      .github/workflows/pypi-publish.yml
  2. 3
      backend/cli.py

26
.github/workflows/pypi-publish.yml

@ -1,8 +1,9 @@
name: Upload Python Package
on:
release:
types: [created]
# on:
# release:
# types: [created]
on: [push, pull_request]
jobs:
deploy:
@ -45,9 +46,16 @@ jobs:
run: |
sed -e "s/, from = \"..\"//g" backend/pyproject.toml > pyproject.toml
poetry build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: ./dist/
- name: Test installation
run: |
pip install dist/doccano*whl
doccano init
doccano createuser --username admin --password pass
doccano webserver &
sleep 10
# - name: Publish a Python distribution to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: ${{ secrets.PYPI_USERNAME }}
# password: ${{ secrets.PYPI_PASSWORD }}
# packages_dir: ./dist/

3
backend/cli.py

@ -89,6 +89,9 @@ def command_migrate(args):
def command_run_webserver(args):
import sys
sys.exit(1)
print(f"Starting server with port {args.port}.")
if is_windows():
run_on_windows(args)

Loading…
Cancel
Save