From d5192e2244810fbcb28bbdc04a000efbad5f2295 Mon Sep 17 00:00:00 2001 From: GyDi Date: Tue, 16 Aug 2022 01:53:40 +0800 Subject: [PATCH] feat: windows portable version do not check update --- .github/workflows/ci.yml | 5 +++++ src/pages/_layout.tsx | 8 +++++++- vite.config.ts | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf02d3b..b9530af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,10 +77,15 @@ jobs: - name: Portable Bundle if: matrix.os == 'windows-latest' + # rebuild with env settings run: | + yarn build yarn run portable env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} + TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + VITE_WIN_PORTABLE: 1 release-update: needs: release diff --git a/src/pages/_layout.tsx b/src/pages/_layout.tsx index bbd9585..dbbe2dd 100644 --- a/src/pages/_layout.tsx +++ b/src/pages/_layout.tsx @@ -22,6 +22,10 @@ import useCustomTheme from "@/components/layout/use-custom-theme"; import getSystem from "@/utils/get-system"; import "dayjs/locale/zh-cn"; +declare global { + const WIN_PORTABLE: boolean; +} + dayjs.extend(relativeTime); const OS = getSystem(); @@ -87,7 +91,9 @@ const Layout = () => {
- + {!(OS === "windows" && WIN_PORTABLE) && ( + + )}
diff --git a/vite.config.ts b/vite.config.ts index 6992f5f..b5412b8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,4 +22,7 @@ export default defineConfig({ "@root": path.resolve("."), }, }, + define: { + WIN_PORTABLE: !!process.env.VITE_WIN_PORTABLE, + }, });