|
@@ -17,53 +17,116 @@ permissions:
|
|
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
|
build-app:
|
|
build-app:
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
|
|
|
+ name: 编译客户端(${{ matrix.os }})
|
|
|
|
|
+ runs-on: ${{ matrix.os }}
|
|
|
env:
|
|
env:
|
|
|
- TZ: Asia/Shanghai
|
|
|
|
|
|
|
+ HTML_PATH: './client/index.html'
|
|
|
|
|
+ NAME: 'yaa'
|
|
|
|
|
+ ICON: './assets/yaa_512.png'
|
|
|
|
|
+ INSTALLER_LANGUAGE: zh-CN
|
|
|
|
|
+ TARGETS: 'appimage'
|
|
|
|
|
+ strategy:
|
|
|
|
|
+ matrix:
|
|
|
|
|
+ build: [linux, macos, windows]
|
|
|
|
|
+ include:
|
|
|
|
|
+ - build: linux
|
|
|
|
|
+ os: ubuntu-latest
|
|
|
|
|
+ - build: windows
|
|
|
|
|
+ os: windows-latest
|
|
|
|
|
+ - build: macos
|
|
|
|
|
+ os: macos-latest
|
|
|
|
|
+
|
|
|
steps:
|
|
steps:
|
|
|
|
|
|
|
|
- - name: 检出仓库
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
-
|
|
|
|
|
- - name: 安装依赖
|
|
|
|
|
- run: |
|
|
|
|
|
- sudo apt install -y libdbus-1-dev \
|
|
|
|
|
- libsoup3.0-dev \
|
|
|
|
|
- libjavascriptcoregtk-4.1-dev \
|
|
|
|
|
- libwebkit2gtk-4.1-dev \
|
|
|
|
|
- build-essential \
|
|
|
|
|
- curl \
|
|
|
|
|
- wget \
|
|
|
|
|
- libssl-dev \
|
|
|
|
|
- libgtk-3-dev \
|
|
|
|
|
- libayatana-appindicator3-dev \
|
|
|
|
|
- librsvg2-dev \
|
|
|
|
|
- gnome-video-effects \
|
|
|
|
|
- gnome-video-effects-extra
|
|
|
|
|
-
|
|
|
|
|
- - name: 配置 Node.js
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
|
- with:
|
|
|
|
|
- node-version: '16.x'
|
|
|
|
|
-
|
|
|
|
|
- - name: 安装 Pake
|
|
|
|
|
- run: |
|
|
|
|
|
- npm install -g pake-cli && pake --version
|
|
|
|
|
-
|
|
|
|
|
- - name: 编译客户端
|
|
|
|
|
- run: |
|
|
|
|
|
- YAA_VERSION=$(grep '^version' ./Cargo.toml | awk -F= '{print $2}' | tr -d '" ')
|
|
|
|
|
- mkdir -p target && mkdir -p target/client
|
|
|
|
|
- cd target/client
|
|
|
|
|
- pake ../../client/index.html \
|
|
|
|
|
- -name yaa \
|
|
|
|
|
- --icon ../../assets/yaa_512.png \
|
|
|
|
|
- --installer-language zh-CN \
|
|
|
|
|
- --app-version $YAA_VERSION \
|
|
|
|
|
- --use-local-file
|
|
|
|
|
- cd ../..
|
|
|
|
|
-
|
|
|
|
|
- - name: 上传包
|
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
|
- with:
|
|
|
|
|
- path: 'target/client/*/*.*'
|
|
|
|
|
|
|
+ - name: 检出仓库
|
|
|
|
|
+ uses: actions/checkout@v4
|
|
|
|
|
+
|
|
|
|
|
+ - name: 安装 Node.js
|
|
|
|
|
+ uses: actions/setup-node@v3
|
|
|
|
|
+ with:
|
|
|
|
|
+ node-version: 18
|
|
|
|
|
+
|
|
|
|
|
+ - name: 为 ubuntu-latest 安装 Rust
|
|
|
|
|
+ if: inputs.platform == 'ubuntu-latest'
|
|
|
|
|
+ uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
+ with:
|
|
|
|
|
+ toolchain: stable
|
|
|
|
|
+ target: x86_64-unknown-linux-musl
|
|
|
|
|
+
|
|
|
|
|
+ - name: 为 windows-latest 安装 Rust
|
|
|
|
|
+ if: inputs.platform == 'windows-latest'
|
|
|
|
|
+ uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
+ with:
|
|
|
|
|
+ toolchain: stable-x86_64-msvc
|
|
|
|
|
+ target: x86_64-pc-windows-msvc
|
|
|
|
|
+
|
|
|
|
|
+ - name: 为 macos-latest 安装 Rust
|
|
|
|
|
+ if: inputs.platform == 'macos-latest'
|
|
|
|
|
+ uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
+ with:
|
|
|
|
|
+ toolchain: stable
|
|
|
|
|
+ target: x86_64-apple-darwin
|
|
|
|
|
+
|
|
|
|
|
+ - name: 安装依赖(仅 Ubuntu 需)
|
|
|
|
|
+ if: inputs.platform == 'ubuntu-24.04'
|
|
|
|
|
+ uses: awalsh128/[email protected]
|
|
|
|
|
+ with:
|
|
|
|
|
+ packages: libsoup3.0-dev libdbus-1-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
|
|
|
|
|
+ version: 1.1
|
|
|
|
|
+
|
|
|
|
|
+ - name: 安装 pake-cli
|
|
|
|
|
+ run: |
|
|
|
|
|
+ npm install pake-cli
|
|
|
|
|
+
|
|
|
|
|
+ - name: 恢复 Rust 缓存
|
|
|
|
|
+ uses: actions/cache/restore@v3
|
|
|
|
|
+ id: cache_store
|
|
|
|
|
+ with:
|
|
|
|
|
+ path: |
|
|
|
|
|
+ ~/.cargo/bin/
|
|
|
|
|
+ ~/.cargo/registry/index/
|
|
|
|
|
+ ~/.cargo/registry/cache/
|
|
|
|
|
+ ~/.cargo/git/db/
|
|
|
|
|
+ node_modules/pake-cli/src-tauri/target/
|
|
|
|
|
+ key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
|
|
|
|
+
|
|
|
|
|
+ - name: 安装依赖
|
|
|
|
|
+ run: |
|
|
|
|
|
+ npm install shelljs
|
|
|
|
|
+ npm install axios
|
|
|
|
|
+
|
|
|
|
|
+ - name: 编译客户端
|
|
|
|
|
+ run: |
|
|
|
|
|
+ node ./script/build_with_pake_cli.js
|
|
|
|
|
+ env:
|
|
|
|
|
+ URL: ${{ env.HTML_PATH }}
|
|
|
|
|
+ NAME: ${{ env.NAME }}
|
|
|
|
|
+ ICON: ${{ env.ICON }}
|
|
|
|
|
+ HEIGHT: '780'
|
|
|
|
|
+ WIDTH: '1200'
|
|
|
|
|
+ HIDE_TITLE_BAR: false
|
|
|
|
|
+ FULLSCREEN: false
|
|
|
|
|
+ MULTI_ARCH: false
|
|
|
|
|
+ TARGETS: ${{ env.TARGETS }}
|
|
|
|
|
+ PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
|
|
|
|
|
+ PKG_CONFIG_ALLOW_SYSTEM_LIBS: 1
|
|
|
|
|
+ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1
|
|
|
|
|
+
|
|
|
|
|
+ - name: 上传包
|
|
|
|
|
+ uses: actions/upload-artifact@v4
|
|
|
|
|
+ with:
|
|
|
|
|
+ name: output-${{ inputs.platform }}.zip
|
|
|
|
|
+ path: node_modules/pake-cli/output/*
|
|
|
|
|
+ retention-days: 3
|
|
|
|
|
+
|
|
|
|
|
+ - name: 保存 Rust 缓存
|
|
|
|
|
+ uses: actions/cache/save@v3
|
|
|
|
|
+ if: steps.cache_store.outputs.cache-hit != 'true'
|
|
|
|
|
+ with:
|
|
|
|
|
+ path: |
|
|
|
|
|
+ ~/.cargo/bin/
|
|
|
|
|
+ ~/.cargo/registry/index/
|
|
|
|
|
+ ~/.cargo/registry/cache/
|
|
|
|
|
+ ~/.cargo/git/db/
|
|
|
|
|
+ node_modules/pake-cli/src-tauri/target/
|
|
|
|
|
+ key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|