pyinstall_package.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. - name: Set Up Python
  24. uses: actions/setup-python@v5
  25. with:
  26. python-version: '3.9'
  27. cache: pip
  28. cache-dependency-path: '**/requirements*.txt'
  29. - name: Install Dependencies
  30. run: |
  31. python -m pip install --upgrade pip wheel setuptools
  32. pip install -r requirements.txt
  33. python -m pip install pyinstaller
  34. - name: Build Package
  35. run: |
  36. python -m PyInstaller -F -c -i favicon.ico --name crawl_github main.py
  37. # - name: Upload binary
  38. # uses: actions/upload-artifact@v4
  39. # with:
  40. # name: crawl-tool-${{ steps.get_version.outputs.hash }}
  41. # path: |
  42. # dist/
  43. # *.spec
  44. - name: Upload to ali oss
  45. uses: yizhoumo/setup-ossutil@v1
  46. with:
  47. endpoint: oss-cn-qingdao.aliyuncs.com
  48. access-key-id: ${{ secrets.OSS_KEY_ID }}
  49. access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
  50. - name: Upload files to backblaze
  51. uses: jakejarvis/backblaze-b2-action@master
  52. env:
  53. SOURCE_DIR: './dist'
  54. B2_BUCKET: ${{ secrets.B2_BUCKET }}
  55. B2_APPKEY_ID: ${{ secrets.B2_APPKEY_ID }}
  56. B2_APPKEY: ${{ secrets.B2_APPKEY }}
  57. - name: cp files to aliyun
  58. run: |
  59. ossutil cp -rf dist/ oss://yoqi-software/develop/crawl_github/${{ steps.get_version.outputs.date }}-${{ steps.get_version.outputs.hash }}/