Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ jobs:
needs: resolve_version
if: github.event.inputs.build_linux == 'true' || github.event_name == 'push' || github.event_name == 'release'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: x64
package_command: npm run package:linux:x64
artifact_name: gsm3-management-panel-linux-x64-build
- arch: arm64
package_command: npm run package:linux:arm64
artifact_name: gsm3-management-panel-linux-arm64-build
steps:
- uses: actions/checkout@v4
- name: Setup Node.js for build
Expand All @@ -72,17 +81,17 @@ jobs:
npm install
cd client && npm install
cd ../server && npm install
- name: Build package
run: npm run package:linux
- name: Build Linux ${{ matrix.arch }} package
run: ${{ matrix.package_command }}
env:
CI: true
NODE_ENV: production
APP_VERSION: ${{ needs.resolve_version.outputs.version }}
VITE_APP_VERSION: ${{ needs.resolve_version.outputs.version }}
- name: Upload artifacts
- name: Upload Linux ${{ matrix.arch }} artifact
uses: actions/upload-artifact@v4
with:
name: gsm3-management-panel-linux-build
name: ${{ matrix.artifact_name }}
path: dist/package/
retention-days: 30

Expand Down Expand Up @@ -205,29 +214,37 @@ jobs:
needs: [resolve_version, build_linux, build_windows]
runs-on: ubuntu-latest
steps:
- name: Download Linux artifact
- name: Download Linux x64 artifact
uses: actions/download-artifact@v4
with:
name: gsm3-management-panel-linux-build
path: linux-build/
name: gsm3-management-panel-linux-x64-build
path: linux-x64-build/
- name: Download Linux arm64 artifact
uses: actions/download-artifact@v4
with:
name: gsm3-management-panel-linux-arm64-build
path: linux-arm64-build/
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: gsm3-management-panel-windows-build
path: windows-build/
- name: Create Linux tar.gz
run: |
cd linux-build
tar -czf ../gsm3-management-panel-linux-v${{ needs.resolve_version.outputs.version }}.tar.gz *
- name: Create Windows zip
- name: Create platform archives
run: |
tar -czf gsm3-management-panel-linux-x64-v${{ needs.resolve_version.outputs.version }}.tar.gz -C linux-x64-build .
cp gsm3-management-panel-linux-x64-v${{ needs.resolve_version.outputs.version }}.tar.gz gsm3-management-panel-linux-x64.tar.gz
tar -czf gsm3-management-panel-linux-arm64-v${{ needs.resolve_version.outputs.version }}.tar.gz -C linux-arm64-build .
cp gsm3-management-panel-linux-arm64-v${{ needs.resolve_version.outputs.version }}.tar.gz gsm3-management-panel-linux-arm64.tar.gz
cd windows-build
zip -r ../gsm3-management-panel-windows-v${{ needs.resolve_version.outputs.version }}.zip *
zip -r ../gsm3-management-panel-windows-v${{ needs.resolve_version.outputs.version }}.zip .
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
gsm3-management-panel-linux-v${{ needs.resolve_version.outputs.version }}.tar.gz
gsm3-management-panel-linux-x64-v${{ needs.resolve_version.outputs.version }}.tar.gz
gsm3-management-panel-linux-x64.tar.gz
gsm3-management-panel-linux-arm64-v${{ needs.resolve_version.outputs.version }}.tar.gz
gsm3-management-panel-linux-arm64.tar.gz
gsm3-management-panel-windows-v${{ needs.resolve_version.outputs.version }}.zip
generate_release_notes: true
draft: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ data/lib/
data/tunnels/
data/easytier/
data/tools/
data/terminal-control/
server/data/terminal-control/


dist/
Expand Down
37 changes: 18 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
npm config set fetch-retry-maxtimeout 120000 && \
npm config set fetch-timeout 300000 && \
npm run install:all && \
npm run package:linux:no-zip; \
npm run package:linux:arm64:no-zip; \
else \
echo "AMD64架构构建,使用标准配置..." && \
npm run install:all && \
npm run package:linux:no-zip; \
npm run package:linux:x64:no-zip; \
fi

# ---------- 运行阶段(最终镜像) ----------
Expand Down Expand Up @@ -270,18 +270,18 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
COPY --from=builder /app/dist/package/ /root/
COPY --from=builder /app/server/data/ /root/server/data/

# 下载 Zip-Tools 二进制文件(从 GitHub Releases latest,构建时预置
RUN mkdir -p /root/server/data/lib && \
# 下载运行时二进制文件(从 GitHub Releases latest,构建时预置到不会被数据卷遮蔽的位置
RUN mkdir -p /root/server/builtin/data/lib && \
if [ "$TARGETARCH" = "amd64" ]; then \
BINARY_NAME="file_zip_linux_x64"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
BINARY_NAME="file_zip_linux_arm64"; \
fi && \
echo "正在下载 Zip-Tools (${BINARY_NAME})..." && \
wget -t 3 --retry-connrefused --waitretry=2 --read-timeout=30 --timeout=15 \
-O /root/server/data/lib/${BINARY_NAME} \
-O /root/server/builtin/data/lib/${BINARY_NAME} \
"https://github.com/MCSManager/Zip-Tools/releases/latest/download/${BINARY_NAME}" && \
chmod 755 /root/server/data/lib/${BINARY_NAME} && \
chmod 755 /root/server/builtin/data/lib/${BINARY_NAME} && \
echo "Zip-Tools 下载完成: ${BINARY_NAME}"

# 下载 7z 二进制文件(从 GitHub Releases latest,构建时预置)
Expand All @@ -292,23 +292,22 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
fi && \
echo "正在下载 7z (${BINARY_7Z})..." && \
wget -t 3 --retry-connrefused --waitretry=2 --read-timeout=30 --timeout=15 \
-O /root/server/data/lib/${BINARY_7Z} \
-O /root/server/builtin/data/lib/${BINARY_7Z} \
"https://github.com/MCSManager/Zip-Tools/releases/latest/download/${BINARY_7Z}" && \
chmod 755 /root/server/data/lib/${BINARY_7Z} && \
chmod 755 /root/server/builtin/data/lib/${BINARY_7Z} && \
echo "7z 下载完成: ${BINARY_7Z}"

# 下载 PTY 二进制文件(从 GitHub Releases latest,构建时预置)
# 通过打包产物中的固定资产 CLI 校验并预置当前架构的 PTY
RUN if [ "$TARGETARCH" = "amd64" ]; then \
PTY_NAME="pty_linux_x64"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
PTY_NAME="pty_linux_arm64"; \
fi && \
echo "正在下载 PTY (${PTY_NAME})..." && \
wget -t 3 --retry-connrefused --waitretry=2 --read-timeout=30 --timeout=15 \
-O /root/server/data/lib/${PTY_NAME} \
"https://github.com/MCSManager/PTY/releases/download/latest/${PTY_NAME}" && \
chmod 755 /root/server/data/lib/${PTY_NAME} && \
echo "PTY 下载完成: ${PTY_NAME}"
PTY_ASSET="linux-x64"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
PTY_ASSET="linux-arm64"; \
else \
echo "不支持的 PTY 架构: $TARGETARCH" >&2; exit 1; \
fi && \
node /root/server/utils/ptyAssetCli.js ensure \
--asset "$PTY_ASSET" \
--target-dir /root/server/builtin/data/lib
# 拷贝 Python 依赖清单并安装
COPY --from=builder /app/server/src/Python/requirements.txt /tmp/requirements.txt
# 安装Python依赖并配置最终权限
Expand Down
23 changes: 3 additions & 20 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading