-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1011 from PBH-BTN/master
v7.4.4
- Loading branch information
Showing
48 changed files
with
1,369 additions
and
1,250 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.bat text eol=crlf |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build C++ JNI Library | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
arch: | ||
- x64 | ||
- amd64_arm64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '21' | ||
- uses: TheMrMilchmann/setup-msvc-dev@v3 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
- name: Build JNI Library | ||
run: | | ||
cd cpp-src | ||
cl /LD /I"$env:JAVA_HOME\include" /I"$env:JAVA_HOME\include\win32" ghost-common-jni.cpp /link /out:ghost-common-jni_vc2015_${{ matrix.arch == 'x64' && 'amd64' || 'aarch64'}}.dll | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: jni-${{ matrix.arch == 'x64' && 'amd64' || 'aarch64'}} | ||
path: cpp-src/*.dll |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,27 +13,34 @@ on: | |
workflow_dispatch: | ||
jobs: | ||
Build_Executable: | ||
name: Build JAR Files | ||
uses: ./.github/workflows/build_maven.yml | ||
secrets: inherit | ||
Build_Installers: | ||
name: Generate Installers | ||
needs: Build_Executable | ||
uses: ./.github/workflows/build_installers.yml | ||
secrets: inherit | ||
Build_Portable: | ||
name: Generate Portable Version | ||
needs: Build_Executable | ||
uses: ./.github/workflows/build_portable.yml | ||
Build_SPK: | ||
name: Generate Synology Package | ||
needs: Build_Executable | ||
uses: ./.github/workflows/build_spk.yml | ||
with: | ||
image: ghostchu/peerbanhelper-snapshot:sha-$(git rev-parse --short ${{ github.sha }}) | ||
Build_DEB: | ||
name: Generate Debian Package | ||
needs: Build_Executable | ||
uses: ./.github/workflows/build_deb.yml | ||
Build_PKG: | ||
name: Generate FreeBSD Package | ||
needs: Build_Executable | ||
uses: ./.github/workflows/build_pkg.yml | ||
Create_Torrent: | ||
name: Create Torrent | ||
needs: [ Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -101,6 +108,7 @@ jobs: | |
-o peerbanhelper.torrent \ | ||
"PeerBanHelper_Installers_${{ steps.set_version.outputs.version }}.tar.gz" | ||
Build_Docker: | ||
name: Build and Push Docker Images | ||
needs: Build_Executable | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -120,7 +128,7 @@ jobs: | |
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5.6.1 | ||
uses: docker/metadata-action@v5.7.0 | ||
with: | ||
images: ghostchu/peerbanhelper-snapshot | ||
tags: | | ||
|
@@ -133,7 +141,7 @@ jobs: | |
type=raw,ci | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6.13.0 | ||
uses: docker/build-push-action@v6.15.0 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
|
@@ -145,38 +153,39 @@ jobs: | |
labels: ${{ steps.meta.outputs.labels }}-jvm-universal | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=min | ||
# Build_Docker_Standalone: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Set Up QEMU | ||
# uses: docker/setup-qemu-action@v3 | ||
# - name: Set Up Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# - name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/[email protected] | ||
# with: | ||
# images: ghostchu/peerbanhelper-snapshot | ||
# tags: | | ||
# type=ref,event=branch | ||
# type=ref,event=tag | ||
# type=ref,event=pr | ||
# type=semver,pattern={{version}} | ||
# type=semver,pattern={{major}}.{{minor}} | ||
# type=raw,ci-jvm-universal | ||
# type=raw,ci | ||
# type=sha | ||
# - name: Build and push Docker image | ||
# uses: docker/[email protected] | ||
# with: | ||
# context: . | ||
# file: ./Dockerfile | ||
# push: false | ||
# platforms: | | ||
# linux/amd64 | ||
# linux/arm64/v8 | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }}-jvm-universal | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=min | ||
Build_Docker_Standalone: | ||
name: Build Standalone Docker Images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set Up Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ghostchu/peerbanhelper-snapshot | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=raw,ci-jvm-universal | ||
type=raw,ci | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: false | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64/v8 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }}-jvm-universal | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=min |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
FROM --platform=$BUILDPLATFORM node:current-alpine as build_web | ||
Check warning on line 1 in Dockerfile
|
||
COPY webui /webui | ||
WORKDIR /webui | ||
RUN corepack enable pnpm && CI=1 pnpm i && pnpm run build | ||
|
||
FROM --platform=$BUILDPLATFORM docker.io/maven:3.9.9-eclipse-temurin-21-alpine AS build | ||
COPY . /build | ||
WORKDIR /build | ||
COPY --from=build_web webui/dist src/main/resources/static | ||
RUN apk add git && \ | ||
mvn -B clean package --file pom.xml -T 1.5C -P thin-sqlite-packaging | ||
|
||
FROM docker.io/bellsoft/liberica-runtime-container:jre-23-slim-musl | ||
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper" | ||
COPY target/libraries /app/libraries | ||
COPY target/PeerBanHelper.jar /app/PeerBanHelper.jar | ||
USER 0 | ||
EXPOSE 9898 | ||
ENV TZ=UTC | ||
ENV JAVA_OPTS="-Dpbh.release=docker -Djava.awt.headless=true -Xmx512M -Xms16M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps" | ||
WORKDIR /app | ||
VOLUME /tmp | ||
COPY --from=build build/target/libraries /app/libraries | ||
COPY --from=build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
ENTRYPOINT ["sh", "-c", "${JAVA_HOME}/bin/java ${JAVA_OPTS} -jar PeerBanHelper.jar"] |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
#!/bin/sh | ||
echo "Setup webui files.." | ||
sh setup-webui.sh | ||
current_wd=$(pwd) | ||
static_dir="$(dirname $0)/src/main/resources/static" | ||
|
||
rm -rf ${static_dir} || echo "" | ||
cd ${current_wd}/webui | ||
pnpm install | ||
pnpm run build | ||
cd ${current_wd} | ||
cp -r webui/dist ${static_dir} | ||
|
||
echo "Prepare to build jar.." | ||
mvn -B clean package --file pom.xml | ||
mvn -B clean package --file pom.xml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VS2015 x64 本机工具命令提示符 | ||
# VS2015 x64 本机工具命令提示符 | ||
cl /LD /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" ghost-common-jni.cpp /link /out:ghost-common-jni_vc2015_amd64.dll | ||
VS2015 x64 ARM 兼容工具命令提示符 | ||
# VS2015 x64 ARM 兼容工具命令提示符 | ||
cl /LD /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" ghost-common-jni.cpp /link /out:ghost-common-jni_vc2015_aarch64.dll |
Oops, something went wrong.