From c95bf7b667445d069d79140f3c8c72e6581f5d5a Mon Sep 17 00:00:00 2001 From: CJACK Date: Mon, 30 Mar 2026 02:23:45 +0800 Subject: [PATCH] chore: relocate sha3 WASM asset to internal directory and update build configurations --- .github/workflows/release-artifacts.yml | 2 +- Dockerfile | 2 +- docs/DEPLOY.en.md | 4 ++-- docs/DEPLOY.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 133c509..80f89aa 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -79,7 +79,7 @@ jobs: CGO_ENABLED=0 GOOS="${GOOS}" GOARCH="${GOARCH}" \ go build -trimpath -ldflags="-s -w -X ds2api/internal/version.BuildVersion=${BUILD_VERSION}" -o "${STAGE}/${BIN}" ./cmd/ds2api - cp config.example.json .env.example sha3_wasm_bg.7b9ca65ddd.wasm LICENSE README.MD README.en.md "${STAGE}/" + cp config.example.json .env.example internal/deepseek/assets/sha3_wasm_bg.7b9ca65ddd.wasm LICENSE README.MD README.en.md "${STAGE}/" cp -R static/admin "${STAGE}/static/admin" if [ "${GOOS}" = "windows" ]; then diff --git a/Dockerfile b/Dockerfile index 6aa1974..8ee7888 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ CMD ["/usr/local/bin/ds2api"] FROM runtime-base AS runtime-from-source COPY --from=go-builder /out/ds2api /usr/local/bin/ds2api -COPY --from=go-builder /app/sha3_wasm_bg.7b9ca65ddd.wasm /app/sha3_wasm_bg.7b9ca65ddd.wasm +COPY --from=go-builder /app/internal/deepseek/assets/sha3_wasm_bg.7b9ca65ddd.wasm /app/sha3_wasm_bg.7b9ca65ddd.wasm COPY --from=go-builder /app/config.example.json /app/config.example.json COPY --from=webui-builder /app/static/admin /app/static/admin diff --git a/docs/DEPLOY.en.md b/docs/DEPLOY.en.md index 7368713..33bf0c7 100644 --- a/docs/DEPLOY.en.md +++ b/docs/DEPLOY.en.md @@ -456,8 +456,8 @@ server { # Copy compiled binary and related files to target directory sudo mkdir -p /opt/ds2api sudo cp ds2api config.json /opt/ds2api/ -# Optional: if you want to use an external WASM file (override embedded one) -# sudo cp sha3_wasm_bg.7b9ca65ddd.wasm /opt/ds2api/ +# Optional: if you want to use an external WASM file (override the embedded one, from a release package or build output) +# sudo cp /path/to/sha3_wasm_bg.7b9ca65ddd.wasm /opt/ds2api/ sudo cp -r static/admin /opt/ds2api/static/admin ``` diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index 1544e49..01b64ac 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -456,8 +456,8 @@ server { # 将编译好的二进制文件和相关文件复制到目标目录 sudo mkdir -p /opt/ds2api sudo cp ds2api config.json /opt/ds2api/ -# 可选:若你希望使用外置 WASM 文件(覆盖内置版本) -# sudo cp sha3_wasm_bg.7b9ca65ddd.wasm /opt/ds2api/ +# 可选:若你希望使用外置 WASM 文件(覆盖内置版本,来自 release 包或构建产物) +# sudo cp /path/to/sha3_wasm_bg.7b9ca65ddd.wasm /opt/ds2api/ sudo cp -r static/admin /opt/ds2api/static/admin ```