From 8d550661cdabd9c499fd7a4805f31a4839176240 Mon Sep 17 00:00:00 2001 From: twosugar Date: Tue, 1 Sep 2026 19:01:20 +0800 Subject: [PATCH 1/2] fix(ci): scope CN build region and isolate OSS uploads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 让 CN 构建的区域变量覆盖完整构建链,确保导航按 CN 规则生成。 移除 CN 产物写入全局 OSS 路径的命令,避免跨区域资源覆盖。 Co-Authored-By: Claude --- .github/workflows/release.yml | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3faa4291..9a6804ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,7 +100,6 @@ jobs: - name: Upload to Aliyun OSS (CN) run: | ${{github.workspace}}/ossutil cp ./dist/ oss://lb-assets/github/release/open.longbridge.cn/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --exclude "*.txt" --exclude "*.zip" --meta=Cache-Control:max-age=31536000 - ${{github.workspace}}/ossutil cp ./dist/ oss://lb-assets/github/release/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --exclude "*.txt" --exclude "*.zip" --meta=Cache-Control:max-age=31536000 ${{github.workspace}}/ossutil cp ./dist/ oss://lb-assets/github/release/open.longbridge.cn/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.zip" --meta "Cache-Control:no-cache#Content-type:application/zip;charset=utf-8" ${{github.workspace}}/ossutil cp ./dist oss://lb-assets/github/release/open.longbridge.cn/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.md" --meta "Cache-Control:no-cache#Content-type:text/markdown;charset=utf-8" ${{github.workspace}}/ossutil cp ./dist oss://lb-assets/github/release/open.longbridge.cn/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.txt" --meta "Cache-Control:no-cache#Content-type:text/plain;charset=utf-8" diff --git a/package.json b/package.json index 420d92cf..417c7acb 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dev:cn": "cross-env VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_SITE_HOSTNAME=https://open.longbridge.cn astro dev", "build:canary": "cross-env \"NODE_OPTIONS=--max-old-space-size=14336 --expose-gc\" PROXY=canary VITE_API_BASE_URL=https://openapi.longbridge.xyz astro check && astro build && bunx pagefind --site dist && bun run scripts/copy-routes.ts", "build:release": "cross-env \"NODE_OPTIONS=--max-old-space-size=14336 --expose-gc\" VITE_API_BASE_URL=https://openapi.longbridge.com astro check && astro build && bunx pagefind --site dist && bun run scripts/copy-routes.ts", - "build:cn": "cross-env \"NODE_OPTIONS=--max-old-space-size=14336 --expose-gc\" VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_PORTAL_GATEWAY_BASE_URL=https://mr.lbkrs.com VITE_SITE_HOSTNAME=https://open.longbridge.cn astro check && astro build && bunx pagefind --site dist && bun run scripts/copy-routes.ts", + "build:cn": "cross-env \"NODE_OPTIONS=--max-old-space-size=14336 --expose-gc\" VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_PORTAL_GATEWAY_BASE_URL=https://mr.lbkrs.com VITE_SITE_HOSTNAME=https://open.longbridge.cn sh -c 'astro check && astro build && bunx pagefind --site dist && bun run scripts/copy-routes.ts'", "build:llms": "bun run scripts/normalize_md.ts && bun run scripts/generate-llms.ts", "build:copy-routes": "bun run scripts/copy-routes.ts", "lint": "oxlint", From f909b15e7fc74fbdda7121c332e48722310cf0bc Mon Sep 17 00:00:00 2001 From: twosugar Date: Tue, 1 Sep 2026 19:22:20 +0800 Subject: [PATCH 2/2] fix(nav): use public region flag in client build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Astro 客户端仅注入 PUBLIC_REGION,改用该变量让 CN hydration 继续隐藏 Features、Pricing 和 Docs 导航。 Co-Authored-By: Claude --- src/components/shell/TopNav.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/shell/TopNav.tsx b/src/components/shell/TopNav.tsx index 5ab707ce..92ce3541 100644 --- a/src/components/shell/TopNav.tsx +++ b/src/components/shell/TopNav.tsx @@ -76,7 +76,7 @@ export default function TopNav({ locale, pathname: initialPath = '/' }: Props) { }, []) const navItems = navForLocale(locale) // CN region hides Pricing / Docs / the Features menu (legacy CN_HIDDEN_KEYS). - const isCnRegion = import.meta.env.VITE_REGION === 'cn' + const isCnRegion = import.meta.env.PUBLIC_REGION === 'cn' const CN_HIDDEN_LINKS = new Set(['/pricing', '/docs']) const visibleNavItems = isCnRegion ? navItems.filter((n) => !n.link || !CN_HIDDEN_LINKS.has(n.link))