Skip to content

refactor: migrate to tauri #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 61 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7c66810
refactor: migrate to tauri - ui shows [wip]
Blankll Jun 8, 2024
3c8a96f
refactor: migrate fetchApi [wip]
Blankll Jun 9, 2024
99297bb
refactor: fetchApi auth
Blankll Jun 9, 2024
34e0f94
refactor: chatBotApi client & proxy setup
Blankll Jun 11, 2024
cdb7d83
refactor: fetch api implement ok
Blankll Jun 12, 2024
f914bd2
refactor: remove unused imports
Blankll Jun 12, 2024
3e8fe23
refactor: implement open ai apis [wip]
Blankll Jun 13, 2024
21145c6
refactor: implement open ai stream [wip]
Blankll Jun 16, 2024
0c7638f
fix: 400 error not show the response data issue
Blankll Jun 16, 2024
7fb91b6
fix: add global menu
Blankll Jun 17, 2024
1200d0a
refactor: save file ok
Blankll Jun 18, 2024
51ab4d6
refactor: shortcuts ok
Blankll Jun 19, 2024
b94b69b
refactor: migrate openai api
Blankll Jun 19, 2024
dc499ff
refactor: receive mssage from openai api through stream mode
Blankll Jun 22, 2024
bf6df6e
refactor: migrate pipeline
Blankll Jun 23, 2024
e3a806f
refactor: migrate pipeline
Blankll Jun 23, 2024
be8bd6e
refactor: migrate app icon
Blankll Jun 23, 2024
c9161e9
refactor: fix eslint issue
Blankll Jun 23, 2024
db96870
refactor: openai stream mode ok
Blankll Jun 23, 2024
54337f6
refactor: fix https proxy issue
Blankll Jun 25, 2024
a401e86
refactor: implement migrate config data from electron to tauri
Blankll Jun 26, 2024
4282131
refactor: cleanup dependencies
Blankll Jun 26, 2024
5a5c041
refactor: test build package
Blankll Jun 27, 2024
c361889
refactor: remove migrate implementation due to permission limit
Blankll Jun 27, 2024
77018c7
fix: build package dependencies
Blankll Jun 27, 2024
96fde4c
fix: build package dependencies
Blankll Jun 27, 2024
b4b4bd6
refactor: include windows/linux arm platform app
Blankll Jun 27, 2024
50a5be0
refactor: include windows/linux arm platform app
Blankll Jun 27, 2024
4c41466
fix: fix linux build pipeline
Blankll Jun 27, 2024
48b9fbd
fix: test linux arm
Blankll Jun 27, 2024
e7c81c3
fix: linux crross compiler
Blankll Jun 27, 2024
8e142e0
refactor: migrate version update detection
Blankll Jun 27, 2024
16af87a
fix: linux crross compiler
Blankll Jun 27, 2024
e6a0581
fix: linux crross compiler
Blankll Jun 27, 2024
ed6a886
fix: linux crross compiler
Blankll Jun 27, 2024
8dd4ef5
fix: linux crross compiler
Blankll Jun 27, 2024
c3b9726
fix: linux crross compiler
Blankll Jun 27, 2024
69a29fb
fix: openssl issue
Blankll Jun 27, 2024
bf6d5da
fix: openssl issue
Blankll Jun 27, 2024
f63634a
fix: openssl issue
Blankll Jun 28, 2024
e9f51b2
fix: openssl issue
Blankll Jun 28, 2024
7b9c70d
fix: build in deference runner
Blankll Jun 28, 2024
91cb3fb
fix: build in deference runner
Blankll Jun 28, 2024
be4ee83
fix: build in deference runner
Blankll Jun 28, 2024
f4654d0
refactor: upload signed version
Blankll Jun 28, 2024
bf6abeb
refactor: release after codesign complet
Blankll Jun 28, 2024
d9ce40a
refactor: release after codesign complet
Blankll Jun 28, 2024
1890cf8
refactor: test release
Blankll Jun 28, 2024
8212449
fix: fix windows sign issue
Blankll Jun 29, 2024
e53aaf9
fix: tag not find issue
Blankll Jun 29, 2024
71562a3
fix: release check out the code first
Blankll Jun 29, 2024
9e4ab08
feat: implement macos codesign
Blankll Jun 29, 2024
562da70
refactor: fix artifacts folder issue
Blankll Jun 29, 2024
78aa1f5
refactor: fix artifacts folder issue
Blankll Jun 29, 2024
c4f67d4
refactor: fix artifacts not uploaded issue
Blankll Jun 29, 2024
d9551ea
refactor: fix artifacts failed to send to R2 issue
Blankll Jun 29, 2024
6361087
refactor: update pipeline for production ready
Blankll Jun 29, 2024
e50005f
refactor: implement build .pkg file for app store
Blankll Jun 29, 2024
2ae1a83
refactor: update pipeline
Blankll Jun 29, 2024
6639526
refactor: markdownRender
Blankll Jun 29, 2024
47f91ed
refactor: remove debug logs
Blankll Jun 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

