ci: 优化 GitHub Actions 工作流并更新文档

- 重命名工作流:手动构建可执行文件 -> 构建可执行文件
- 添加日期变量到可执行文件名称,提高版本区分度
- 更新工作流触发条件和权限设置
- 修改 README 中关于构建和发布的说明,增加 Actions 下载链接
- 更新英文 README 中的相关信息
This commit is contained in:
2025-02-27 19:00:04 +08:00
parent fca19144df
commit 86b5de6687
5 changed files with 13 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
name: 手动构建可执行文件
name: 构建可执行文件
on:
workflow_dispatch:
@@ -29,16 +29,18 @@ jobs:
- name: 构建 Win 可执行文件
if: runner.os == 'Windows'
run: |
echo "DATE=$(Get-Date -Format 'yyyyMMdd')" >> $env:GITHUB_ENV
pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
shell: pwsh
- name: 构建 Mac 可执行文件
if: runner.os == 'macOS'
run: |
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all emoji main.py
- name: 上传文件
uses: actions/upload-artifact@v4
with:
name: XHS-Downloader_${{ runner.os }}_${{ runner.arch }}
name: XHS-Downloader_${{ runner.os }}_${{ runner.arch }}_${{ env.DATE }}
path: dist/main/

View File

@@ -1,4 +1,4 @@
name: 手动构建并发布 Docker 镜像
name: 构建并发布 Docker 镜像
on:
workflow_dispatch:

View File

@@ -1,8 +1,8 @@
name: 发布构建可执行文件
name: 自动构建并发布可执行文件
on:
release:
types: [ created ]
types: [ published ]
permissions:
contents: write

View File

@@ -70,8 +70,8 @@
<p>如果仅需下载无水印作品文件,建议选择 <b>程序运行</b><b>Docker 运行</b>;如果有其他需求,建议选择 <b>源码运行</b></p>
<p><code>2.2</code> 版本开始,项目功能无异常的情况下,无需额外处理 Cookie</p>
<h2>🖱 程序运行</h2>
<p>⭐ Mac OS、Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> 下载程序压缩包,解压后打开程序文件夹,双击运行 <code>main</code> 即可使用。</p>
<p>⭐ 本项目包含动构建可执行文件的 GitHub Actions使用者可以随时使用 GitHub Actions 将最新源码构建为可执行文件!</p>
<p>⭐ Mac OS、Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> 或者 <a href="https://github.com/JoeanAmier/XHS-Downloader/actions">Actions</a> 下载程序压缩包,解压后打开程序文件夹,双击运行 <code>main</code> 即可使用。</p>
<p>⭐ 本项目包含动构建可执行文件的 GitHub Actions使用者可以随时使用 GitHub Actions 将最新源码构建为可执行文件!</p>
<p><strong>注意Mac OS 平台可执行文件 <code>main</code> 可能需要从终端命令行启动受设备限制Mac OS 平台可执行文件尚未经过测试,无法保证可用性!</strong></p>
<p>若通过此方式使用程序,文件默认下载路径为:<code>.\_internal\Download</code>;配置文件路径为:<code>.\_internal\settings.json</code></p>
<h2>⌨️ Docker 运行</h2>
@@ -433,7 +433,7 @@ async def example():
### 3. 手动触发打包流程
1. 在您 Fork 的仓库中,点击顶部的 **Actions** 选项卡
2. 找到名为 **手动构建可执行文件** 的工作流
2. 找到名为 **构建可执行文件** 的工作流
3. 点击右侧的 **Run workflow** 按钮:
- 选择 **master** 或者 **develop** 分支
- 点击 **Run workflow**

View File

@@ -71,8 +71,8 @@
<p>If you only need to download watermark-free works files, it is recommended to choose <b>Program Run</b>; if you have other needs, it is recommended to choose <b>Source Code Run</b>!</p>
<p>Starting from version <code>2.2</code>, if there are no abnormalities in project functionality, there is no need to handle cookies separately!</p>
<h2>🖱 Program Run</h2>
<p>⭐ Mac OS, Windows 10 and above users can go to <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> to download the program package, unzip it, open the program folder, and double-click to run <code>main</code> to use.</p>
<p>⭐ This project includes GitHub Actions for manually building executable files. Users can use GitHub Actions to build the latest source code into executable files at any time!</p>
<p>⭐ Mac OS, Windows 10 and above users can go to <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> or <a href="https://github.com/JoeanAmier/XHS-Downloader/actions">Actions</a> to download the program package, unzip it, open the program folder, and double-click to run <code>main</code> to use.</p>
<p>⭐ This project includes GitHub Actions for automatic building executable files. Users can use GitHub Actions to build the latest source code into executable files at any time!</p>
<p><strong>Note: The executable file <code>main</code> for Mac OS may need to be launched from the terminal command line; Due to device limitations, the Mac OS executable file has not been tested and its availability cannot be guaranteed!</strong></p>
<p>If you use the program in this way, the default download path for files is: <code>.\_internal\Download</code>; the configuration file path is: <code>.\_internal\settings.json</code></p>
<h2>⌨️ Docker Run</h2>
@@ -456,7 +456,7 @@ the program based on the latest source code!
### 3. Manually Trigger the Build Process
1. In your forked repository, click the **Actions** tab at the top
2. Find the workflow named **Manual Build of Executable File**
2. Find the workflow named **构建可执行文件**
3. Click the **Run workflow** button on the right:
- Select the **master** or **develop** branch
- Click **Run workflow**