Skip to content

Commit

Permalink
chore: Update workflow 文件
Browse files Browse the repository at this point in the history
  • Loading branch information
freeok committed Mar 30, 2024
1 parent 443351b commit 4f84376
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 38 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Releases

# 触发条件:git tag
#on:
# push:
# tags:
# - 'v*'
on: workflow_dispatch
on:
push:
tags:
- 'v*'
#on: workflow_dispatch

jobs:
release-windows:
Expand All @@ -27,16 +27,14 @@ jobs:
uses: ncipollo/release-action@v1
with:
# 供用户下载使用的最终产物
artifacts: "dist/SoNovel-Portable.tar.gz"
artifacts: "dist/SoNovel_win.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}

# release-linux:
# # 运行环境
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# # 拉取项目代码
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set up JDK and Maven
Expand All @@ -56,6 +54,5 @@ jobs:
# - name: Create Release
# uses: ncipollo/release-action@v1
# with:
# # 供用户下载使用的最终产物
# artifacts: "app-linux.tar.gz"
# artifacts: "dist/SoNovel_linux.tar.gz"
# token: ${{ secrets.GITHUB_TOKEN }}
31 changes: 17 additions & 14 deletions deploy-linux.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# 测试通过

rm -rf dist

mvn clean package "-DskipTests"

cd target
mkdir tmp
mv app-jar-with-dependencies.jar tmp
mv classes tmp
pwd
ls
cd ..
pwd
ls
mkdir target/jpackage
mv target/app-jar-with-dependencies.jar target/jpackage

# 在 linux 环境会转换为 .deb 文件
# type=app-image 记得去掉--about-url
jpackage \
--name "So Novel" \
--input "target/tmp" \
--name "SoNovel" \
--input "target/jpackage" \
--dest dist \
--icon assets/logo.ico \
--app-version 1.5.1 \
--app-version 1.5.3 \
--copyright "Copyright (C) 2024 pcdd. All rights reserved." \
--description "开源搜书神器" \
--vendor "github.com/pcdd-group" \
--about-url "github.com/pcdd-group/so-novel" \
--main-jar app-jar-with-dependencies.jar
--main-jar "app-jar-with-dependencies.jar"

cp config.ini dist/SoNovel
rm dist/SoNovel/*.ico

tar -zcvf app.tar.gz dist
echo "开始打包压缩"
tar czvf dist/SoNovel_linux.tar.gz dist/SoNovel
51 changes: 37 additions & 14 deletions deploy-windows.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
mvn clean package "-DskipTests"

cd target
mkdir tmp
mv app-jar-with-dependencies.jar tmp
mv classes tmp
cd ..
mkdir target/jpackage
mv target/app-jar-with-dependencies.jar target/jpackage

cd target/jpackage
pwd
ls
cd ../..
pwd

echo $PSVersionTable.PSVersion
jpackage --version
echo "开始构建exe"
# app-image 表示免安装版,部分参数不支持
#jpackage --name "SoNovel" --type "app-image" --win-console --input "target/tmp" --dest dist --icon assets/logo.ico --app-version 1.5.1 --copyright "Copyright (C) 2024 pcdd. All rights reserved." --description "开源搜书神器" --vendor "github.com/pcdd-group" --main-jar "app-jar-with-dependencies.jar"
jpackage --name "SoNovel" --type "app-image" --input "target/tmp" --dest dist --icon assets/logo.ico --app-version 1.5.1 --copyright "Copyright (C) 2024 pcdd. All rights reserved." --description "开源搜书神器" --vendor "github.com/pcdd-group" --main-jar "app-jar-with-dependencies.jar --win-console"
echo "开始压缩 zip"
tar czvf dist/SoNovel-Portable.tar.gz dist/SoNovel
jpackage --name "SoNovel" --type "app-image" --input "target/jpackage" --dest dist --icon assets/logo.ico --app-version 1.5.3 --copyright "Copyright (C) 2024 pcdd. All rights reserved." --description "开源搜书神器" --vendor "github.com/pcdd-group" --main-jar "app-jar-with-dependencies.jar" --win-console

cp config.ini dist/SoNovel
rm dist/SoNovel/*.ico

echo "开始打包压缩"
tar czvf dist/SoNovel_win.tar.gz dist/SoNovel

pwd
cd dist/SoNovel
ls

# powershell 压缩为 zip
#Compress-Archive -Path dist\SoNovel -DestinationPath dist\SoNovel-Portable.zip
Expand All @@ -30,17 +38,32 @@ tar czvf dist/SoNovel-Portable.tar.gz dist/SoNovel
# --about-url 应用程序主页的 URL
# 参数有 : 是非法字符,放在尾行

# app-image 表示免安装版,部分参数不支持
#jpackage \
#--name "SoNovel" \
#--type "app-image" \
#--win-console \
#--input "target/tmp" \
#--dest dist \
#--icon assets/logo.ico \
#--app-version 1.5.3 \
#--copyright "Copyright (C) 2024 pcdd. All rights reserved." \
#--description "开源搜书神器" \
#--vendor "github.com/pcdd-group" \
#--main-jar "app-jar-with-dependencies.jar"


# msi 表示安装版
#jpackage `
#--type "msi" `
#--name "So Novel" `
#--name "SoNovel" `
#--input "target/tmp" `
#--dest dist `
#--icon assets/logo.ico `
#--app-version 1.5.1 `
#--app-version 1.5.3 `
#--copyright "Copyright (C) 2024 pcdd. All rights reserved." `
#--description "开源搜书神器" `
#--install-dir "So Novel" `
#--install-dir "SoNovel" `
#--win-console `
#--win-dir-chooser `
#--win-shortcut `
Expand Down

0 comments on commit 4f84376

Please sign in to comment.