Skip to content

Commit

Permalink
chore: 新增一种 Release Assets
Browse files Browse the repository at this point in the history
  • Loading branch information
freeok committed Mar 31, 2024
1 parent f3e94e5 commit 1b17b08
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release-launch4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
java-version: '17'
- name: Build executable
shell: powershell
run: sh bin/deploy.sh
run: |
sh bin/deploy.sh
sh bin/deploy.sh jre
- name: Create Release
uses: ncipollo/release-action@v1
with:
# 供用户使用的最终产物
artifacts: "target/SoNovel_win.tar.gz"
# 表示要上传到 Release 的产出文件。这可能是单个路径或以逗号分隔的路径列表(或 globs)
artifacts: "target/sonovel-win.tar.gz,target/sonovel-win-with-jre.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 17 additions & 2 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# launch4j-maven-plugin 仅支持 windows

# 定义 Maven 命令并保存到变量中
maven_command=""
artifacts=""
# 根据传入的参数执行不同的操作
if [ "$1" == "jre" ]; then
maven_command="mvn clean package -DskipTests -DjrePath=runtime"
artifacts="sonovel-win-with-jre.tar.gz"
else
maven_command="mvn clean package -DskipTests"
artifacts="sonovel-win.tar.gz"
fi

# 项目根目录,根据当前文件所在路径获取相对路径
project_path=$(
cd "$(dirname "$0")" || exit
Expand All @@ -8,8 +20,11 @@ project_path=$(
)
cd "$project_path" || exit

mvn clean package "-DskipTests"
$maven_command
cp config.ini target/SoNovel
if [ "$1" == "jre" ]; then
cp input/*.txt input/*.rar target/SoNovel
fi

cd target
tar czvf SoNovel_win.tar.gz SoNovel
tar czvf $artifacts SoNovel
Binary file added input/jdk-17.0.10+7-jre.rar
Binary file not shown.
9 changes: 9 additions & 0 deletions input/使用说明.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
若有压缩文件,则需要先解压

若无压缩文件,则说明您下载的是无 JRE 版本,默认您已安装了 JDK 或 JRE

然后运行 exe 文件

提示:
1. config.ini 是配置文件,下载格式在此修改,保存后重新运行 exe 文件才能生效
2. 请按照要求输入内容,若不按要求输入则无法正常工作

0 comments on commit 1b17b08

Please sign in to comment.