From af7af98d49a828daf70a40327c5f10fbfc4ddfe7 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 14 Jul 2024 13:34:29 +0800 Subject: [PATCH] 0.2.0 --- .github/workflows/release.yml | 11 +++++--- electron-builder.yml | 6 ++--- package.json | 8 +++--- scripts/replaceSpaces.js | 26 +++++++++++++++++++ .../src/pages/home/components/Assistants.tsx | 12 --------- 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 scripts/replaceSpaces.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d15de226..dea4654a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,13 +31,13 @@ jobs: - name: Install Dependencies run: yarn install - - name: build-linux + - name: Build Linux if: matrix.os == 'ubuntu-latest' run: yarn build:linux env: GH_TOKEN: ${{ secrets.GH_TOKEN }} - - name: build-mac + - name: Build Mac if: matrix.os == 'macos-latest' run: yarn build:mac env: @@ -48,13 +48,16 @@ jobs: APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }} GH_TOKEN: ${{ secrets.GH_TOKEN }} - - name: build-win + - name: Build Windows if: matrix.os == 'windows-latest' run: yarn build:win env: GH_TOKEN: ${{ secrets.GH_TOKEN }} - - name: release + - name: Replace spaces in filenames + run: node scripts/replaceSpaces.js + + - name: Release uses: softprops/action-gh-release@v2 with: draft: false diff --git a/electron-builder.yml b/electron-builder.yml index 050dd8c6..281b49c3 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -14,7 +14,7 @@ asarUnpack: win: executableName: Cherry Studio nsis: - artifactName: Cherry-Studio-${version}-setup.${ext} + artifactName: ${productName}-${version}-setup.${ext} shortcutName: ${productName} uninstallDisplayName: ${productName} createDesktopShortcut: always @@ -27,7 +27,7 @@ mac: - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. notarize: false dmg: - artifactName: Cherry-Studio-${version}.${ext} + artifactName: ${productName}-${version}.${ext} linux: target: - AppImage @@ -36,7 +36,7 @@ linux: maintainer: electronjs.org category: Utility appImage: - artifactName: Cherry-Studio-${version}.${ext} + artifactName: ${productName}-${version}.${ext} npmRebuild: false publish: provider: github diff --git a/package.json b/package.json index 072fa095..e2dffb1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cherry-studio", - "version": "0.1.1", + "version": "0.2.0", "description": "A powerful AI assistant for producer.", "main": "./out/main/index.js", "author": "kangfenmao@qq.com", @@ -16,9 +16,9 @@ "build": "npm run typecheck && electron-vite build", "postinstall": "electron-builder install-app-deps", "build:unpack": "dotenv npm run build && electron-builder --dir", - "build:win": "dotenv npm run build && electron-builder --win", - "build:mac": "dotenv electron-vite build && electron-builder --mac", - "build:linux": "dotenv electron-vite build && electron-builder --linux" + "build:win": "dotenv npm run build && electron-builder --win --publish never", + "build:mac": "dotenv electron-vite build && electron-builder --mac --publish never", + "build:linux": "dotenv electron-vite build && electron-builder --linux --publish never" }, "dependencies": { "@electron-toolkit/preload": "^3.0.0", diff --git a/scripts/replaceSpaces.js b/scripts/replaceSpaces.js new file mode 100644 index 00000000..6e593387 --- /dev/null +++ b/scripts/replaceSpaces.js @@ -0,0 +1,26 @@ +// replaceSpaces.js + +const fs = require('fs') +const path = require('path') + +const directory = 'dist' + +fs.readdir(directory, (err, files) => { + if (err) throw err + + files.forEach((file) => { + const oldPath = path.join(directory, file) + const newPath = path.join(directory, file.replace(/ /g, '-')) + + fs.stat(oldPath, (err, stats) => { + if (err) throw err + + if (stats.isFile() && oldPath !== newPath) { + fs.rename(oldPath, newPath, (err) => { + if (err) throw err + console.log(`Renamed: ${oldPath} -> ${newPath}`) + }) + } + }) + }) +}) diff --git a/src/renderer/src/pages/home/components/Assistants.tsx b/src/renderer/src/pages/home/components/Assistants.tsx index af0dd6d9..e1f00986 100644 --- a/src/renderer/src/pages/home/components/Assistants.tsx +++ b/src/renderer/src/pages/home/components/Assistants.tsx @@ -148,16 +148,4 @@ const AssistantName = styled.div` font-weight: bold; ` -const AssistantLastMessage = styled.div` - font-size: 12px; - line-height: 20px; - color: var(--color-text-2); - display: -webkit-box; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - -webkit-line-clamp: 1; - height: 20px; -` - export default Assistants