Skip to content

chore: add repo_token #31

chore: add repo_token

chore: add repo_token #31

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: 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\onnxruntime\capi\onnxruntime_providers_shared.dll;onnxruntime\capi" --hidden-import=scipy.special._cdflib
- 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
- 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: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GAYHUB_TOKEN }}"
title: 黑月无人驾驶 ${{ github.ref_name }}
files: |
./dist/Auto_Resonance_${{ github.ref_name }}.zip
prerelease: true