build.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: Publish Installers
  2. on:
  3. workflow_dispatch: ~
  4. push:
  5. branches: [master]
  6. tags: [v*]
  7. jobs:
  8. build:
  9. name: Build ${{ matrix.os }} Package
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. matrix:
  13. os: [windows-2019, ubuntu-20.04]
  14. steps:
  15. - name: Checkout Code
  16. uses: actions/checkout@v4
  17. - name: Set Release Version
  18. id: get_version
  19. shell: bash
  20. run: |
  21. echo "::set-output name=hash::$(git rev-parse --short HEAD)"
  22. echo "::set-output name=date::$(date +%Y%m%d)"
  23. echo "::set-output name=url::$(git remote get-url origin)"
  24. - name: Set Up Python
  25. uses: actions/setup-python@v4
  26. with:
  27. python-version: '3.12'
  28. cache: pip
  29. cache-dependency-path: '**/requirements*.txt'
  30. - name: Install Dependencies
  31. run: |
  32. python -m pip install --upgrade pip wheel setuptools poetry
  33. poetry config virtualenvs.in-project true
  34. poetry install
  35. - name: Build Package
  36. run: |
  37. poetry run python -m PyInstaller crawl_sse.spec
  38. - name: Update to ali oss
  39. uses: yizhoumo/setup-ossutil@v1
  40. with:
  41. endpoint: oss-cn-qingdao.aliyuncs.com
  42. access-key-id: ${{ secrets.OSS_KEY_ID }}
  43. access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
  44. - name: cp files to aliyun
  45. run: |
  46. ossutil cp -r dist/ oss://yoqi-software/develop/crawl_sse/${{ steps.get_version.outputs.date }}-${{ steps.get_version.outputs.hash }}/
  47. - uses: leafney/dingtalk-action@v1
  48. if: always()
  49. env:
  50. DINGTALK_ACCESS_TOKEN: ${{ secrets.DINGTALK_ACCESS_TOKEN }}
  51. with:
  52. msgtype: link
  53. title: 'crawl_sse build success'
  54. text: 'please download from aliyun oss. [git.yoqi.me]'
  55. msg_url: '${{ steps.get_version.outputs.url }}'