修复无法使用热键关闭程序的问题 #9
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: Buildup Test | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: # 允许手动触发工作流 | |
jobs: | |
build-main-files: | |
runs-on: windows-latest # 使用最新的 Windows 运行器 | |
steps: | |
# 检出仓库代码 | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# 设置 Python 3.11 环境 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# 安装依赖和 Nuitka | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
python --version | |
shell: cmd | |
# 进行编译 | |
- name: Run Compile | |
run: | | |
python -m nuitka --windows-file-version=0.0.0.0 --show-progress --mingw64 --assume-yes-for-downloads --output-dir=out main/Boss-Key.py | |
# 添加版本信息到可执行文件并重命名 | |
- name: Add version information and rename executable | |
shell: pwsh | |
run: | | |
# 获取标签名作为版本号,去除前缀 refs/tags/ | |
$tag = 'Build-Test' | |
# 定义新的文件名 | |
$newExeName = "Boss-Key-$tag-onefile.exe" | |
# 重命名可执行文件 | |
Rename-Item "out/Boss-Key.exe" $newExeName | |
# 压缩out/Boss-Key.dist/文件夹 | |
Compress-Archive -Path "out/Boss-Key.dist" -DestinationPath "out/Boss-Key-$tag-multifile.zip" | |
ls out | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Build-Test-Build | |
path: | | |
out/Boss-Key.dist | |
deploy-test: | |
environment: | |
name: buildup-test | |
runs-on: windows-2022 | |
needs: build-main-files | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Build-Test-Build | |
path: ./test | |
- name: Test Main Files | |
run: | | |
cd ./test | |
dir | |
./Boss-Key.exe | |
compile-to-installer: | |
runs-on: windows-latest | |
needs: deploy-test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Clone Repo | |
run: | | |
cd ./.github/inno-script | |
git clone https://github.com/IvanHanloth/innosetup-action.git | |
cp -r innosetup-action/* . | |
dir | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Build-Test-Build | |
path: ./.github/inno-script/software | |
- name: Compile Installer | |
run: | | |
dir | |
.\ISCC.exe /DMyAppVersion='Build-Test' Boss-Key.iss | |
working-directory: .github/inno-script | |
- name: Upload Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Boss-Key-Installer | |
path: .github/inno-script/output/Boss-Key-Build-Test-Installer.exe |