丢 GitHub Action 拿 Pyinstaller 打包下就好,看 OP 描述应该不会有什么大坑。给个示例:
```
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'LICENSE'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'LICENSE'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
CI:
strategy:
matrix:
python-version: [ "3.10" ]
os-version: [ "macos-latest", "windows-latest", "ubuntu-20.04" ]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Build
run: |
pip install -r requirements.txt
pip install pyinstaller
python -m PyInstaller -F -n PKGName -i
__main__.py - name: upload
uses: actions/upload-artifact@v3
with:
name: PKGName-${{ matrix.os-version }}
path: dist
```