sync_repo.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Sync with mirror repo
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. repository_dispatch:
  7. jobs:
  8. sync:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@master
  13. - name: Set up Python 3.7
  14. uses: actions/setup-python@v1
  15. with:
  16. python-version: 3.7
  17. - name: Set up Node.js
  18. uses: actions/setup-node@v2
  19. with:
  20. node-version: '14'
  21. - name: Build frontend
  22. working-directory: ./webiojs
  23. run: |
  24. npm install
  25. gulp
  26. cp dist/pywebio.min.* ../pywebio/html/js
  27. - name: Build doc demos
  28. run: |
  29. pip3 install -e ".[all]"
  30. pip3 install -r requirements.txt
  31. cd docs && CODE_EXPORT_PATH=../demos/doc_demos make clean html
  32. - name: Set dev version
  33. run: python3 tools/build_dev_version.py
  34. - name: Push
  35. run: |
  36. git fetch --unshallow origin
  37. git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git"
  38. git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f'
  39. rm .gitignore
  40. git add pywebio/__version__.py
  41. git add pywebio/html/js
  42. git add demos/doc_demos
  43. git config user.email "${ALIYUN_GIT_USER}"
  44. git config user.name "${ALIYUN_GIT_USER}"
  45. git commit --amend --no-edit
  46. git push -f -u aliyun --tags || true
  47. git push -f -u aliyun || true
  48. env:
  49. ALIYUN_GIT_USER: ${{ secrets.ALIYUN_GIT_USER }}
  50. ALIYUN_GIT_PASSWORD: ${{ secrets.ALIYUN_GIT_PASSWORD }}