Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
itxve committed Dec 26, 2022
0 parents commit e3ad001
Show file tree
Hide file tree
Showing 81 changed files with 14,577 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# 可选,将显示在 GitHub 存储库的“操作”选项卡中的工作流名称
name: Release CI

# 指定此工作流的触发器
on:
push:
# 匹配特定标签 (refs/tags)
tags:
- "v*" # 推送事件匹配 v*, 例如 v1.0,v20.15.10 等来触发工作流

# 需要运行的作业组合
jobs:
# 任务:创建 release 版本
create-release:
runs-on: ubuntu-latest
outputs:
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}

steps:
- uses: actions/checkout@v3
# 查询版本号(tag)
- name: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:10}"
echo ::set-output name=version::"${GITHUB_REF:10}"
# 根据查询到的版本号创建 release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{ steps.get_version.outputs.VERSION }}"
release_name: "app ${{ steps.get_version.outputs.VERSION }}"
body: "See the assets to download this version and install."

# 编译 Tauri
build-tauri:
needs: create-release
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3

# 安装 Node.js
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
# 安装 Rust
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

# 使用 Rust 缓存,加快安装速度 (没感觉快)
- name: Rust-cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ runner.os }}-Rust

# ubuntu-latest webkit2gtk-4.0相关依赖
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# 安装依赖执行构建,以及推送 github release
- name: Install app dependencies and build it
run: pnpm i && pnpm build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}

updater:
runs-on: ubuntu-latest
needs: [create-release, build-tauri]
steps:
- uses: actions/checkout@v3
- run: yarn && yarn updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy install.json
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./updater
force_orphan: true
54 changes: 54 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 可选,将显示在 GitHub 存储库的“操作”选项卡中的工作流名称
name: Test Build CI

# 指定此工作流的触发器
on:
push:
# 匹配特定标签 (refs/tags)
tags:
- "t*" # 推送事件匹配 v*, 例如 v1.0,v20.15.10 等来触发工作流
workflow_dispatch:
inputs:
platform:
description: "platform"
required: true
default: "macos-latest"
type: choice
options:
- macos-latest
- windows-latest
- ubuntu-latest

# 需要运行的作业组合
jobs:
# 编译 Tauri
build-tauri:
runs-on: ${{ inputs.platform }}
steps:
- uses: actions/checkout@v3

# 安装 Node.js
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

# ubuntu-latest webkit2gtk-4.0相关依赖
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# 安装依赖执行构建,以及推送 github release
- name: Install app dependencies and build it
run: pnpm i && pnpm build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

<p align="center">
<img src="./app-icon.png" width="150" height="150" />
</p>

### 为什么有这个项目

- electron 版本的 live2d,软件占用太大了(近100M),tauri(5M),电脑内存太小放弃了electron
- tauri 没有 electron 那么完备的社区(太痛了)

### TODO

- 自建 模型 API 使用[已实现]
- 大小缩放[已实现]
- 开机自启动[已实现]
- 使用本地模型[喂实现,材质接口调试中]

### 已知问题

- mac 下出现窗口虚线,暂不知原因

# 免责声明

### 该软件仅用于个人学习使用

- 禁止商用或者非法用途.
- 禁止商用或者非法用途.
- 禁止商用或者非法用途.
10 changes: 10 additions & 0 deletions UPDATE_LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Updater Log
## v1.2.0
更换软件图标

## v1.1.0
增加系统托盘及快捷键退出,模块目录变更🚗

## v1.0.9
使用文件监视器更新列表

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.
60 changes: 60 additions & 0 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Generated by 'unplugin-auto-import'
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveDirective: typeof import('vue')['resolveDirective']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useDialog: typeof import('naive-ui')['useDialog']
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
const useMessage: typeof import('naive-ui')['useMessage']
const useNotification: typeof import('naive-ui')['useNotification']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
14 changes: 14 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module '@vue/runtime-core' {
export interface GlobalComponents {
Live2dConfig: typeof import('./src/components/Live2dConfig.vue')['default']
NFormItem: typeof import('naive-ui')['NFormItem']
NSpace: typeof import('naive-ui')['NSpace']
}
}
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + Vue + TS</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions live2d.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + Vue + TS</title>
</head>

<body>
<div id="live2d-app"></div>
<script type="module" src="src/live2d/App.ts"></script>
</body>

</html>
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "my-tauri-app",
"private": true,
"version": "1.0.0",
"type": "module",
"repo": "https://github.com/itxve/tauri-live2d",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"tauri": "tauri",
"tauri:dev": "RUST_BACKTRACE=full tauri dev",
"updater": "node scripts/updater.mjs",
"release": "node scripts/release.mjs"
},
"dependencies": {
"@rollup/plugin-inject": "^5.0.3",
"@tauri-apps/api": "^1.1.0",
"@types/lodash": "^4.14.191",
"jquery": "^3.6.3",
"vue": "^3.2.37"
},
"devDependencies": {
"@actions/github": "^5.1.0",
"@rollup/plugin-alias": "^4.0.2",
"@tauri-apps/cli": "^1.1.0",
"@types/node": "^18.7.10",
"@vitejs/plugin-vue": "^3.0.1",
"naive-ui": "^2.34.2",
"node-fetch": "^3.2.10",
"typescript": "^4.6.4",
"unplugin-auto-import": "^0.12.0",
"unplugin-vue-components": "^0.22.11",
"vite": "^3.0.2",
"vue-tsc": "^1.0.0"
}
}
Loading

0 comments on commit e3ad001

Please sign in to comment.