-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(deps): 添加 GitHub Action 的依赖更新 * chore(dir): 整理目录 * feat: 发布时自动修改版本号 * chore(dir): 整理目录 * chore(git): 更新 .gitignore * feat: 为开发者打包脚本添加可选参数 示例: python DEV-PACK.py src ico.ico src\log -s * fix: 修复参数检查逻辑以确保正确的参数数量 * feat: 自动打包发行版工作流 * chore(license): 更新许可文件 * Apply suggestions from code review Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> * fix: 还原 resource.rc * chore(license): 更新安装程序许可文件 * Apply suggestions from code review Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> * fix: 改用 Clang 编译 Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * fix: 修改 \ 为 / * Apply suggestions from code review Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * fix: 修正日志写入 * fix: 修正编码问题 * pref: 打包 C++ 文件时输出详细过程 Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * fix: 不接受带 v 的新版本号 Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> * fix: 移除重复的条目 Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * fix: 修改工件名 Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * Apply suggestions from code review Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * fix: 清理安装程序版工作目录 Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> * fix: 先下载中文翻译 Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> * Apply suggestions from code review Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com> --------- Co-authored-by: 宁静致远 <172552290+fjwxzde@users.noreply.github.com> Co-authored-by: 鸭鸭「カモ」 <Yzcbs123@163.com>
- Loading branch information
1 parent
3fefcc4
commit 85502e7
Showing
122 changed files
with
561 additions
and
60 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Pack Releases | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 版本号 (不带v) | ||
required: true | ||
|
||
jobs: | ||
auto-pack-releases: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: 检出代码 | ||
uses: actions/checkout@v4 | ||
|
||
- name: 配置 Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: 安装依赖 | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
# 环境配置的依赖文件中含有打包所需依赖 | ||
run: | | ||
pip install -r "src/环境配置/requirements.txt" | ||
pip list | ||
echo =================UPX==================== | ||
$upx_url = (Invoke-WebRequest -Uri https://api.github.com/repos/upx/upx/releases/latest).Content | ConvertFrom-Json | Select-Object -ExpandProperty assets | Where-Object { $_.name -like "*win64.zip" } | Select-Object -ExpandProperty browser_download_url | ||
Write-Host "[INFO] Latest UPX download URL: $upx_url" | ||
Invoke-WebRequest -Uri $upx_url -OutFile "upx-latest.zip" | ||
7z x "upx-latest.zip" -o"." | ||
del "upx-latest.zip" | ||
tree /a /f | ||
- name: 复制许可文件 | ||
run: | | ||
Copy-Item -Path "LICENSE" -Destination "src/LICENSE" -Verbose | ||
- name: 移除Git文件 | ||
run: | | ||
Remove-Item -Path "src/Tools/【实验性工具】/定时闹钟/铃声文件/.gitkeep" -Verbose | ||
Remove-Item -Path "src/Tools/进制转换/进制转换(旧).cxx" -Verbose | ||
Remove-Item -Path "src/Tools/WSA小工具(终止更新)" -Recurse -Verbose | ||
- name: 打包 C++ 文件 | ||
run: | | ||
windres "src/resource.rc" -o "src/resource.o" -v | ||
# Tools/创建文件 | ||
clang++ "src/Tools/创建文件/创建文件.cxx" "src/resource.o" -o "src/Tools/创建文件/创建文件.exe" -finput-charset=UTF-8 -fexec-charset=UTF-8 -v | ||
Remove-Item -Path "src/Tools/创建文件/创建文件.cxx" -Verbose | ||
# Tools/字母大小写互换 | ||
clang++ "src/Tools/字母大小写互换/字母大小写互换.cxx" "src/resource.o" -o "src/Tools/字母大小写互换/字母大小写互换.exe" -finput-charset=UTF-8 -fexec-charset=UTF-8 -v | ||
Remove-Item -Path "src/Tools/字母大小写互换/字母大小写互换.cxx" -Verbose | ||
# Tools/摩斯密码 | ||
Copy-Item -Path "src/Tools/摩斯密码/源码/编码源码.cxx" -Destination "src/Tools/摩斯密码/编码.cxx" -Verbose | ||
Copy-Item -Path "src/Tools/摩斯密码/源码/解码源码.cxx" -Destination "src/Tools/摩斯密码/解码.cxx" -Verbose | ||
Remove-Item -Path "src/Tools/摩斯密码/源码" -Recurse -Verbose | ||
clang++ "src/Tools/摩斯密码/编码.cxx" "src/resource.o" -o "src/Tools/摩斯密码/编码.exe" -finput-charset=UTF-8 -fexec-charset=UTF-8 -v | ||
clang++ "src/Tools/摩斯密码/解码.cxx" "src/resource.o" -o "src/Tools/摩斯密码/解码.exe" -finput-charset=UTF-8 -fexec-charset=UTF-8 -v | ||
Remove-Item -Path "src/Tools/摩斯密码/编码.cxx" -Verbose | ||
Remove-Item -Path "src/Tools/摩斯密码/解码.cxx" -Verbose | ||
# 移除资源文件 | ||
Remove-Item -Path "src/resource.rc" -Verbose | ||
Remove-Item -Path "src/resource.o" -Verbose | ||
- name: 构建 lite 版 | ||
# 整理文件 > 压缩文件 > 清理工作目录 | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
run: | | ||
Copy-Item -Path "src" -Destination "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite" -Recurse -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/芙芙工具箱(for安装程序).pyw" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/芙芙工具箱(for打包).pyw" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/Tools/【实验性工具】/hosts修改/调用(For-打包版).py" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/Tools/休息一下/自启动设置(For-打包版).py" -Verbose | ||
# 更新版本号 | ||
python "自动化脚本/修改版本号.py" "${{ github.event.inputs.version }}" "lite" "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite" | ||
# 压缩为 zip | ||
7z a -tzip "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite.zip" "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/*" | ||
# 压缩为 7z | ||
7z a -t7z "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite.7z" "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite/*" | ||
# 清理工作目录 | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-lite" -Recurse -Verbose | ||
- name: 构建打包版与安装程序版 | ||
# 顺便为安装程序版一起打包,打包完复制一份 | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
run: | | ||
Copy-Item -Path "src" -Destination "Release/Fufu_Tools.v${{ github.event.inputs.version }}" -Recurse -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/芙芙工具箱.pyw" -Verbose | ||
Rename-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/芙芙工具箱(for打包).pyw" -NewName "芙芙工具箱.pyw" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/Tools/【实验性工具】/hosts修改/调用.py" -Verbose | ||
Rename-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/Tools/【实验性工具】/hosts修改/调用(For-打包版).py" -NewName "调用.py" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/Tools/休息一下/自启动设置.py" -Verbose | ||
Rename-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/Tools/休息一下/自启动设置(For-打包版).py" -NewName "自启动设置.py" -Verbose | ||
python "DEV-PACK.py" "Release/Fufu_Tools.v${{ github.event.inputs.version }}" "src/ico.ico" "Release/logs/pack-exe" -s | ||
# 分离安装程序版 | ||
Copy-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}" -Destination "Release/Fufu_Tools.v${{ github.event.inputs.version }}-exe" -Recurse -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}/芙芙工具箱(for安装程序).exe" -Verbose | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-exe/芙芙工具箱.exe" -Verbose | ||
Rename-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-exe/芙芙工具箱(for安装程序).exe" -NewName "芙芙工具箱.exe" -Verbose | ||
# 更新版本号 - 分离完后再更新版本号,如果后续有修改需要打包的文件的版本号,请在运行 DEV-PACK.py 之前更新版本号 | ||
python "自动化脚本/修改版本号.py" "${{ github.event.inputs.version }}" "pack" "Release/Fufu_Tools.v${{ github.event.inputs.version }}" | ||
python "自动化脚本/修改版本号.py" "${{ github.event.inputs.version }}" "exe" "Release/Fufu_Tools.v${{ github.event.inputs.version }}-exe" | ||
# 压缩为 zip - 打包版 | ||
7z a -tzip "Release/Fufu_Tools.v${{ github.event.inputs.version }}.zip" "Release/Fufu_Tools.v${{ github.event.inputs.version }}/*" | ||
# 压缩为 7z - 打包版 | ||
7z a -t7z "Release/Fufu_Tools.v${{ github.event.inputs.version }}.7z" "Release/Fufu_Tools.v${{ github.event.inputs.version }}/*" | ||
# 压缩为 7z - 压缩等级 9 - 极限压缩 - 打包版 | ||
7z a -t7z -mx9 "Release/Fufu_Tools.v${{ github.event.inputs.version }}-Extreme_compression.7z" "Release/Fufu_Tools.v${{ github.event.inputs.version }}/*" | ||
# 清理工作目录 - 打包版 | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}" -Recurse -Verbose | ||
# 编译安装程序 - 安装程序版 | ||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl" | ||
iscc "Installer/Installer.iss" | ||
# 清理工作目录 - 安装程序版 | ||
Remove-Item -Path "Release/Fufu_Tools.v${{ github.event.inputs.version }}-exe" -Recurse -Verbose | ||
- name: 上传构建文件 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Release | ||
path: Release/** |
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
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[Setup] | ||
AppName=芙芙工具箱 | ||
AppVersion=develop | ||
VersionInfoVersion=develop | ||
AppPublisher=DuckStudio | ||
VersionInfoCopyright=Copyright (c) 鸭鸭「カモ」 | ||
AppPublisherURL=https://duckduckstudio.github.io/yazicbs.github.io/ | ||
AppSupportURL=https://github.com/DuckDuckStudio/Fufu_Tools/issues | ||
DefaultDirName={autopf}\Fufu_Tools | ||
DefaultGroupName=芙芙工具箱 | ||
OutputDir=..\Release | ||
OutputBaseFilename=Fufu_Tools_Setup.vdevelop.exe | ||
SetupIconFile=Fufu_Tools_Setup_ico.ico | ||
LicenseFile=LICENSE | ||
Compression=lzma2 | ||
SolidCompression=yes | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" | ||
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
|
||
[Files] | ||
Source: "..\Release\Fufu_Tools.vdevelop-exe\*"; DestDir: "{app}"; Flags: recursesubdirs | ||
; 这里的 v 不要去掉,替换版本号时不会替换 v | ||
|
||
[Icons] | ||
Name: "{autoprograms}\芙芙工具箱"; Filename: "{app}\芙芙工具箱.exe" | ||
Name: "{autodesktop}\芙芙工具箱"; Filename: "{app}\芙芙工具箱.exe"; Tasks: desktopicon |
Oops, something went wrong.