Skip to content

Commit 9cef2bb

Browse files
authored
Update pake-cli.yaml
Signed-off-by: yutoo888 <[email protected]>
1 parent 98fe6f6 commit 9cef2bb

File tree

1 file changed

+138
-134
lines changed

1 file changed

+138
-134
lines changed

.github/workflows/pake-cli.yaml

+138-134
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,161 @@
1-
name: Build App With Pake CLI
2-
on:
3-
workflow_dispatch:
4-
inputs:
5-
platform:
6-
description: 'Platform'
7-
required: true
8-
default: 'macos-latest'
9-
type: choice
10-
options:
1+
名字:名称:使用 Pake CLI 构建应用程序
2+
3+
4+
输入:
5+
平台:
6+
描述:'Windows'
7+
必需: 真
8+
默认:'macos-latest'
9+
类型:
10+
类型:选择
11+
选项:
1112
- 'windows-latest'
1213
- 'macos-latest'
1314
- 'ubuntu-24.04'
14-
url:
15-
description: 'URL'
16-
required: true
17-
name:
18-
description: 'Name, English, Linux no capital'
19-
required: true
20-
icon:
21-
description: 'Icon, Image URL, Optional'
22-
required: false
23-
width:
24-
description: 'Width, Optional'
25-
required: false
26-
default: '1200'
27-
height:
28-
description: 'Height, Optional'
29-
required: false
30-
default: '780'
31-
fullscreen:
32-
description: 'Fullscreen, At startup, Optional'
33-
required: false
34-
type: boolean
35-
default: false
36-
hide_title_bar:
37-
description: 'Hide TitleBar, MacOS only, Optional'
38-
required: false
39-
type: boolean
40-
default: false
41-
multi_arch:
42-
description: 'MultiArch, MacOS only, Optional'
43-
required: false
44-
type: boolean
45-
default: false
46-
targets:
47-
description: 'Targets, Linux only, Optional'
48-
required: false
49-
default: 'deb'
50-
type: choice
51-
options:
15+
地址:
16+
描述:'https://fanqienovel.com/main/writer/login'
17+
必需: 真
18+
19+
描述:'番茄小说作家,英语,Linux 不区分大小写'
20+
必需: 真
21+
22+
描述:‘图标,图片链接,可选’
23+
必需: 否
24+
宽度:
25+
描述:'宽度,可选'
26+
必需: 否
27+
默认: '1200'
28+
高度:
29+
描述:高度,可选
30+
必需: 否
31+
默认: '780'
32+
全屏:
33+
描述:'全屏,启动时,可选'
34+
必需: 否
35+
类型: 类型:布尔值
36+
默认: false
37+
38+
: '隐藏标题栏,仅限 MacOS,可选'
39+
必需: 否
40+
类型: 类型:布尔值
41+
默认: false
42+
多架构:
43+
描述:'多架构,仅限 MacOS,可选'
44+
必需: 否
45+
类型:
46+
类型:布尔值
47+
默认: false
48+
目标:
49+
描述:'目标,仅限 Linux,可选'
50+
必需: 否
51+
默认: 'deb'
52+
类型:
53+
类型:选择
54+
选项:
5255
- 'deb'
5356
- 'appimage'
5457
- 'rpm'
5558

56-
jobs:
57-
build:
58-
name: ${{ inputs.platform }}
59-
runs-on: ${{ inputs.platform }}
60-
strategy:
61-
fail-fast: false
62-
63-
steps:
64-
- name: Checkout repository
65-
uses: actions/checkout@v3
66-
67-
- name: Install node
68-
uses: actions/setup-node@v3
69-
with:
70-
node-version: 18
71-
72-
- name: Install Rust for ubuntu-24.04
73-
if: inputs.platform == 'ubuntu-24.04'
74-
uses: dtolnay/rust-toolchain@stable
75-
with:
76-
toolchain: stable
77-
target: x86_64-unknown-linux-musl
78-
79-
- name: Install Rust for windows-latest
80-
if: inputs.platform == 'windows-latest'
81-
uses: dtolnay/rust-toolchain@stable
82-
with:
83-
toolchain: stable-x86_64-msvc
84-
target: x86_64-pc-windows-msvc
85-
86-
- name: Install Rust for macos-latest
87-
if: inputs.platform == 'macos-latest'
88-
uses: dtolnay/rust-toolchain@stable
89-
with:
90-
toolchain: stable
91-
target: x86_64-apple-darwin
92-
93-
- name: Install dependencies (ubuntu only)
94-
if: inputs.platform == 'ubuntu-24.04'
95-
uses: awalsh128/[email protected]
96-
with:
97-
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
98-
version: 1.1
99-
100-
- name: Install pake-cli local
101-
shell: bash
102-
run: |
103-
echo "install pake on local"
59+
工作:
60+
构建:
61+
名称: 名称: ${{ inputs.platform }}{{ inputs.platform }}
62+
runs-on: 运行于: ${{ inputs.platform }}{{ 输入平台 }}
63+
策略:
64+
快速失败:假
65+
66+
步骤输入:
67+
- 名字: - 名称: 检出仓库
68+
uses: 用途:actions/checkout@v3
69+
70+
- 名称: - 名称: 安装节点
71+
uses: 用途:actions/setup-node@v3
72+
与:
73+
节点版本: 18
74+
75+
- 名称: - 名称: 安装 Rust 用于 ubuntu-24.04
76+
如果 如果 输入的平台 == 'ubuntu-24.04''ubuntu-24.04'
77+
使用: 使用: dtolnay/rust-toolchain@稳定
78+
与:
79+
toolchain: toolchain: 稳定
80+
target: 目标: x86_64-unknown-linux-musl
81+
82+
- 名称: - 名称:安装 Rust 用于 windows-latest
83+
如果 如果 输入的平台 == 'windows-latest''windows-latest''windows-latest'
84+
使用: 使用: 使用: dtolnay/rust-toolchain@稳定: dtolnay/rust-toolchain@稳定
85+
与:
86+
toolchain: 工具链:稳定-x86_64-msvc
87+
target: 目标: x86_64-pc-windows-msvc: x86_64-pc-windows-msvc
88+
89+
- 名字: -
90+
- 名称: 安装 Rust 用于 macos-latest: 安装 Rust 用于 macos-latest
91+
如果: 如果: 如果:inputs.platform == 'macos-latest':inputs.platform == 'macos-latest''macos-latest'
92+
使用: 使用: dtolnay/rust-toolchain@稳定
93+
与:
94+
toolchain: toolchain: 稳定
95+
target: 目标: x86_64-apple-darwin
96+
97+
- name: - name: 安装依赖项(仅限 Ubuntu)
98+
如果 如果 输入的平台 == 'ubuntu-24.04''ubuntu-24.04'
99+
uses: 用途: awalsh128/[email protected]
100+
与:
101+
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
102+
版本:1.1
103+
104+
- 名称: - 名称: 本地安装 番茄写作
105+
外壳: 外壳: bash
106+
运行: |
107+
echo “在本地安装 pake”
104108
npm install pake-cli
105109

