Skip to content

Commit 4f91753

Browse files
committed
docs: 更新插件开发文档,详细说明手动发布流程和ZIP包结构要求
1 parent aab566e commit 4f91753

1 file changed

Lines changed: 52 additions & 13 deletions

File tree

Plugin-Development.md

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,37 @@ obsmclauncher
670670

671671
#### 手动发布
672672

673-
1. 编译插件(Release 模式)
674-
2. 将以下文件打包成 ZIP:
675-
- `YourPlugin.dll`
676-
- `plugin.json`
677-
- `icon.png`(如有)
678-
- `README.md`
679-
- `LICENSE`
680-
3. 在 GitHub 创建新 Release:
673+
1. **编译插件**(Release 模式)
674+
```bash
675+
dotnet build -c Release
676+
```
677+
678+
2. **打包成 ZIP**(⚠️ 注意:文件直接放在ZIP根目录)
679+
680+
进入编译输出目录:
681+
```bash
682+
cd bin/Release/net8.0-windows/
683+
```
684+
685+
选择需要的文件并打包(**不要包含文件夹**):
686+
```bash
687+
# Windows PowerShell
688+
Compress-Archive -Path YourPlugin.dll,plugin.json,icon.png -DestinationPath YourPlugin.zip
689+
690+
# 或使用 7-Zip 等工具,确保文件在ZIP根目录
691+
```
692+
693+
打包的文件应包括:
694+
- `YourPlugin.dll` - 插件主程序集
695+
- `plugin.json` - 元数据文件
696+
- `icon.png` - 图标(可选)
697+
- 其他依赖的 DLL 文件(如有)
698+
- `README.md`(可选)
699+
- `LICENSE`(可选)
700+
701+
⚠️ **重要**:确保文件直接在ZIP根目录,而不是嵌套在文件夹中!
702+
703+
3. **在 GitHub 创建新 Release**
681704
- **Tag version**: `v1.0.0`(遵循 SemVer)
682705
- **Release title**: `YourPlugin v1.0.0`
683706
- **Description**: 更新日志
@@ -738,14 +761,30 @@ obsmclauncher
738761
- `integration` - 服务集成
739762
- `enhancement` - 功能增强
740763

741-
**重要**`downloadUrl` 必须是可直接下载的ZIP文件链接,ZIP包内应包含:
764+
**重要**`downloadUrl` 必须是可直接下载的ZIP文件链接。
765+
766+
**ZIP包结构要求**(⚠️ 重要):
767+
768+
**正确的ZIP包结构**(文件直接放在ZIP根目录):
742769
```
743770
your-plugin.zip
744-
├── your-plugin.dll
745-
├── plugin.json
746-
├── icon.png (可选)
747-
└── 其他依赖文件
771+
├── your-plugin.dll # 插件主程序集
772+
├── plugin.json # 插件元数据
773+
├── icon.png # 插件图标(可选)
774+
├── DependencyLib.dll # 依赖库(如有)
775+
└── README.md # 说明文档(可选)
776+
```
777+
778+
**错误的ZIP包结构**(不要在ZIP内创建文件夹):
748779
```
780+
your-plugin.zip
781+
└── your-plugin/ ❌ 不要这样!启动器会自动创建插件目录
782+
├── your-plugin.dll
783+
├── plugin.json
784+
└── icon.png
785+
```
786+
787+
**说明**:启动器会将ZIP包直接解压到 `plugins/your-plugin-id/` 目录,因此ZIP包内的文件必须直接放在根目录,不要额外嵌套文件夹。
749788

750789
#### 方式一:提交 PR 到插件索引仓库
751790

0 commit comments

Comments
 (0)