Merge branch 'kwaroran:main' into main
This commit is contained in:
87
.github/workflows/github-actions-builder.yml
vendored
87
.github/workflows/github-actions-builder.yml
vendored
@@ -3,6 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- production
|
- production
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-tauri:
|
publish-tauri:
|
||||||
@@ -11,9 +12,18 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest,macos-latest,windows-latest]
|
# platform: [ubuntu-latest,macos-latest,windows-latest]
|
||||||
|
settings:
|
||||||
|
- platform: 'macos-latest' # for Arm based macs (M1 and above).
|
||||||
|
args: '--target aarch64-apple-darwin'
|
||||||
|
- platform: 'macos-latest' # for Intel based macs.
|
||||||
|
args: '--target x86_64-apple-darwin'
|
||||||
|
- platform: 'ubuntu-latest' # for Tauri v1 you could replace this with ubuntu-20.04.
|
||||||
|
args: '--target x86_64-unknown-linux-gnu'
|
||||||
|
- platform: 'windows-latest'
|
||||||
|
args: '--target x86_64-pc-windows-msvc'
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.settings.platform }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: setup node
|
- name: setup node
|
||||||
@@ -21,7 +31,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 21
|
node-version: 21
|
||||||
- id: set_var_win
|
- id: set_var_win
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.settings.platform == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
choco install jq -y
|
choco install jq -y
|
||||||
- id: set_var
|
- id: set_var
|
||||||
@@ -33,7 +43,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.settings.platform == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
||||||
@@ -51,61 +61,20 @@ jobs:
|
|||||||
${{ runner.os }}-pnpm-store-
|
${{ runner.os }}-pnpm-store-
|
||||||
- name: install frontend dependencies
|
- name: install frontend dependencies
|
||||||
run: pnpm install --no-frozen-lockfile # change this to npm or pnpm depending on which one you use
|
run: pnpm install --no-frozen-lockfile # change this to npm or pnpm depending on which one you use
|
||||||
- if: matrix.platform == 'ubuntu-latest'
|
- if: matrix.settings.platform == 'macos-latest'
|
||||||
run: pnpm tauri build --target x86_64-unknown-linux-gnu
|
|
||||||
- if: matrix.platform == 'ubuntu-latest'
|
|
||||||
uses: "softprops/action-gh-release@v2"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "latest"
|
|
||||||
tag_name: "v${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
name: "${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
generate_release_notes: true
|
|
||||||
files: |
|
|
||||||
src-tauri/target/x86_64-unknown-linux-gnu/release/**/*.deb
|
|
||||||
src-tauri/target/x86_64-unknown-linux-gnu/release/**/*.AppImage
|
|
||||||
- if: matrix.platform == 'macos-latest'
|
|
||||||
run: rustup target add x86_64-apple-darwin
|
run: rustup target add x86_64-apple-darwin
|
||||||
- if: matrix.platform == 'macos-latest'
|
- if: matrix.settings.platform == 'macos-latest'
|
||||||
run: pnpm tauri build --target x86_64-apple-darwin
|
|
||||||
- if: matrix.platform == 'macos-latest'
|
|
||||||
run: rustup target add aarch64-apple-darwin
|
run: rustup target add aarch64-apple-darwin
|
||||||
- if: matrix.platform == 'macos-latest'
|
- uses: tauri-apps/tauri-action@v0
|
||||||
run: pnpm tauri build --target aarch64-apple-darwin
|
env:
|
||||||
- if: matrix.platform == 'macos-latest'
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
uses: "softprops/action-gh-release@v2"
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||||
|
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
tagName: 'v__VERSION__' # the action automatically replaces \_\_VERSION\_\_ with the app version.
|
||||||
automatic_release_tag: "latest"
|
releaseName: 'v__VERSION__'
|
||||||
tag_name: "v${{fromJson(env.VERSION_JSON).version}}"
|
releaseBody: 'Release of v__VERSION__'
|
||||||
name: "${{fromJson(env.VERSION_JSON).version}}"
|
releaseDraft: true
|
||||||
generate_release_notes: true
|
prerelease: false
|
||||||
files: |
|
args: ${{ matrix.settings.args }}
|
||||||
src-tauri/target/*/release/bundle/macos/*.app
|
tauriScript: "pnpm tauri"
|
||||||
src-tauri/target/*/release/bundle/dmg/*.dmg
|
|
||||||
- if: matrix.platform == 'windows-latest'
|
|
||||||
run: pnpm tauri build
|
|
||||||
- if: matrix.platform == 'windows-latest'
|
|
||||||
uses: "softprops/action-gh-release@v2"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "latest"
|
|
||||||
tag_name: "v${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
name: "${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
generate_release_notes: true
|
|
||||||
files: |
|
|
||||||
src-tauri/target/x86_64-pc-windows-msvc/release/**/*.msi
|
|
||||||
# publish dist as zip when building on ubuntu
|
|
||||||
# first, zip the dist
|
|
||||||
- if: matrix.platform == 'ubuntu-latest'
|
|
||||||
run: zip -r built_code.zip dist
|
|
||||||
# then, publish the zip file
|
|
||||||
- if: matrix.platform == 'ubuntu-latest'
|
|
||||||
uses: "softprops/action-gh-release@v2"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "latest"
|
|
||||||
tag_name: "v${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
name: "${{fromJson(env.VERSION_JSON).version}}"
|
|
||||||
generate_release_notes: true
|
|
||||||
files: built_code.zip
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -39,3 +39,4 @@ vite.config.ts.timestamp-*
|
|||||||
raise.code-workspace
|
raise.code-workspace
|
||||||
recc.md
|
recc.md
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
.tauri/
|
||||||
@@ -8,7 +8,7 @@ android {
|
|||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 2
|
versionCode 2
|
||||||
versionName "114.2.2"
|
versionName "114.3.0"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 2,
|
"versionCode": 2,
|
||||||
"versionName": "114.2.2",
|
"versionName": "114.3.0",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
10
src-tauri/Cargo.lock
generated
10
src-tauri/Cargo.lock
generated
@@ -1784,6 +1784,12 @@ version = "0.3.17"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "minisign-verify"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
@@ -3298,6 +3304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "f078117725e36d55d29fafcbb4b1e909073807ca328ae8deb8c0b3843aac0fed"
|
checksum = "f078117725e36d55d29fafcbb4b1e909073807ca328ae8deb8c0b3843aac0fed"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"base64 0.21.7",
|
||||||
"bytes",
|
"bytes",
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"dirs-next",
|
"dirs-next",
|
||||||
@@ -3313,6 +3320,7 @@ dependencies = [
|
|||||||
"http",
|
"http",
|
||||||
"ignore",
|
"ignore",
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
|
"minisign-verify",
|
||||||
"objc",
|
"objc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"open",
|
"open",
|
||||||
@@ -3337,12 +3345,14 @@ dependencies = [
|
|||||||
"tauri-utils",
|
"tauri-utils",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
"webkit2gtk",
|
"webkit2gtk",
|
||||||
"webview2-com",
|
"webview2-com",
|
||||||
"windows 0.39.0",
|
"windows 0.39.0",
|
||||||
|
"zip",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ edition = "2021"
|
|||||||
tauri-build = { version = "1.4.0", features = [] }
|
tauri-build = { version = "1.4.0", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "1.6.0", features = ["app-all", "dialog-all", "fs-all", "http-all", "os-all", "path-all", "process-relaunch", "protocol-all", "reqwest-client", "shell-open", "window-maximize", "window-set-fullscreen"] }
|
tauri = { version = "1.6.0", features = [ "updater", "app-all", "dialog-all", "fs-all", "http-all", "os-all", "path-all", "process-relaunch", "protocol-all", "reqwest-client", "shell-open", "window-maximize", "window-set-fullscreen"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tiktoken-rs = "0.4.0"
|
tiktoken-rs = "0.4.0"
|
||||||
base64 = "0.21.0"
|
base64 = "0.21.0"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "RisuAI",
|
"productName": "RisuAI",
|
||||||
"version": "114.2.2"
|
"version": "114.3.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
@@ -96,7 +96,13 @@
|
|||||||
"csp": null
|
"csp": null
|
||||||
},
|
},
|
||||||
"updater": {
|
"updater": {
|
||||||
"active": false
|
"active": true,
|
||||||
|
"endpoints": ["https://github.com/kwaroran/RisuAI/releases/latest/download/latest.json"],
|
||||||
|
"dialog": false,
|
||||||
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDU2ODMzOTIxMDMxOTY1MUYKUldRZlpSa0RJVG1EVmx5Vm1WYlhFM29HMEJrUTRrYmg5dDQ0RFpvdUphNDdxQmVlWXJHVmV5TEYK",
|
||||||
|
"windows": {
|
||||||
|
"installMode": "passive"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';
|
|||||||
|
|
||||||
export const DataBase = writable({} as any as Database)
|
export const DataBase = writable({} as any as Database)
|
||||||
export const loadedStore = writable(false)
|
export const loadedStore = writable(false)
|
||||||
export let appVer = "114.2.2"
|
export let appVer = "114.3.0"
|
||||||
export let webAppSubVer = ''
|
export let webAppSubVer = ''
|
||||||
|
|
||||||
export function setDatabase(data:Database){
|
export function setDatabase(data:Database){
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { get } from "svelte/store";
|
|||||||
import {open} from '@tauri-apps/api/shell'
|
import {open} from '@tauri-apps/api/shell'
|
||||||
import { DataBase, loadedStore, setDatabase, type Database, defaultSdDataFunc } from "./database";
|
import { DataBase, loadedStore, setDatabase, type Database, defaultSdDataFunc } from "./database";
|
||||||
import { appWindow } from "@tauri-apps/api/window";
|
import { appWindow } from "@tauri-apps/api/window";
|
||||||
import { checkUpdate } from "../update";
|
import { checkRisuUpdate } from "../update";
|
||||||
import { botMakerMode, selectedCharID } from "../stores";
|
import { botMakerMode, selectedCharID } from "../stores";
|
||||||
import { Body, ResponseType, fetch as TauriFetch } from "@tauri-apps/api/http";
|
import { Body, ResponseType, fetch as TauriFetch } from "@tauri-apps/api/http";
|
||||||
import { loadPlugins } from "../plugins/plugins";
|
import { loadPlugins } from "../plugins/plugins";
|
||||||
@@ -419,7 +419,7 @@ export async function loadData() {
|
|||||||
throw "Your save file is corrupted"
|
throw "Your save file is corrupted"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await checkUpdate()
|
await checkRisuUpdate()
|
||||||
await changeFullscreen()
|
await changeFullscreen()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,30 @@
|
|||||||
import { fetch } from "@tauri-apps/api/http";
|
import { alertConfirm, alertWait } from "./alert";
|
||||||
import { DataBase, appVer, setDatabase } from "./storage/database";
|
|
||||||
import { alertConfirm, alertError, alertMd } from "./alert";
|
|
||||||
import { language } from "../lang";
|
import { language } from "../lang";
|
||||||
import { get } from "svelte/store";
|
|
||||||
import {open} from '@tauri-apps/api/shell'
|
|
||||||
import { Capacitor } from "@capacitor/core";
|
import { Capacitor } from "@capacitor/core";
|
||||||
|
import {
|
||||||
|
checkUpdate,
|
||||||
|
installUpdate,
|
||||||
|
} from '@tauri-apps/api/updater'
|
||||||
|
import { relaunch } from '@tauri-apps/api/process'
|
||||||
|
|
||||||
export async function checkUpdate(){
|
export async function checkRisuUpdate(){
|
||||||
try {
|
|
||||||
|
|
||||||
if(Capacitor.isNativePlatform()){
|
if(Capacitor.isNativePlatform()){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let db = get(DataBase)
|
try {
|
||||||
const da = await fetch('https://raw.githubusercontent.com/kwaroran/RisuAI-release/main/version.json')
|
const checked = await checkUpdate()
|
||||||
//@ts-ignore
|
if(checked.shouldUpdate){
|
||||||
const v:string = da.data.version
|
|
||||||
if(!v){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(v === db.lastup){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const nextVer = versionStringToNumber(v)
|
|
||||||
if(isNaN(nextVer) || (!nextVer)){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const appVerNum = versionStringToNumber(appVer)
|
|
||||||
|
|
||||||
if(appVerNum < nextVer){
|
|
||||||
const conf = await alertConfirm(language.newVersion)
|
const conf = await alertConfirm(language.newVersion)
|
||||||
if(conf){
|
if(conf){
|
||||||
open("https://risuai.net/?page=download")
|
alertWait(`Updating to ${checked.manifest.version}...`)
|
||||||
}
|
await installUpdate()
|
||||||
else{
|
await relaunch()
|
||||||
db = get(DataBase)
|
|
||||||
db.lastup = v
|
|
||||||
setDatabase(db)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alertError(error)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":"114.2.2"}
|
{"version":"114.3.0"}
|
||||||
Reference in New Issue
Block a user