build-windows.yml 799 B

1234567891011121314151617181920212223242526272829303132333435
  1. name: Build Windows EXE
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. workflow_dispatch:
  7. jobs:
  8. build-windows:
  9. runs-on: windows-latest
  10. steps:
  11. - name: Checkout code
  12. uses: actions/checkout@v4
  13. - name: Set up Python
  14. uses: actions/setup-python@v5
  15. with:
  16. python-version: '3.11'
  17. - name: Install dependencies
  18. run: |
  19. python -m pip install --upgrade pip
  20. pip install -r requirements.txt
  21. - name: Build EXE
  22. run: |
  23. pyinstaller --onefile --console --name "沪武档案同步玄海" --collect-all mysql.connector --clean sync_measure_data.py
  24. - name: Upload artifact
  25. uses: actions/upload-artifact@v4
  26. with:
  27. name: windows-exe
  28. path: dist/
  29. retention-days: 30