44 changes: 44 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
env: {
node: true,
es2022: true,
},
extends: [
'plugin:vue/base',
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'./.eslintrc-auto-import.json',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'prettier', 'eslint-plugin-vue'],
rules: {
'prettier/prettier': 'error',
'vue/multi-word-component-names': 'off',
'arrow-parens': [2, 'as-needed'],
'arrow-spacing': [
2,
{
before: true,
after: true,
},
],
'key-spacing': [
2,
{
beforeColon: false,
afterColon: true,
},
],
'no-var': 'error',
'no-console': 'error',
'no-debugger': process.env === 'development' ? 'warn' : 'error',
},
ignorePatterns: ['dist','src-tauri'],
};
21 changes: 0 additions & 21 deletions .eslintrc.json

This file was deleted.

31 changes: 17 additions & 14 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Node.js CI
run-name: ${{ github.event.head_commit.message }}

on:
push:
branches: [master]
pull_request:
branches: [master]

Expand All @@ -24,27 +23,31 @@ jobs:
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Install rpm
run: sudo apt-get install -y rpm
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
if: matrix.os == 'ubuntu-latest'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: npm ci
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: npm ci --legacy-peer-deps
- run: npm run lint:check
- run: npm audit --audit-level=critical
- run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: npm run package
- name: Build Electron app
shell: bash
run: ./scripts/make-distributions.sh

- run: npm run build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
includeRelease: false
140 changes: 84 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,81 @@
name: distributions release

run-name: ${{ github.event.head_commit.message }}
on:
push:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-release:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ macos-latest, windows-latest, ubuntu-latest ]
include:
- os: 'macos-latest'
args: '--target universal-apple-darwin'
target: 'aarch64-apple-darwin,x86_64-apple-darwin'
- os: 'windows-latest'
args: '--target aarch64-pc-windows-msvc'
target: 'aarch64-pc-windows-msvc'
aarch64: true
- os: 'windows-latest'
args: '--target x86_64-pc-windows-msvc'
target: 'x86_64-pc-windows-msvc'
x86_64: true
- os: 'ubuntu-latest'
args: '--target aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
aarch64: true
- os: 'ubuntu-latest'
args: '--target x86_64-unknown-linux-gnu'
target: 'x86_64-unknown-linux-gnu'
x86_64: true
node-version: [ 20.x ]
runs-on: ${{ matrix.os }}

steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Install rpm
run: sudo apt-get install -y rpm
if: matrix.os == 'ubuntu-latest'
- name: Use Node.js ${{ matrix.node-version }}
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup .NET Core SDK
if: matrix.os == 'windows-latest'
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- run: npm ci
- run: npm run package
- name: Build app
shell: bash
run: ./scripts/make-distributions.sh
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf pkg-config libssl-dev gcc-aarch64-linux-gnu
- name: install frontend dependencies
run: npm ci --legacy-peer-deps
- run: npm run lint:check
- run: npm audit --audit-level=critical
- run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: npm run build
- name: Build Distribution Binaries
uses: tauri-apps/tauri-action@v0
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG_CONFIG_ALLOW_CROSS: 1
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
with:
args: ${{ matrix.args }}

- name: Sign files with Trusted Signing
- name: Sign Binaries with Trusted Signing
if: matrix.os == 'windows-latest'
uses: azure/trusted-signing-action@v0.3.19
with:
Expand All @@ -55,66 +85,64 @@ jobs:
endpoint: https://eus.codesigning.azure.net/
trusted-signing-account-name: geek-fun
certificate-profile-name: geek-fun
files-folder: ${{ github.workspace }}\out\make
files-folder: ${{ github.workspace }}\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\
files-folder-depth: 7
files-folder-filter: exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Upload artifacts
- name: Upload Distribution Binaries
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
path: out/make/*
path: |
${{ github.workspace }}/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
${{ github.workspace }}/src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
${{ github.workspace }}/src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
${{ github.workspace }}\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\*.exe

release:
needs: pre-release
runs-on: ubuntu-latest
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
- name: Download Distribution Binaries
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
path: artifacts
merge-multiple: true
- name: Generate changelog
uses: jaywcjlove/changelog-generator@main
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: out/make/
merge-multiple: true
- name: Build Release
- name: Tag Release
uses: jaywcjlove/create-tag-action@main
id: tag_release
with:
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Release App
uses: softprops/action-gh-release@v2
if: steps.tag_release.outputs.successful
with:
tag_name: ${{ steps.tag_release.outputs.version }}
name: ${{ steps.tag_release.outputs.version }}
body: |
${{ steps.changelog.outputs.compareurl }}

${{ steps.changelog.outputs.changelog }}
- name: Release App to GitHub
uses: "marvinpinto/action-automatic-releases@latest"
files: ${{ github.workspace }}/artifacts/**/*

- name: Distribute Binaries to R2
if: steps.tag_release.outputs.successful
uses: ryand56/r2-upload-action@master
with:
prerelease: false
automatic_release_tag: ${{ steps.tag_release.outputs.version }}
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
LICENSE
out/make/**/*.{dmg,rpm,deb,Setup.exe}

# - name: Distribute artifacts to R2
# uses: ryand56/r2-upload-action@master
# if: steps.tag_release.outputs.successful
# with:
# r2-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# r2-access-key-id: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
# r2-secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
# r2-bucket: ${{ secrets.CLOUDFLARE_ARTIFACTS_R2 }}
# source-dir: out/make/
# destination-dir: dockit
r2-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.CLOUDFLARE_ARTIFACTS_R2 }}
source-dir: ${{ github.workspace }}/artifacts/
destination-dir: dockit
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,18 @@ data/
/.idea/
/dist/
/.vscode/
# Logs
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.0
v20.15.0
Binary file added app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading