fix: 修复空文件下载时 FileAlreadyExistsException 和 WebdavProtocol 调试代码遗留问题 + 添加 GitHub Actions 工作流#4
Closed
creeperCN wants to merge 1 commit intoBalloonUpdate:mainfrom
Closed
Conversation
新增两个工作流: 1. build.yml - 自动构建 - 推送到 main/master 分支时自动触发 - PR 到 main/master 分支时自动触发 - 构建完成后上传 artifact 保留 7 天 2. manual-release.yml - 手动发布 - 手动触发,可输入版本号 - 可选择是否为预发布版本或草稿 - 自动创建 Git tag 并发布 Release - 自动生成 changelog
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题概述
本次 PR 修复了两个关键 Bug,并新增了两个 GitHub Actions 工作流:
问题 1: FileAlreadyExistsException 导致程序崩溃
文件位置:
Work.java:438-444问题描述:
当下载空文件时,如果临时文件已存在(上次更新中断残留),
Files.createFile()会抛出FileAlreadyExistsException,导致整个更新过程崩溃。错误日志:
修复方案:
创建空文件前,先检查临时文件是否存在,如果存在则先删除再创建。
问题 2: WebdavProtocol 调试代码遗留导致协议无法使用
文件位置:
WebdavProtocol.java:137-141问题描述:
代码中遗留了调试代码,条件
desc.length() > -999永远为 true,导致 Webdav 协议下载文件时必定抛出异常,Webdav 协议完全无法使用。修复方案:
删除遗留的调试代码。
新增: GitHub Actions 工作流
1. build.yml - 自动构建
2. manual-release.yml - 手动发布
测试
./gradlew shadowJar)修改文件
Work.javaWebdavProtocol.java.github/workflows/build.yml.github/workflows/manual-release.yml