Skip to content

番茄小说作家 #956

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
272 changes: 138 additions & 134 deletions .github/workflows/pake-cli.yaml
Original file line number Diff line number Diff line change
@@ -1,157 +1,161 @@
name: Build App With Pake CLI
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform'
required: true
default: 'macos-latest'
type: choice
options:
名字:名称:使用 Pake CLI 构建应用程序


输入:
平台:
描述:'Windows'
必需: 真
默认:'macos-latest'
类型:
类型:选择
选项:
- 'windows-latest'
- 'macos-latest'
- 'ubuntu-24.04'
url:
description: 'URL'
required: true
name:
description: 'Name, English, Linux no capital'
required: true
icon:
description: 'Icon, Image URL, Optional'
required: false
width:
description: 'Width, Optional'
required: false
default: '1200'
height:
description: 'Height, Optional'
required: false
default: '780'
fullscreen:
description: 'Fullscreen, At startup, Optional'
required: false
type: boolean
default: false
hide_title_bar:
description: 'Hide TitleBar, MacOS only, Optional'
required: false
type: boolean
default: false
multi_arch:
description: 'MultiArch, MacOS only, Optional'
required: false
type: boolean
default: false
targets:
description: 'Targets, Linux only, Optional'
required: false
default: 'deb'
type: choice
options:
地址:
描述:'https://fanqienovel.com/main/writer/login'
必需: 真

描述:'番茄小说作家,英语,Linux 不区分大小写'
必需: 真

描述:‘图标,图片链接,可选’
必需: 否
宽度:
描述:'宽度,可选'
必需: 否
默认: '1200'
高度:
描述:高度,可选
必需: 否
默认: '780'
全屏:
描述:'全屏,启动时,可选'
必需: 否
类型: 类型:布尔值
默认: false

: '隐藏标题栏,仅限 MacOS,可选'
必需: 否
类型: 类型:布尔值
默认: false
多架构:
描述:'多架构,仅限 MacOS,可选'
必需: 否
类型:
类型:布尔值
默认: false
目标:
描述:'目标,仅限 Linux,可选'
必需: 否
默认: 'deb'
类型:
类型:选择
选项:
- 'deb'
- 'appimage'
- 'rpm'

jobs:
build:
name: ${{ inputs.platform }}
runs-on: ${{ inputs.platform }}
strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Rust for ubuntu-24.04
if: inputs.platform == 'ubuntu-24.04'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-unknown-linux-musl

- name: Install Rust for windows-latest
if: inputs.platform == 'windows-latest'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-x86_64-msvc
target: x86_64-pc-windows-msvc

- name: Install Rust for macos-latest
if: inputs.platform == 'macos-latest'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-apple-darwin

- name: Install dependencies (ubuntu only)
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: Install pake-cli local
shell: bash
run: |
echo "install pake on local"
工作:
构建:
名称: 名称: ${{ inputs.platform }}{{ inputs.platform }}
runs-on: 运行于: ${{ inputs.platform }}{{ 输入平台 }}
策略:
快速失败:假

步骤输入:
- 名字: - 名称: 检出仓库
uses: 用途:actions/checkout@v3

- 名称: - 名称: 安装节点
uses: 用途:actions/setup-node@v3
与:
节点版本: 18

- 名称: - 名称: 安装 Rust 用于 ubuntu-24.04
如果 如果 输入的平台 == 'ubuntu-24.04''ubuntu-24.04'
使用: 使用: dtolnay/rust-toolchain@稳定
与:
toolchain: toolchain: 稳定
target: 目标: x86_64-unknown-linux-musl

- 名称: - 名称:安装 Rust 用于 windows-latest
如果 如果 输入的平台 == 'windows-latest''windows-latest''windows-latest'
使用: 使用: 使用: dtolnay/rust-toolchain@稳定: dtolnay/rust-toolchain@稳定
与:
toolchain: 工具链:稳定-x86_64-msvc
target: 目标: x86_64-pc-windows-msvc: x86_64-pc-windows-msvc

- 名字: -
- 名称: 安装 Rust 用于 macos-latest: 安装 Rust 用于 macos-latest
如果: 如果: 如果:inputs.platform == 'macos-latest':inputs.platform == 'macos-latest''macos-latest'
使用: 使用: dtolnay/rust-toolchain@稳定
与:
toolchain: toolchain: 稳定
target: 目标: x86_64-apple-darwin

- name: - name: 安装依赖项(仅限 Ubuntu)
如果 如果 输入的平台 == 'ubuntu-24.04''ubuntu-24.04'
uses: 用途: awalsh128/[email protected]
与:
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
版本:1.1

- 名称: - 名称: 本地安装 番茄写作
外壳: 外壳: bash
运行: |
echo “在本地安装 pake”
npm install pake-cli

- name: Rust cache restore
uses: actions/cache/restore@v3
id: cache_store
with:
path: |
- 名字: - name: Rust 缓存恢复
uses: 用途: actions/cache/restore@v3
id: id: 缓存存储
与:
路径: |
~/.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') }}
key: key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}{{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}

- name: Install dependencies
run: |
npm install shelljs
- 名称: - 名称:安装依赖项
运行: |
npm 安装 shelljs
npm install axios

- name: Build with pake-cli
run: |
- 名称: - 名称: 使用 pake-cli 构建
运行: |
node ./script/build_with_pake_cli.js
env:
URL: ${{ inputs.url }}
NAME: ${{ inputs.name }}
ICON: ${{ inputs.icon }}
HEIGHT: ${{ inputs.height }}
WIDTH: ${{ inputs.width }}
HIDE_TITLE_BAR: ${{ inputs.hide_title_bar }}
FULLSCREEN: ${{ inputs.fullscreen }}
MULTI_ARCH: ${{ inputs.multi_arch }}
TARGETS: ${{ inputs.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: Upload archive
uses: actions/upload-artifact@v4
with:
name: output-${{ inputs.platform }}.zip
path: node_modules/pake-cli/output/*
retention-days: 3

- name: Rust cache store
uses: actions/cache/save@v3
if: steps.cache_store.outputs.cache-hit != 'true'
with:
path: |
环境:
URL: URL: ${{ inputs.url }}{{ inputs.url }}
名称: 名字: ${{ inputs.name }}{{ inputs.name }}
ICON: 图标:${ inputs.icon }}{{ inputs.icon }}
高度:${{ inputs.height }}{{ inputs.height }}
宽度 宽度:${{ inputs.width }}{{ inputs.width }}
HIDE_TITLE_BAR: 隐藏标题栏: ${{ inputs.hide_title_bar }}{{ inputs.hide_title_bar }}
全屏: 全屏:${{ inputs.fullscreen }}{{ inputs.fullscreen }}
多架构: 多架构: ${{ inputs multi_arch }}{{ inputs multi_arch }}
目标: 目标:${{ inputs.targets }}{{ inputs.targets }}
PKG_CONFIG_PATH: PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:/usr/share/pkgconfig
PKG_CONFIG_ALLOW_SYSTEM_LIBS1
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS1

- 名称: - 名称: 上传档案
uses: 用途:actions/upload-artifact@v4
与:
名字: 名字:输出-${{ inputs.platform }}.zip{{ inputs.platform }}.zip
路径: 路径:node_modules/pake-cli/output/*
保留天数:3

- 名称: - 名称: Rust 缓存存储
使用: 使用: actions/cache/save@v3
如果 如果 steps.cache_store.outputs.cache-hit 不等于 'true''真'
与:
路径: |
~/.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') }}
key: {{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}