Skip to content

Commit 1234d6c

Browse files
authored
Add app publishing guide (#510)
1 parent 0accb42 commit 1234d6c

File tree

8 files changed

+293
-177
lines changed

8 files changed

+293
-177
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
title: 发布应用
3+
description: 了解如何与我们的社区分享你的主题和插件
4+
---
5+
6+
了解如何与我们的社区分享你的主题和插件,下文以应用统称主题和插件。
7+
8+
## GitHub 托管
9+
10+
如果你的应用是一个开源应用,那么我们推荐将其托管在 GitHub 上,可以获得以下好处:
11+
12+
1. 可以利用 GitHub 的 CI/CD 功能,实现自动构建和版本发布。
13+
2. 可以通过 GitHub 的 Issues 功能跟踪用户反馈。
14+
3. 可以获得更多用户关注和贡献。
15+
16+
除此之外,我们推荐为 GitHub 仓库添加与 Halo 相关的 [Topics](https://github.com/topics),以便让更多用户找到你的应用,比如主题可以添加 [#halo-theme](https://github.com/topics/halo-theme),插件可以添加 [#halo-plugin](https://github.com/topics/halo-plugin)
17+
18+
## 版本发布
19+
20+
当你完成了你的应用并进行充分测试后,就可以在 GitHub 上创建新的 Release,其中版本规范可以参考[版本控制](#version-control)
21+
22+
### 集成 CI / CD
23+
24+
我们为 Halo 的主题和插件提供了适用于 GitHub Action 的 CI / CD [工作流](https://github.com/halo-sigs/reusable-workflows),可以非常方便的集成到你的 GitHub 仓库中,以下是示例:
25+
26+
插件 CI:
27+
28+
```yaml title=".github/workflows/ci.yaml"
29+
name: CI
30+
31+
on:
32+
push:
33+
branches:
34+
- main
35+
pull_request:
36+
branches:
37+
- main
38+
39+
jobs:
40+
ci:
41+
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-ci.yaml@v3
42+
with:
43+
ui-path: "ui"
44+
pnpm-version: 9
45+
node-version: 22
46+
java-version: 21
47+
```
48+
49+
插件 CD:
50+
51+
此工作流会在每次发布 Release 时自动执行,会自动构建插件并上传产物到 Release 的 Assets 中。
52+
53+
```yaml title=".github/workflows/cd.yaml"
54+
name: CD
55+
56+
on:
57+
release:
58+
types:
59+
- published
60+
61+
jobs:
62+
cd:
63+
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-cd.yaml@v3
64+
permissions:
65+
contents: write
66+
with:
67+
pnpm-version: 9
68+
node-version: 22
69+
java-version: 21
70+
skip-appstore-release: true
71+
```
72+
73+
主题 CD:
74+
75+
此工作流会在每次发布 Release 时自动执行,会自动构建主题并上传产物到 Release 的 Assets 中。
76+
77+
```yaml title=".github/workflows/cd.yaml"
78+
name: CD
79+
80+
on:
81+
release:
82+
types:
83+
- published
84+
85+
jobs:
86+
cd:
87+
uses: halo-sigs/reusable-workflows/.github/workflows/theme-cd.yaml@v3
88+
permissions:
89+
contents: write
90+
with:
91+
skip-appstore-release: true
92+
node-version: 22
93+
pnpm-version: 9
94+
```
95+
96+
关于 CI / CD 的更多详细信息,可查阅:[halo-sigs/reusable-workflows](https://github.com/halo-sigs/reusable-workflows)
97+
98+
## 分享应用
99+
100+
为了方便让 Halo 的用户知道你的应用,可以在以下渠道分享:
101+
102+
1. [halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo):你可以向这个仓库发起一个 PR 提交你的应用信息。
103+
2. [Halo 论坛](https://bbs.halo.run/t/plugins):你可以在 Halo 官方社区的[插件](https://bbs.halo.run/t/plugins)和[主题](https://bbs.halo.run/t/themes)板块发布你的应用。
104+
105+
## 发布到应用市场
106+
107+
Halo 的官方应用市场接受新应用的提交,但由于应用市场仅支持作者自行管理应用以及版本,还不支持自助新建应用并发布,所以发布到应用市场需要按照以下流程:
108+
109+
1. 向 [halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo) 发起一个 PR 提交应用的信息,并勾选 **上架到 Halo 应用市场**。
110+
2. Halo 官方人员会审核你的应用信息,审核通过后会上架到应用市场。
111+
3. 如果你需要自行管理应用以及版本,可以在 PR 描述信息中提供 [Halo 官网](https://www.halo.run/)的用户名,我们会在应用发布之后将管理权限授予你。
112+
113+
### 要求
114+
115+
在你决定上架到 Halo 应用市场前,请确保已经完成以下要求:
116+
117+
1. 插件必须正确设置 `plugin.yaml` 中的 logo 字段,不能是插件开发模板中默认的 Halo 图标。
118+
2. 主题和插件的描述文件中必须正确设置 `homepage`、`issues`、`license` 字段,详细解释:
119+
1. `homepage`:应用的主页,可以填写为 GitHub 仓库地址或者 Halo 应用市场的应用详情页地址。
120+
2. `issues`:应用的反馈地址,可以填写为 GitHub 仓库的 issues 地址。
121+
3. `license`:应用的发行许可证。
122+
3. 应用必须编写介绍和使用文档。
123+
4. 应用如果是基于其他程序开发的,需要保证许可证兼容。
124+
125+
### 自动发布
126+
127+
当你有了应用的管理权限之后,你可以修改上述 CI / CD 工作流,以实现在 GitHub 发布 Release 之后自动同步到应用市场,以下是具体步骤:
128+
129+
1. 移除 `skip-appstore-release: true` 配置,或者设置为 `false`。
130+
2. 在 `with` 中添加 `app-id` 配置,值为应用市场的应用 ID。
131+
3. 在 Halo 官网的个人中心创建一个新的[个人令牌](https://www.halo.run/uc/profile?tab=pat),勾选 **应用市场开发者 > 版本管理**。
132+
4. 在 GitHub 仓库的设置 -> `Secrets and variables` 中新建一个 Secret,名称为 `HALO_PAT`,值为你在 Halo 官网创建的个人令牌。
133+
134+
## 版本控制 {#version-control}
135+
136+
为了保持 Halo 生态系统的健康、可靠和安全,每次你对自己拥有的应用进行重大更新时,我们建议在遵循 [semantic versioning spec](http://semver.org/) 的基础上发布新版本。遵循语义版本控制规范有助于其他依赖你代码的开发人员了解给定版本的更改程度,并在必要时调整自己的代码。

docs/developer-guide/plugin/interaction/dependency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,4 @@ jobs:
328328

329329
API 模块和插件模块的版本应该保持一致,以确保插件在不同环境中的一致性。
330330

331-
版本的发布应该遵循 [插件语义化版本规范](../publish.md#version-control),以确保插件的版本号能够清晰地表达插件的变化和向后兼容性。
331+
版本的发布应该遵循 [语义化版本规范](../../appendix/publish-app.md#version-control),以确保插件的版本号能够清晰地表达插件的变化和向后兼容性。

docs/developer-guide/plugin/publish.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

sidebars.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ module.exports = {
5454
type: "link",
5555
label: "Zeabur 一键部署",
5656
href: "https://zeabur.com/docs/zh-CN/marketplace/halo",
57-
description: "在 Zeabur 一键部署 Halo 服务"
57+
description: "在 Zeabur 一键部署 Halo 服务",
5858
},
5959
{
6060
type: "link",
6161
label: "Rainbond 一键部署",
6262
href: "https://hub.grapps.cn/marketplace/apps/1255",
63-
description: "在 Rainbond 一键部署 Halo 服务"
63+
description: "在 Rainbond 一键部署 Halo 服务",
6464
},
6565
],
6666
},
@@ -144,7 +144,6 @@ module.exports = {
144144
"developer-guide/plugin/introduction",
145145
"developer-guide/plugin/prepare",
146146
"developer-guide/plugin/hello-world",
147-
"developer-guide/plugin/publish",
148147
{
149148
type: "category",
150149
label: "基础",
@@ -415,5 +414,13 @@ module.exports = {
415414
},
416415
"developer-guide/form-schema",
417416
"developer-guide/annotations-form",
417+
{
418+
type: "category",
419+
label: "附录",
420+
link: {
421+
type: "generated-index",
422+
},
423+
items: ["developer-guide/appendix/publish-app"],
424+
},
418425
],
419426
};

0 commit comments

Comments
 (0)