Merge branch 'dev' into feat/path-to-cortexcpp
This commit is contained in:
commit
24b7d64efc
47
.github/scripts/rename-app-beta.sh
vendored
47
.github/scripts/rename-app-beta.sh
vendored
@ -1,47 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if the correct number of arguments is provided
|
|
||||||
if [ "$#" -ne 1 ]; then
|
|
||||||
echo "Usage: $0 <path_to_json_input_file>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
INPUT_JSON_FILE="$1"
|
|
||||||
|
|
||||||
# Check if the input file exists
|
|
||||||
if [ ! -f "$INPUT_JSON_FILE" ]; then
|
|
||||||
echo "Input file not found: $INPUT_JSON_FILE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use jq to transform the content
|
|
||||||
jq '
|
|
||||||
.name = "jan-beta" |
|
|
||||||
.productName = "Jan-beta" |
|
|
||||||
.build.appId = "jan-beta.ai.app" |
|
|
||||||
.build.productName = "Jan-beta" |
|
|
||||||
.build.appId = "jan-beta.ai.app" |
|
|
||||||
.build.protocols[0].name = "Jan-beta" |
|
|
||||||
.build.protocols[0].schemes = ["jan-beta"] |
|
|
||||||
.build.artifactName = "jan-beta-${os}-${arch}-${version}.${ext}" |
|
|
||||||
.build.publish[0].channel = "beta"
|
|
||||||
' "$INPUT_JSON_FILE" > ./package.json.tmp
|
|
||||||
|
|
||||||
cat ./package.json.tmp
|
|
||||||
|
|
||||||
rm $INPUT_JSON_FILE
|
|
||||||
mv ./package.json.tmp $INPUT_JSON_FILE
|
|
||||||
|
|
||||||
# Update the layout file
|
|
||||||
LAYOUT_FILE_PATH="web/app/layout.tsx"
|
|
||||||
|
|
||||||
if [ ! -f "$LAYOUT_FILE_PATH" ]; then
|
|
||||||
echo "File does not exist: $LAYOUT_FILE_PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Perform the replacements
|
|
||||||
sed -i -e "s#Jan#Jan-beta#g" "$LAYOUT_FILE_PATH"
|
|
||||||
|
|
||||||
# Notify completion
|
|
||||||
echo "File has been updated: $LAYOUT_FILE_PATH"
|
|
||||||
55
.github/scripts/rename-app.sh
vendored
Normal file
55
.github/scripts/rename-app.sh
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check if the correct number of arguments is provided
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo "Usage: $0 <path_to_json_input_file> <channel>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
INPUT_JSON_FILE="$1"
|
||||||
|
|
||||||
|
CHANNEL="$2"
|
||||||
|
|
||||||
|
if [ "$CHANNEL" == "nightly" ]; then
|
||||||
|
UPDATER="latest"
|
||||||
|
else
|
||||||
|
UPDATER="beta"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the input file exists
|
||||||
|
if [ ! -f "$INPUT_JSON_FILE" ]; then
|
||||||
|
echo "Input file not found: $INPUT_JSON_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use jq to transform the content
|
||||||
|
jq --arg channel "$CHANNEL" --arg updater "$UPDATER" '
|
||||||
|
.name = "jan-\($channel)" |
|
||||||
|
.productName = "Jan-\($channel)" |
|
||||||
|
.build.appId = "jan-\($channel).ai.app" |
|
||||||
|
.build.productName = "Jan-\($channel)" |
|
||||||
|
.build.appId = "jan-\($channel).ai.app" |
|
||||||
|
.build.protocols[0].name = "Jan-\($channel)" |
|
||||||
|
.build.protocols[0].schemes = ["jan-\($channel)"] |
|
||||||
|
.build.artifactName = "jan-\($channel)-${os}-${arch}-${version}.${ext}" |
|
||||||
|
.build.publish[0].channel = $updater
|
||||||
|
' "$INPUT_JSON_FILE" > ./package.json.tmp
|
||||||
|
|
||||||
|
cat ./package.json.tmp
|
||||||
|
|
||||||
|
rm $INPUT_JSON_FILE
|
||||||
|
mv ./package.json.tmp $INPUT_JSON_FILE
|
||||||
|
|
||||||
|
# Update the layout file
|
||||||
|
LAYOUT_FILE_PATH="web/app/layout.tsx"
|
||||||
|
|
||||||
|
if [ ! -f "$LAYOUT_FILE_PATH" ]; then
|
||||||
|
echo "File does not exist: $LAYOUT_FILE_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Perform the replacements
|
||||||
|
sed -i -e "s#Jan#Jan-$CHANNEL#g" "$LAYOUT_FILE_PATH"
|
||||||
|
|
||||||
|
# Notify completion
|
||||||
|
echo "File has been updated: $LAYOUT_FILE_PATH"
|
||||||
@ -3,6 +3,14 @@
|
|||||||
# File path to be modified
|
# File path to be modified
|
||||||
FILE_PATH="electron/scripts/uninstaller.nsh"
|
FILE_PATH="electron/scripts/uninstaller.nsh"
|
||||||
|
|
||||||
|
# Check if the correct number of arguments is provided
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <channel>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CHANNEL="$1"
|
||||||
|
|
||||||
# Check if the file exists
|
# Check if the file exists
|
||||||
if [ ! -f "$FILE_PATH" ]; then
|
if [ ! -f "$FILE_PATH" ]; then
|
||||||
echo "File does not exist: $FILE_PATH"
|
echo "File does not exist: $FILE_PATH"
|
||||||
@ -10,7 +18,7 @@ if [ ! -f "$FILE_PATH" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Perform the replacements
|
# Perform the replacements
|
||||||
sed -i -e "s#jan#jan-beta#g" "$FILE_PATH"
|
sed -i -e "s#jan#jan-$CHANNEL#g" "$FILE_PATH"
|
||||||
|
|
||||||
# Notify completion
|
# Notify completion
|
||||||
echo "File has been updated: $FILE_PATH"
|
echo "File has been updated: $FILE_PATH"
|
||||||
@ -3,6 +3,8 @@
|
|||||||
# File path to be modified
|
# File path to be modified
|
||||||
FILE_PATH="$1"
|
FILE_PATH="$1"
|
||||||
|
|
||||||
|
CHANNEL="$2"
|
||||||
|
|
||||||
# Check if the file exists
|
# Check if the file exists
|
||||||
if [ ! -f "$FILE_PATH" ]; then
|
if [ ! -f "$FILE_PATH" ]; then
|
||||||
echo "File does not exist: $FILE_PATH"
|
echo "File does not exist: $FILE_PATH"
|
||||||
@ -10,7 +12,7 @@ if [ ! -f "$FILE_PATH" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Perform the replacements
|
# Perform the replacements
|
||||||
sed -i -e 's/yarn workspace jan/yarn workspace jan-beta/g' "$FILE_PATH"
|
sed -i -e "s/yarn workspace jan/yarn workspace jan-$CHANNEL/g" "$FILE_PATH"
|
||||||
|
|
||||||
# Notify completion
|
# Notify completion
|
||||||
echo "File has been updated: $FILE_PATH"
|
echo "File has been updated: $FILE_PATH"
|
||||||
64
.github/workflows/jan-electron-build-nightly.yml
vendored
64
.github/workflows/jan-electron-build-nightly.yml
vendored
@ -114,8 +114,8 @@ jobs:
|
|||||||
- name: Upload latest-mac.yml
|
- name: Upload latest-mac.yml
|
||||||
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp ./latest-mac.yml "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-latest/latest-mac.yml"
|
aws s3 cp ./latest-mac.yml "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/latest-mac.yml"
|
||||||
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-latest/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/latest/
|
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
||||||
@ -123,35 +123,35 @@ jobs:
|
|||||||
AWS_EC2_METADATA_DISABLED: "true"
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
|
||||||
|
|
||||||
noti-discord-nightly-and-update-url-readme:
|
# noti-discord-nightly-and-update-url-readme:
|
||||||
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
# needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
||||||
secrets: inherit
|
# secrets: inherit
|
||||||
if: github.event_name == 'schedule'
|
# if: github.event_name == 'schedule'
|
||||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
# uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||||
with:
|
# with:
|
||||||
ref: refs/heads/dev
|
# ref: refs/heads/dev
|
||||||
build_reason: Nightly
|
# build_reason: Nightly
|
||||||
push_to_branch: dev
|
# push_to_branch: dev
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
# new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|
||||||
noti-discord-pre-release-and-update-url-readme:
|
# noti-discord-pre-release-and-update-url-readme:
|
||||||
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
# needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
||||||
secrets: inherit
|
# secrets: inherit
|
||||||
if: github.event_name == 'push'
|
# if: github.event_name == 'push'
|
||||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
# uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||||
with:
|
# with:
|
||||||
ref: refs/heads/dev
|
# ref: refs/heads/dev
|
||||||
build_reason: Pre-release
|
# build_reason: Pre-release
|
||||||
push_to_branch: dev
|
# push_to_branch: dev
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
# new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|
||||||
noti-discord-manual-and-update-url-readme:
|
# noti-discord-manual-and-update-url-readme:
|
||||||
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
# needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
|
||||||
secrets: inherit
|
# secrets: inherit
|
||||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
|
# if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
|
||||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
# uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||||
with:
|
# with:
|
||||||
ref: refs/heads/dev
|
# ref: refs/heads/dev
|
||||||
build_reason: Manual
|
# build_reason: Manual
|
||||||
push_to_branch: dev
|
# push_to_branch: dev
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
# new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|||||||
17
.github/workflows/template-build-linux-x64.yml
vendored
17
.github/workflows/template-build-linux-x64.yml
vendored
@ -60,18 +60,25 @@ jobs:
|
|||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-latest", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
cat electron/package.json
|
cat electron/package.json
|
||||||
|
chmod +x .github/scripts/rename-app.sh
|
||||||
|
.github/scripts/rename-app.sh ./electron/package.json nightly
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json nightly
|
||||||
|
echo "------------------------"
|
||||||
|
cat ./electron/package.json
|
||||||
|
echo "------------------------"
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
- name: Change App Name for beta version
|
||||||
if: inputs.beta == true
|
if: inputs.beta == true
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/scripts/rename-app-beta.sh
|
chmod +x .github/scripts/rename-app.sh
|
||||||
.github/scripts/rename-app-beta.sh ./electron/package.json
|
.github/scripts/rename-app.sh ./electron/package.json beta
|
||||||
chmod +x .github/scripts/rename-workspace-beta.sh
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
.github/scripts/rename-workspace-beta.sh ./package.json
|
.github/scripts/rename-workspace.sh ./package.json beta
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
cat ./electron/package.json
|
cat ./electron/package.json
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
|
|||||||
19
.github/workflows/template-build-macos-arm64.yml
vendored
19
.github/workflows/template-build-macos-arm64.yml
vendored
@ -72,22 +72,29 @@ jobs:
|
|||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
|
|
||||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-latest", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
|
|
||||||
jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json
|
jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
|
|
||||||
cat electron/package.json
|
cat electron/package.json
|
||||||
|
chmod +x .github/scripts/rename-app.sh
|
||||||
|
.github/scripts/rename-app.sh ./electron/package.json nightly
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json nightly
|
||||||
|
echo "------------------------"
|
||||||
|
cat ./electron/package.json
|
||||||
|
echo "------------------------"
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
- name: Change App Name for beta version
|
||||||
if: inputs.beta == true
|
if: inputs.beta == true
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/scripts/rename-app-beta.sh
|
chmod +x .github/scripts/rename-app.sh
|
||||||
.github/scripts/rename-app-beta.sh ./electron/package.json
|
.github/scripts/rename-app.sh ./electron/package.json beta
|
||||||
chmod +x .github/scripts/rename-workspace-beta.sh
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
.github/scripts/rename-workspace-beta.sh ./package.json
|
.github/scripts/rename-workspace.sh ./package.json beta
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
cat ./electron/package.json
|
cat ./electron/package.json
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
@ -186,7 +193,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: jan-mac-arm64-${{ inputs.new_version }}
|
name: jan-mac-arm64-${{ inputs.new_version }}
|
||||||
path: ./electron/dist/jan-mac-arm64-${{ inputs.new_version }}.dmg
|
path: ./electron/dist/*.dmg
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: inputs.beta == false
|
if: inputs.beta == false
|
||||||
|
|||||||
19
.github/workflows/template-build-macos-x64.yml
vendored
19
.github/workflows/template-build-macos-x64.yml
vendored
@ -72,22 +72,29 @@ jobs:
|
|||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
|
|
||||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-latest", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
|
|
||||||
jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json
|
jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
|
|
||||||
cat electron/package.json
|
cat electron/package.json
|
||||||
|
chmod +x .github/scripts/rename-app.sh
|
||||||
|
.github/scripts/rename-app.sh ./electron/package.json nightly
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json nightly
|
||||||
|
echo "------------------------"
|
||||||
|
cat ./electron/package.json
|
||||||
|
echo "------------------------"
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
- name: Change App Name for beta version
|
||||||
if: inputs.beta == true
|
if: inputs.beta == true
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/scripts/rename-app-beta.sh
|
chmod +x .github/scripts/rename-app.sh
|
||||||
.github/scripts/rename-app-beta.sh ./electron/package.json
|
.github/scripts/rename-app.sh ./electron/package.json beta
|
||||||
chmod +x .github/scripts/rename-workspace-beta.sh
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
.github/scripts/rename-workspace-beta.sh ./package.json
|
.github/scripts/rename-workspace.sh ./package.json beta
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
cat ./electron/package.json
|
cat ./electron/package.json
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
@ -186,7 +193,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: jan-mac-x64-${{ inputs.new_version }}
|
name: jan-mac-x64-${{ inputs.new_version }}
|
||||||
path: ./electron/dist/jan-mac-x64-${{ inputs.new_version }}.dmg
|
path: ./electron/dist/*.dmg
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: inputs.beta == false
|
if: inputs.beta == false
|
||||||
|
|||||||
25
.github/workflows/template-build-windows-x64.yml
vendored
25
.github/workflows/template-build-windows-x64.yml
vendored
@ -73,23 +73,34 @@ jobs:
|
|||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
|
|
||||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-latest", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
|
|
||||||
jq '.build.win.sign = "./sign.js"' electron/package.json > /tmp/package.json
|
jq '.build.win.sign = "./sign.js"' electron/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json electron/package.json
|
mv /tmp/package.json electron/package.json
|
||||||
cat electron/package.json
|
cat electron/package.json
|
||||||
|
chmod +x .github/scripts/rename-app.sh
|
||||||
|
.github/scripts/rename-app.sh ./electron/package.json nightly
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json nightly
|
||||||
|
chmod +x .github/scripts/rename-uninstaller.sh
|
||||||
|
.github/scripts/rename-uninstaller.sh nightly
|
||||||
|
echo "------------------------"
|
||||||
|
cat ./electron/package.json
|
||||||
|
echo "------------------------"
|
||||||
|
cat ./package.json
|
||||||
|
echo "------------------------"
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
- name: Change App Name for beta version
|
||||||
if: inputs.beta == true
|
if: inputs.beta == true
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/scripts/rename-app-beta.sh
|
chmod +x .github/scripts/rename-app.sh
|
||||||
.github/scripts/rename-app-beta.sh ./electron/package.json
|
.github/scripts/rename-app.sh ./electron/package.json beta
|
||||||
chmod +x .github/scripts/rename-workspace-beta.sh
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
.github/scripts/rename-workspace-beta.sh ./package.json
|
.github/scripts/rename-workspace.sh ./package.json beta
|
||||||
chmod +x .github/scripts/rename-uninstaller-beta.sh
|
chmod +x .github/scripts/rename-uninstaller.sh
|
||||||
.github/scripts/rename-uninstaller-beta.sh
|
.github/scripts/rename-uninstaller.sh beta
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
cat ./electron/package.json
|
cat ./electron/package.json
|
||||||
echo "------------------------"
|
echo "------------------------"
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
"@kirillvakalov/nut-tree__nut-js": "4.2.1-2"
|
"@kirillvakalov/nut-tree__nut-js": "4.2.1-2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron/notarize": "^2.3.2",
|
"@electron/notarize": "^2.5.0",
|
||||||
"@playwright/test": "^1.38.1",
|
"@playwright/test": "^1.38.1",
|
||||||
"@types/npmcli__arborist": "^5.6.4",
|
"@types/npmcli__arborist": "^5.6.4",
|
||||||
"@types/pacote": "^11.1.7",
|
"@types/pacote": "^11.1.7",
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
// ErrorMessage.test.tsx
|
// ErrorMessage.test.tsx
|
||||||
import React from 'react';
|
import React from 'react'
|
||||||
import { render, screen, fireEvent } from '@testing-library/react';
|
import { render, screen, fireEvent } from '@testing-library/react'
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom'
|
||||||
import ErrorMessage from './index';
|
import ErrorMessage from './index'
|
||||||
import { ThreadMessage, MessageStatus, ErrorCode } from '@janhq/core';
|
import { ThreadMessage, MessageStatus, ErrorCode } from '@janhq/core'
|
||||||
import { useAtomValue, useSetAtom } from 'jotai';
|
import { useAtomValue, useSetAtom } from 'jotai'
|
||||||
import useSendChatMessage from '@/hooks/useSendChatMessage';
|
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
||||||
|
|
||||||
// Mock the dependencies
|
// Mock the dependencies
|
||||||
jest.mock('jotai', () => {
|
jest.mock('jotai', () => {
|
||||||
@ -15,40 +15,29 @@ jest.mock('jotai', () => {
|
|||||||
useAtomValue: jest.fn(),
|
useAtomValue: jest.fn(),
|
||||||
useSetAtom: jest.fn(),
|
useSetAtom: jest.fn(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
jest.mock('@/hooks/useSendChatMessage', () => ({
|
jest.mock('@/hooks/useSendChatMessage', () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
default: jest.fn(),
|
default: jest.fn(),
|
||||||
}));
|
}))
|
||||||
|
|
||||||
describe('ErrorMessage Component', () => {
|
describe('ErrorMessage Component', () => {
|
||||||
const mockSetMainState = jest.fn();
|
const mockSetMainState = jest.fn()
|
||||||
const mockSetSelectedSettingScreen = jest.fn();
|
const mockSetSelectedSettingScreen = jest.fn()
|
||||||
const mockSetModalTroubleShooting = jest.fn();
|
const mockSetModalTroubleShooting = jest.fn()
|
||||||
const mockResendChatMessage = jest.fn();
|
const mockResendChatMessage = jest.fn()
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks()
|
||||||
(useAtomValue as jest.Mock).mockReturnValue([]);
|
;(useAtomValue as jest.Mock).mockReturnValue([])
|
||||||
(useSetAtom as jest.Mock).mockReturnValue(mockSetMainState);
|
;(useSetAtom as jest.Mock).mockReturnValue(mockSetMainState)
|
||||||
(useSetAtom as jest.Mock).mockReturnValue(mockSetSelectedSettingScreen);
|
;(useSetAtom as jest.Mock).mockReturnValue(mockSetSelectedSettingScreen)
|
||||||
(useSetAtom as jest.Mock).mockReturnValue(mockSetModalTroubleShooting);
|
;(useSetAtom as jest.Mock).mockReturnValue(mockSetModalTroubleShooting)
|
||||||
(useSendChatMessage as jest.Mock).mockReturnValue({ resendChatMessage: mockResendChatMessage });
|
;(useSendChatMessage as jest.Mock).mockReturnValue({
|
||||||
});
|
resendChatMessage: mockResendChatMessage,
|
||||||
|
})
|
||||||
it('renders stopped message correctly', () => {
|
})
|
||||||
const message: ThreadMessage = {
|
|
||||||
id: '1',
|
|
||||||
status: MessageStatus.Stopped,
|
|
||||||
content: [{ text: { value: 'Test message' } }],
|
|
||||||
} as ThreadMessage;
|
|
||||||
|
|
||||||
render(<ErrorMessage message={message} />);
|
|
||||||
|
|
||||||
expect(screen.getByText("Oops! The generation was interrupted. Let's give it another go!")).toBeInTheDocument();
|
|
||||||
expect(screen.getByText('Regenerate')).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('renders error message with InvalidApiKey correctly', () => {
|
it('renders error message with InvalidApiKey correctly', () => {
|
||||||
const message: ThreadMessage = {
|
const message: ThreadMessage = {
|
||||||
@ -56,13 +45,13 @@ describe('ErrorMessage Component', () => {
|
|||||||
status: MessageStatus.Error,
|
status: MessageStatus.Error,
|
||||||
error_code: ErrorCode.InvalidApiKey,
|
error_code: ErrorCode.InvalidApiKey,
|
||||||
content: [{ text: { value: 'Invalid API Key' } }],
|
content: [{ text: { value: 'Invalid API Key' } }],
|
||||||
} as ThreadMessage;
|
} as ThreadMessage
|
||||||
|
|
||||||
render(<ErrorMessage message={message} />);
|
render(<ErrorMessage message={message} />)
|
||||||
|
|
||||||
expect(screen.getByTestId('invalid-API-key-error')).toBeInTheDocument();
|
expect(screen.getByTestId('invalid-API-key-error')).toBeInTheDocument()
|
||||||
expect(screen.getByText('Settings')).toBeInTheDocument();
|
expect(screen.getByText('Settings')).toBeInTheDocument()
|
||||||
});
|
})
|
||||||
|
|
||||||
it('renders general error message correctly', () => {
|
it('renders general error message correctly', () => {
|
||||||
const message: ThreadMessage = {
|
const message: ThreadMessage = {
|
||||||
@ -70,26 +59,15 @@ describe('ErrorMessage Component', () => {
|
|||||||
status: MessageStatus.Error,
|
status: MessageStatus.Error,
|
||||||
error_code: ErrorCode.Unknown,
|
error_code: ErrorCode.Unknown,
|
||||||
content: [{ text: { value: 'Unknown error occurred' } }],
|
content: [{ text: { value: 'Unknown error occurred' } }],
|
||||||
} as ThreadMessage;
|
} as ThreadMessage
|
||||||
|
|
||||||
render(<ErrorMessage message={message} />);
|
render(<ErrorMessage message={message} />)
|
||||||
|
|
||||||
expect(screen.getByText("Apologies, something’s amiss!")).toBeInTheDocument();
|
expect(
|
||||||
expect(screen.getByText('troubleshooting assistance')).toBeInTheDocument();
|
screen.getByText('Apologies, something’s amiss!')
|
||||||
});
|
).toBeInTheDocument()
|
||||||
|
expect(screen.getByText('troubleshooting assistance')).toBeInTheDocument()
|
||||||
it('calls regenerateMessage when Regenerate button is clicked', () => {
|
})
|
||||||
const message: ThreadMessage = {
|
|
||||||
id: '1',
|
|
||||||
status: MessageStatus.Stopped,
|
|
||||||
content: [{ text: { value: 'Test message' } }],
|
|
||||||
} as ThreadMessage;
|
|
||||||
|
|
||||||
render(<ErrorMessage message={message} />);
|
|
||||||
|
|
||||||
fireEvent.click(screen.getByText('Regenerate'));
|
|
||||||
expect(mockResendChatMessage).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('opens troubleshooting modal when link is clicked', () => {
|
it('opens troubleshooting modal when link is clicked', () => {
|
||||||
const message: ThreadMessage = {
|
const message: ThreadMessage = {
|
||||||
@ -97,11 +75,11 @@ describe('ErrorMessage Component', () => {
|
|||||||
status: MessageStatus.Error,
|
status: MessageStatus.Error,
|
||||||
error_code: ErrorCode.Unknown,
|
error_code: ErrorCode.Unknown,
|
||||||
content: [{ text: { value: 'Unknown error occurred' } }],
|
content: [{ text: { value: 'Unknown error occurred' } }],
|
||||||
} as ThreadMessage;
|
} as ThreadMessage
|
||||||
|
|
||||||
render(<ErrorMessage message={message} />);
|
render(<ErrorMessage message={message} />)
|
||||||
|
|
||||||
fireEvent.click(screen.getByText('troubleshooting assistance'));
|
fireEvent.click(screen.getByText('troubleshooting assistance'))
|
||||||
expect(mockSetModalTroubleShooting).toHaveBeenCalledWith(true);
|
expect(mockSetModalTroubleShooting).toHaveBeenCalledWith(true)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|||||||
@ -4,9 +4,8 @@ import {
|
|||||||
MessageStatus,
|
MessageStatus,
|
||||||
ThreadMessage,
|
ThreadMessage,
|
||||||
} from '@janhq/core'
|
} from '@janhq/core'
|
||||||
import { Button } from '@janhq/joi'
|
|
||||||
import { useAtomValue, useSetAtom } from 'jotai'
|
import { useAtomValue, useSetAtom } from 'jotai'
|
||||||
import { RefreshCcw } from 'lucide-react'
|
|
||||||
|
|
||||||
import AutoLink from '@/containers/AutoLink'
|
import AutoLink from '@/containers/AutoLink'
|
||||||
import ModalTroubleShooting, {
|
import ModalTroubleShooting, {
|
||||||
@ -15,27 +14,17 @@ import ModalTroubleShooting, {
|
|||||||
|
|
||||||
import { MainViewState } from '@/constants/screens'
|
import { MainViewState } from '@/constants/screens'
|
||||||
|
|
||||||
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
|
||||||
|
|
||||||
import { mainViewStateAtom } from '@/helpers/atoms/App.atom'
|
import { mainViewStateAtom } from '@/helpers/atoms/App.atom'
|
||||||
import { getCurrentChatMessagesAtom } from '@/helpers/atoms/ChatMessage.atom'
|
|
||||||
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'
|
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'
|
||||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||||
|
|
||||||
const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||||
const messages = useAtomValue(getCurrentChatMessagesAtom)
|
|
||||||
const { resendChatMessage } = useSendChatMessage()
|
|
||||||
const setModalTroubleShooting = useSetAtom(modalTroubleShootingAtom)
|
const setModalTroubleShooting = useSetAtom(modalTroubleShootingAtom)
|
||||||
const setMainState = useSetAtom(mainViewStateAtom)
|
const setMainState = useSetAtom(mainViewStateAtom)
|
||||||
const setSelectedSettingScreen = useSetAtom(selectedSettingAtom)
|
const setSelectedSettingScreen = useSetAtom(selectedSettingAtom)
|
||||||
const activeThread = useAtomValue(activeThreadAtom)
|
const activeThread = useAtomValue(activeThreadAtom)
|
||||||
|
|
||||||
const regenerateMessage = async () => {
|
|
||||||
const lastMessageIndex = messages.length - 1
|
|
||||||
const message = messages[lastMessageIndex]
|
|
||||||
resendChatMessage(message)
|
|
||||||
}
|
|
||||||
|
|
||||||
const getErrorTitle = () => {
|
const getErrorTitle = () => {
|
||||||
switch (message.error_code) {
|
switch (message.error_code) {
|
||||||
case ErrorCode.Unknown:
|
case ErrorCode.Unknown:
|
||||||
@ -77,23 +66,6 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
{message.status === MessageStatus.Stopped && (
|
|
||||||
<div key={message.id} className="flex flex-col items-center">
|
|
||||||
<span className="mb-3 text-center font-medium text-[hsla(var(--text-secondary))]">
|
|
||||||
Oops! The generation was interrupted. Let's give it another go!
|
|
||||||
</span>
|
|
||||||
<Button
|
|
||||||
className="w-min"
|
|
||||||
theme="ghost"
|
|
||||||
variant="outline"
|
|
||||||
onClick={regenerateMessage}
|
|
||||||
>
|
|
||||||
<RefreshCcw size={14} className="" />
|
|
||||||
<span className="w-2" />
|
|
||||||
Regenerate
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{message.status === MessageStatus.Error && (
|
{message.status === MessageStatus.Error && (
|
||||||
<div
|
<div
|
||||||
key={message.id}
|
key={message.id}
|
||||||
|
|||||||
@ -94,7 +94,7 @@ const SystemMonitor = () => {
|
|||||||
<div
|
<div
|
||||||
ref={setElementExpand}
|
ref={setElementExpand}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
'fixed bottom-9 left-[49px] z-50 flex w-[calc(100%-48px)] flex-shrink-0 flex-col border-t border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))]',
|
'fixed bottom-9 left-[49px] z-50 flex h-[200px] w-[calc(100%-48px)] flex-shrink-0 flex-col border-t border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))]',
|
||||||
showFullScreen && 'h-[calc(100%-63px)]',
|
showFullScreen && 'h-[calc(100%-63px)]',
|
||||||
reduceTransparent && 'w-[calc(100%-48px)] rounded-none'
|
reduceTransparent && 'w-[calc(100%-48px)] rounded-none'
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -283,7 +283,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
'message max-width-[100%] flex flex-col gap-y-2 overflow-auto leading-relaxed'
|
'message max-width-[100%] flex flex-col gap-y-2 overflow-auto break-all leading-relaxed '
|
||||||
)}
|
)}
|
||||||
dangerouslySetInnerHTML={{ __html: parsedText }}
|
dangerouslySetInnerHTML={{ __html: parsedText }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import ChatBody from '@/screens/Thread/ThreadCenterPanel/ChatBody'
|
|||||||
import ChatInput from './ChatInput'
|
import ChatInput from './ChatInput'
|
||||||
import RequestDownloadModel from './RequestDownloadModel'
|
import RequestDownloadModel from './RequestDownloadModel'
|
||||||
|
|
||||||
|
import { showSystemMonitorPanelAtom } from '@/helpers/atoms/App.atom'
|
||||||
import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom'
|
import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom'
|
||||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||||
|
|
||||||
@ -144,6 +145,8 @@ const ThreadCenterPanel = () => {
|
|||||||
|
|
||||||
const isGeneratingResponse = useAtomValue(isGeneratingResponseAtom)
|
const isGeneratingResponse = useAtomValue(isGeneratingResponseAtom)
|
||||||
|
|
||||||
|
const showSystemMonitorPanel = useAtomValue(showSystemMonitorPanelAtom)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CenterPanelContainer>
|
<CenterPanelContainer>
|
||||||
<div
|
<div
|
||||||
@ -188,7 +191,12 @@ const ThreadCenterPanel = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex h-full w-full flex-col justify-between">
|
<div
|
||||||
|
className={twMerge(
|
||||||
|
'flex h-full w-full flex-col justify-between',
|
||||||
|
showSystemMonitorPanel && 'h-[calc(100%-200px)]'
|
||||||
|
)}
|
||||||
|
>
|
||||||
{activeThread ? (
|
{activeThread ? (
|
||||||
<div className="flex h-full w-full overflow-x-hidden">
|
<div className="flex h-full w-full overflow-x-hidden">
|
||||||
<ChatBody />
|
<ChatBody />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user