106-
- name: Rust cache restore
107-
uses: actions/cache/restore@v3
108-
id: cache_store
109-
with:
110-
path: |
110+
- 名字: - name: Rust 缓存恢复
111+
uses: 用途: actions/cache/restore@v3
112+
id: id: 缓存存储
113+
与:
114+
路径: |
111115
~/.cargo/bin/
112116
~/.cargo/registry/index/
113117
~/.cargo/registry/cache/
114118
~/.cargo/git/db/
115119
node_modules/pake-cli/src-tauri/target/
116-
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
120+
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') }}
117121

118-
- name: Install dependencies
119-
run: |
120-
npm install shelljs
122+
- 名称: - 名称:安装依赖项
123+
运行: |
124+
npm 安装 shelljs
121125
npm install axios
122126

123-
- name: Build with pake-cli
124-
run: |
127+
- 名称: - 名称: 使用 pake-cli 构建
128+
运行: |
125129
node ./script/build_with_pake_cli.js
126-
env:
127-
URL: ${{ inputs.url }}
128-
NAME: ${{ inputs.name }}
129-
ICON: ${{ inputs.icon }}
130-
HEIGHT: ${{ inputs.height }}
131-
WIDTH: ${{ inputs.width }}
132-
HIDE_TITLE_BAR: ${{ inputs.hide_title_bar }}
133-
FULLSCREEN: ${{ inputs.fullscreen }}
134-
MULTI_ARCH: ${{ inputs.multi_arch }}
135-
TARGETS: ${{ inputs.targets }}
136-
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
137-
PKG_CONFIG_ALLOW_SYSTEM_LIBS: 1
138-
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1
139-
140-
- name: Upload archive
141-
uses: actions/upload-artifact@v4
142-
with:
143-
name: output-${{ inputs.platform }}.zip
144-
path: node_modules/pake-cli/output/*
145-
retention-days: 3
146-
147-
- name: Rust cache store
148-
uses: actions/cache/save@v3
149-
if: steps.cache_store.outputs.cache-hit != 'true'
150-
with:
151-
path: |
130+
环境:
131+
URL: URL: ${{ inputs.url }}{{ inputs.url }}
132+
名称: 名字: ${{ inputs.name }}{{ inputs.name }}
133+
ICON: 图标:${ inputs.icon }}{{ inputs.icon }}
134+
高度:${{ inputs.height }}{{ inputs.height }}
135+
宽度 宽度:${{ inputs.width }}{{ inputs.width }}
136+
HIDE_TITLE_BAR: 隐藏标题栏: ${{ inputs.hide_title_bar }}{{ inputs.hide_title_bar }}
137+
全屏: 全屏:${{ inputs.fullscreen }}{{ inputs.fullscreen }}
138+
多架构: 多架构: ${{ inputs multi_arch }}{{ inputs multi_arch }}
139+
目标: 目标:${{ inputs.targets }}{{ inputs.targets }}
140+
PKG_CONFIG_PATH: PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:/usr/share/pkgconfig
141+
PKG_CONFIG_ALLOW_SYSTEM_LIBS1
142+
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS1
143+
144+
- 名称: - 名称: 上传档案
145+
uses: 用途:actions/upload-artifact@v4
146+
与:
147+
名字: 名字:输出-${{ inputs.platform }}.zip{{ inputs.platform }}.zip
148+
路径: 路径:node_modules/pake-cli/output/*
149+
保留天数:3
150+
151+
- 名称: - 名称: Rust 缓存存储
152+
使用: 使用: actions/cache/save@v3
153+
如果 如果 steps.cache_store.outputs.cache-hit 不等于 'true''真'
154+
与:
155+
路径: |
152156
~/.cargo/bin/
153157
~/.cargo/registry/index/
154158
~/.cargo/registry/cache/
155159
~/.cargo/git/db/
156160
node_modules/pake-cli/src-tauri/target/
157-
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
161+
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') }}

0 commit comments

Comments
 (0)