From deea4320adbc810e9bb91ac970c63649d59a48e2 Mon Sep 17 00:00:00 2001 From: Shiroki Satsuki Date: Tue, 6 Feb 2024 15:07:01 +0800 Subject: [PATCH 1/5] ci: build universal binary for macos (#3711) * ci: build universal binary for macos * ci: add tauri args * ci: restore rust_target * ci: fallback value for tauri build args * ci: cache yarn --- .github/workflows/app.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index aebba28f7e2..5fc1c911b48 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -43,12 +43,9 @@ jobs: - os: ubuntu-latest arch: x86_64 rust_target: x86_64-unknown-linux-gnu - - os: macos-latest - arch: x86_64 - rust_target: x86_64-apple-darwin - os: macos-latest arch: aarch64 - rust_target: aarch64-apple-darwin + rust_target: x86_64-apple-darwin,aarch64-apple-darwin - os: windows-latest arch: x86_64 rust_target: x86_64-pc-windows-msvc @@ -60,13 +57,14 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 + cache: 'yarn' - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.config.rust_target }} - uses: Swatinem/rust-cache@v2 with: - key: ${{ matrix.config.rust_target }} + key: ${{ matrix.config.os }} - name: install dependencies (ubuntu only) if: matrix.config.os == 'ubuntu-latest' run: | @@ -81,6 +79,7 @@ jobs: TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: releaseId: ${{ needs.create-release.outputs.release_id }} + args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }} publish-release: permissions: From d0463b2089cddbd828639220cb7d0c04cc8b7e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E8=BF=AA?= Date: Tue, 6 Feb 2024 15:11:20 +0800 Subject: [PATCH 2/5] feat(mac): add sign config, fix arm64 build (#4008) Co-authored-by: vir --- .github/workflows/app.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 5fc1c911b48..7e74cf04595 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -77,6 +77,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} with: releaseId: ${{ needs.create-release.outputs.release_id }} args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }} From 887bec019a654aee647aad095b7db0ab34266589 Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Tue, 6 Feb 2024 15:34:43 +0800 Subject: [PATCH 3/5] feat: bump version (#4009) --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 75d6a0d0afa..dac745f928c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "NextChat", - "version": "2.10.1" + "version": "2.10.2" }, "tauri": { "allowlist": { From 462a88ae82cf00242c1bac6ce62a82a50ab1eadc Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Tue, 6 Feb 2024 16:20:12 +0700 Subject: [PATCH 4/5] Fix [CI/CD] [Vercel] Deploy Preview (#4005) - [+] feat(.github/workflows/deploy_preview.yml): add 'reopened' event trigger --- .github/workflows/deploy_preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_preview.yml b/.github/workflows/deploy_preview.yml index 02ee0f1923d..bdbb78c27c5 100644 --- a/.github/workflows/deploy_preview.yml +++ b/.github/workflows/deploy_preview.yml @@ -5,6 +5,7 @@ on: types: - opened - synchronize + - reopened env: VERCEL_TEAM: ${{ secrets.VERCEL_TEAM }} From 9d5801fb5ff21893c6dfc0417ab65eb99ccc0fdc Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:31:49 +0800 Subject: [PATCH 5/5] fix: avoiding not operation for custom models (#4010) --- app/store/chat.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index a3dc940898a..254325a7552 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -92,14 +92,18 @@ function countMessages(msgs: ChatMessage[]) { } function fillTemplateWith(input: string, modelConfig: ModelConfig) { - const cutoff = KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default; + const cutoff = + KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default; // Find the model in the DEFAULT_MODELS array that matches the modelConfig.model - const modelInfo = DEFAULT_MODELS.find(m => m.name === modelConfig.model); - if (!modelInfo) { - throw new Error(`Model ${modelConfig.model} not found in DEFAULT_MODELS array.`); + const modelInfo = DEFAULT_MODELS.find((m) => m.name === modelConfig.model); + + var serviceProvider = "OpenAI"; + if (modelInfo) { + // TODO: auto detect the providerName from the modelConfig.model + + // Directly use the providerName from the modelInfo + serviceProvider = modelInfo.provider.providerName; } - // Directly use the providerName from the modelInfo - const serviceProvider = modelInfo.provider.providerName; const vars = { ServiceProvider: serviceProvider, @@ -119,7 +123,7 @@ function fillTemplateWith(input: string, modelConfig: ModelConfig) { } Object.entries(vars).forEach(([name, value]) => { - const regex = new RegExp(`{{${name}}}`, 'g'); + const regex = new RegExp(`{{${name}}}`, "g"); output = output.replace(regex, value.toString()); // Ensure value is a string });