You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

4 years ago
  1. name: Upload Python Package
  2. on:
  3. release:
  4. types: [created]
  5. jobs:
  6. deploy:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v2
  10. - name: Preparation
  11. run: |
  12. mkdir backend/client
  13. - name: Fix up git URLs
  14. run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
  15. - name: Use Node.js
  16. uses: actions/setup-node@v1
  17. with:
  18. node-version: '16.x'
  19. - name: Build with Node.js
  20. run: |
  21. yarn install
  22. yarn build
  23. cp -r dist ../backend/client/
  24. working-directory: ./frontend
  25. env:
  26. PUBLIC_PATH: '/static/_nuxt/'
  27. - name: Setup Python 3.8
  28. uses: actions/setup-python@v2
  29. with:
  30. python-version: 3.8
  31. - name: Install dependencies
  32. run: |
  33. python -m pip install --upgrade pip
  34. pip install poetry poetry-dynamic-versioning
  35. poetry install
  36. working-directory: ./backend
  37. - name: collectstatic
  38. run: |
  39. poetry run task collectstatic
  40. working-directory: ./backend
  41. - name: Build a binary wheel and a source tarball
  42. run: |
  43. sed -e "s/, from = \"..\"//g" backend/pyproject.toml > pyproject.toml
  44. poetry build
  45. - name: Publish a Python distribution to PyPI
  46. uses: pypa/gh-action-pypi-publish@master
  47. with:
  48. user: ${{ secrets.PYPI_USERNAME }}
  49. password: ${{ secrets.PYPI_PASSWORD }}
  50. packages_dir: ./dist/