autoci.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: auto CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. schedule:
  8. - cron: "0 2 * * 1-5"
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Set up Python 3.8
  15. uses: actions/setup-python@v2
  16. with:
  17. python-version: 3.8
  18. - name: Install dependencies
  19. run: |
  20. python -m pip install --upgrade pip
  21. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  22. - uses: actions/cache@v1
  23. if: startsWith(runner.os, 'Linux')
  24. with:
  25. path: ~/.cache/pip
  26. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  27. restore-keys: |
  28. ${{ runner.os }}-pip-
  29. - name: Update Deny Host
  30. run: |
  31. pwd
  32. python cmd/refresh.py
  33. - name: Push to built branch
  34. uses: Automattic/action-commit-to-branch@master
  35. with:
  36. branch: 'master'
  37. commit_message: 'Update Host'
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. - name: Publish distribution 📦 to Test PyPI
  41. uses: pypa/gh-action-pypi-publish@master
  42. with:
  43. user: __token__
  44. password: ${{ secrets.test_pypi_password }}
  45. repository_url: https://test.pypi.org/legacy/
  46. - name: Publish distribution 📦 to PyPI
  47. if: startsWith(github.event.ref, 'refs/tags')
  48. uses: pypa/gh-action-pypi-publish@master
  49. with:
  50. user: __token__
  51. password: ${{ secrets.pypi_password }}