Skip to content

fix: ci

fix: ci #10

Workflow file for this run

name: Build & Release App
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
with:
submodules: "false"
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
# 步骤3:安装依赖
- name: Pip Install
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt pyinstaller
- name: Generate program
shell: pwsh
run: |
$SITE_PACKAGES = python -c "import site; print(site.getsitepackages()[0])"
pyinstaller -D --distpath .\dist\ -i app\resource\images\logo.ico -n heiyue gui.py -y -w --add-data "$SITE_PACKAGES\lib\site-packages\cnocr\label_cn.txt;cnocr" --add-data "$SITE_PACKAGES\lib\site-packages\onnxruntime\capi\onnxruntime_providers_shared.dll;onnxruntime\capi" --hidden-import=scipy.special._cdflib
- name: Move assets to dist directory
run: |
Copy-Item -Path ".\app\resource\" -Destination ".\dist\heiyue\app\resource\" -Recurse -Force
Copy-Item -Path ".\README.md" -Destination ".\dist\heiyue\" -Force
- name: Create zip archive
if: startsWith(github.ref, 'refs/tags/')
run: |
Rename-Item -Path .\dist\heiyue -NewName 黑月无人驾驶_${{ github.ref_name }}
Compress-Archive -Path .\dist\黑月无人驾驶_${{ github.ref_name }}\ -DestinationPath .\dist\黑月无人驾驶_${{ github.ref_name }}.zip -Force
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2.0.4
with:
name: 黑月无人驾驶 ${{ github.ref_name }}
files: |
./dist/黑月无人驾驶_${{ github.ref_name }}.zip
prerelease: true