Merge pull request #89 from Night-stars-1:dev #74
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Release App | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Generate Changelog | |
id: generate_changelog | |
uses: Night-stars-1/changelog-generator-action@main | |
- 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: Set VERSION | |
run: echo "__version__='${{ github.ref_name }}'" > version.py | |
- 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\cnocr\label_number.txt;cnocr" --add-data "$SITE_PACKAGES\lib\site-packages\onnxruntime\capi\onnxruntime_providers_shared.dll;onnxruntime\capi" --hidden-import=scipy.special._cdflib | |
pyinstaller -F --distpath .\dist\updater -i app\resource\images\logo.ico -n "HeiYue Updater" updater.py -y | |
- name: Move assets to dist directory | |
run: | | |
Copy-Item -Path ".\actions\" -Destination ".\dist\heiyue\actions\" -Recurse -Force | |
Copy-Item -Path ".\resources\" -Destination ".\dist\heiyue\resources\" -Recurse -Force | |
Copy-Item -Path ".\app\resource\" -Destination ".\dist\heiyue\app\resource\" -Recurse -Force | |
Copy-Item -Path ".\README.md" -Destination ".\dist\heiyue\" -Force | |
Copy-Item -Path ".\dist\updater\HeiYue Updater.exe" -Destination ".\dist\heiyue\HeiYue Updater.exe" -Recurse -Force | |
- name: Create zip archive | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
Rename-Item -Path .\dist\heiyue -NewName Auto_Resonance_${{ github.ref_name }} | |
Compress-Archive -Path .\dist\Auto_Resonance_${{ github.ref_name }}\ -DestinationPath .\dist\Auto_Resonance_${{ 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 }} | |
body: ${{ steps.generate_changelog.outputs.changelog }} | |
files: | | |
./dist/Auto_Resonance_${{ github.ref_name }}.zip | |
make_latest: true |