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.4 KiB

3 years ago
3 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: '12.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. poetry build
  44. working-directory: ./backend
  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: ./backend/dist/