release.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: auto CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. os: [windows-latest]
  12. include:
  13. - os: ubuntu-latest
  14. path: ~/.cache/pip
  15. - os: macos-latest
  16. path: ~/Library/Caches/pip
  17. - os: windows-latest
  18. path: ~\AppData\Local\pip\Cache
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/checkout@v2
  22. - name: Set up Python 3.8
  23. id: setup-python
  24. uses: actions/setup-python@v2
  25. with:
  26. python-version: 3.8
  27. - uses: actions/cache@v2
  28. with:
  29. path: ${{ matrix.path }}
  30. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  31. restore-keys: |
  32. ${{ runner.os }}-pip-
  33. - uses: actions/cache@v2
  34. with:
  35. path: ~/.local/share/virtualenvs
  36. key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
  37. - name: Install dependencies
  38. run: |
  39. python -m pip install --upgrade pip
  40. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  41. - name: build exe
  42. run: |
  43. pip install pyinstaller
  44. pyinstaller -D crawl_ouchn.spec
  45. - name: Publish distribution 📦 to Test PyPI
  46. uses: pypa/gh-action-pypi-publish@master
  47. with:
  48. user: __token__
  49. password: ${{ secrets.test_pypi_password }}
  50. repository_url: https://test.pypi.org/legacy/
  51. - name: Publish distribution 📦 to PyPI
  52. if: startsWith(github.event.ref, 'refs/tags')
  53. uses: pypa/gh-action-pypi-publish@master
  54. with:
  55. user: __token__
  56. password: ${{ secrets.pypi_password }}