修正保存逻辑和部分类型定义 #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 构建 Tauri 桌面版本 | |
on: | |
- push | |
- workflow_dispatch | |
jobs: | |
build-tauri: | |
name: 构建 Tauri 桌面版本 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-latest, ubuntu-20.04, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: 克隆仓库源代码 | |
uses: actions/[email protected] | |
with: | |
submodules: recursive | |
path: amll-ttml-tool | |
- name: 克隆 AMLL 仓库源代码 | |
uses: actions/[email protected] | |
with: | |
repository: Steve-xmh/applemusic-like-lyrics | |
ref: dev | |
submodules: recursive | |
path: applemusic-like-lyrics | |
- name: 缓存依赖项目 | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-cache | |
path: | | |
amll-ttml-tool/node_modules | |
amll-ttml-tool/src-tauri/target | |
amll-ttml-tool/.yarn/cache | |
amll-ttml-tool/.yarn/install-state.gz | |
applemusic-like-lyrics/node_modules | |
applemusic-like-lyrics/target | |
applemusic-like-lyrics/.yarn/cache | |
applemusic-like-lyrics/.yarn/install-state.gz | |
C:/Program Files/LLVM | |
./llvm | |
# macOS 自带的 Xcode LLVM 不支持 WASM 目标 | |
- name: "macOS: 安装 LLVM 和 Clang" | |
uses: KyleMayes/install-llvm-action@v1 | |
if: matrix.platform == 'macos-latest' | |
with: | |
version: "14" | |
- name: 配置 NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: 安装 Rust 工具链 | |
uses: dtolnay/rust-toolchain@stable | |
- name: 安装 wasm-pack | |
uses: jetli/[email protected] | |
with: | |
version: latest | |
- name: 安装 Tauri 所需系统依赖(仅 Linux) | |
if: matrix.platform == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: AMLL - 构建 WS Protocol 模块 | |
run: wasm-pack build --target bundler --release --scope applemusic-like-lyrics | |
working-directory: applemusic-like-lyrics/packages/ws-protocol | |
- name: AMLL - 构建 Lyric 模块 | |
run: wasm-pack build --target bundler --release --scope applemusic-like-lyrics | |
working-directory: applemusic-like-lyrics/packages/lyric | |
- name: AMLL - 安装依赖 | |
run: yarn | |
working-directory: applemusic-like-lyrics | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
- name: AMLL - 构建 Core 模块 | |
run: yarn build | |
working-directory: applemusic-like-lyrics/packages/core | |
- name: AMLL - 构建 Vue 模块 | |
run: yarn build | |
working-directory: applemusic-like-lyrics/packages/vue | |
- name: AMLL - 构建 TTML 模块 | |
run: yarn build | |
working-directory: applemusic-like-lyrics/packages/ttml | |
- name: 安装前端依赖 | |
run: yarn install | |
working-directory: amll-ttml-tool | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
- name: 构建 Tauri 程序 | |
uses: tauri-apps/tauri-action@v0 | |
with: | |
projectPath: amll-ttml-tool | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 上传产物到 Action Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: AMLL TTML Tool ${{runner.os}}-${{runner.arch}} | |
path: | | |
amll-ttml-tool/src-tauri/target/release/bundle/deb/*.deb | |
amll-ttml-tool/src-tauri/target/release/bundle/appimage/*.AppImage | |
amll-ttml-tool/src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz | |
amll-ttml-tool/src-tauri/target/release/bundle/msis/*.exe | |
amll-ttml-tool/src-tauri/target/release/bundle/msi/*.msi | |
amll-ttml-tool/src-tauri/target/release/bundle/dmg/*.dmg | |
amll-ttml-tool/src-tauri/target/release/bundle/macos/*.app | |
amll-ttml-tool/src-tauri/target/release/bundle/macos/*.app.tar.gz |