Skip to content

Commit

Permalink
Merge pull request #490 from PBH-BTN/master
Browse files Browse the repository at this point in the history
6.2.3 (6.2.2's hotfix)
  • Loading branch information
Ghost-chu authored Sep 16, 2024
2 parents 4b7db22 + f61322e commit 66a8e41
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
sed -i "s/<version>/${{ env.PBH_VERSION }}/g" pkg/deb/DEBIAN/control
cp target/PeerBanHelper.jar pkg/deb/usr/lib/peerbanhelper
mkdir -p pkg/deb/usr/lib/peerbanhelper
cp target/PeerBanHelper.jar pkg/deb/usr/lib/peerbanhelper/
cd pkg && dpkg -b deb PeerBanHelper_linux_${{ env.PBH_VERSION }}.deb
# 上面那个文件名需要符合收集条件
env:
Expand All @@ -30,4 +31,3 @@ jobs:
name: deb-dist
path: |
pkg/*.deb
4 changes: 2 additions & 2 deletions .github/workflows/build_installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
license: ${{ secrets.INSTALL4J_LICENSE }}
- name: Make installers
run: |
ls /opt/install4j/
/opt/install4j/bin/install4jc -L ${{ secrets.INSTALL4J_LICENSE }} -r ${{ steps.java_info.outputs.project_version }} -d target/media -D jarPath=target/PeerBanHelper.jar install4j/project.install4j
/opt/install4j/bin/install4jc -L ${{ secrets.INSTALL4J_LICENSE }} -r ${{ steps.java_info.outputs.project_version }} -g -d target/media -D jarPath=$(pwd)/target/PeerBanHelper.jar install4j/project.install4j
# jarPath=$(pwd) 是必须的,install4jc 不知道什么毛病,不支持相对路径,这太诡异了
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ jobs:
name: maven-dist
path: |
target/*.jar
target/media/*.exe
id: project
2 changes: 1 addition & 1 deletion .github/workflows/jvm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-CI
file: ./Dockerfile
push: true
platforms: |
linux/amd64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: maven-dist
path: target/
path: target
- name: Set Up QEMU
uses: docker/setup-qemu-action@v3
- name: Set Up Buildx
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
file: ./Dockerfile-Release
push: true
platforms: |
linux/amd64
Expand Down
37 changes: 12 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
# 构建前端
FROM --platform=$BUILDPLATFORM docker.io/node:alpine AS frontend-build
COPY ./webui /build/webui
WORKDIR /build/webui
RUN corepack enable pnpm && \
pnpm i && \
pnpm run build

# 下载依赖
FROM maven:3-eclipse-temurin-21-alpine AS backend-build
COPY pom.xml /build/pom.xml
WORKDIR /build
# fetch all dependencies
RUN mvn dependency:go-offline -B -T 1.5C
FROM --platform=$BUILDPLATFORM docker.io/maven:3.9.9-eclipse-temurin-21-alpine AS build

# 构建后端
COPY src/ /build/
COPY .git /build/.git
COPY . /build
WORKDIR /build
# 把前端打包好的文件拉来
COPY --from=frontend-build /build/webui/dist src/main/resources/static
RUN ls -l
RUN apk add --update curl git && \
mvn -B clean package --file pom.xml -T 1.5C
RUN apk add --update npm curl git && \
curl -L https://unpkg.com/@pnpm/self-installer | node && \
cd webui && \
pnpm i && \
npm run build && \
cd .. && \
mv webui/dist src/main/resources/static && \
mvn -B clean package --file pom.xml -T 1.5C -P thin-sqlite-packaging

# 最终阶段,只要成品
FROM docker.io/azul/zulu-openjdk-alpine:21.0.4-21.36-jre
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper"
USER 0
ENV TZ=UTC
WORKDIR /app
VOLUME /tmp
COPY --from=backend-build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar
COPY --from=build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar
ENV PATH="${JAVA_HOME}/bin:${PATH}"
ENTRYPOINT ["java","-Xmx386M","-XX:+UseG1GC", "-XX:+UseStringDeduplication","-XX:+ShrinkHeapInSteps","-jar","PeerBanHelper.jar"]
ENTRYPOINT ["java","-Xmx386M","-XX:+UseG1GC", "-XX:+UseStringDeduplication","-XX:+ShrinkHeapInSteps","-jar","PeerBanHelper.jar"]
File renamed without changes.
14 changes: 13 additions & 1 deletion install4j/project.install4j
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<install4j version="10.0.8" transformSequenceNumber="10">
<directoryPresets config="target/PeerBanHelper.jar" />
<application name="PeerBanHelper" applicationId="7121-2388-2769-9582" mediaDir="./output" lzmaCompression="true" shrinkRuntime="false" shortName="PeerBanHelper" publisher="PBH-BTN Community" publisherWeb="https://github.com/PBH-BTN" version="4.4.1" allPathsRelative="true" backupOnSave="true" autoSave="true" convertDotsToUnderscores="false" convertSpacesToUnderscores="false" macVolumeId="6106cfe6eb875954" javaMinVersion="21">
<application name="PeerBanHelper" applicationId="7121-2388-2769-9582" mediaDir="./output" lzmaCompression="true" shortName="PeerBanHelper" publisher="PBH-BTN Community" publisherWeb="https://github.com/PBH-BTN" version="4.4.1" allPathsRelative="true" backupOnSave="true" autoSave="true" convertDotsToUnderscores="false" convertSpacesToUnderscores="false" macVolumeId="6106cfe6eb875954" javaMinVersion="21">
<languages languageSelectionInPrincipalLanguage="true">
<principalLanguage id="zh_CN" customLocalizationFile="./lang/custom.utf8" />
<additionalLanguages>
Expand Down Expand Up @@ -662,5 +662,17 @@ return console.askYesNo(message, true);
<macosFolder name="macOS Folder" id="98" architecture="universal" />
<unixInstaller name="Unix Installer" id="103" require64BitVm="true" />
<linuxRPM name="Linux RPM" id="106" installDir="/usr/local/${compiler:sys.shortName}" require64BitVm="true" arch="amd64" />
<windows name="Windows x64 NoJava" id="109" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}_withoutjava" architecture="64">
<jreBundle jreBundleSource="none" />
</windows>
<windows name="Windows arm64 NoJava" id="112" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}_withoutjava" architecture="arm64">
<jreBundle jreBundleSource="none" />
</windows>
<macosFolder name="macOS Folder NoJava" id="120" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}_nojava" architecture="universal">
<jreBundle jreBundleSource="none" />
</macosFolder>
<unixInstaller name="Unix Installer NoJava" id="124" require64BitVm="true">
<jreBundle jreBundleSource="none" />
</unixInstaller>
</mediaSets>
</install4j>
2 changes: 1 addition & 1 deletion pkg/deb/usr/lib/systemd/system/peerbanhelper.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target
[Service]
User=peerbanhelper
WorkingDirectory=/etc/peerbanhelper
ExecStart=/usr/bin/java --Dpbh.datadir=/etc/peerbanhelper Xmx386M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /usr/lib/peerbanhelper/PeerBanHelper.jar
ExecStart=/usr/bin/java -Dpbh.datadir=/etc/peerbanhelper -Xmx386M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /usr/lib/peerbanhelper/PeerBanHelper.jar
Restart=on-failure
[Install]
WantedBy=multi-user.target
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ghostchu.peerbanhelper</groupId>
<artifactId>peerbanhelper</artifactId>
<version>6.2.2</version>
<version>6.2.3</version>
<packaging>takari-jar</packaging>

<name>PeerBanHelper</name>
Expand Down

0 comments on commit 66a8e41

Please sign in to comment.