docs(plugin): document auto-release workflow and zh README scaffold (SDK #68)

This commit is contained in:
RockChinQ
2026-06-09 07:39:20 -04:00
parent fbd0b2ebed
commit 8326d3f313
6 changed files with 63 additions and 3 deletions
+15
View File
@@ -20,6 +20,21 @@ Upload your plugin to GitHub, then go to the Release page of your plugin reposit
<img width="600" src="/images/zh/plugin/dev/dist/github_release.png" />
## Auto-create Release (GitHub Actions)
Plugins created by `lbp init` come with a built-in GitHub Actions workflow (`.github/workflows/release.yml`), so you don't have to build and upload manually.
After pushing your plugin repository to GitHub, whenever you bump the `version` field in `manifest.yaml` and push to the `main` or `master` branch, the workflow will automatically:
1. Install the `lbp` CLI and run `lbp build` to package the plugin;
2. Create a GitHub Release tagged `v<version>` and upload the generated `.lbpkg` file.
If a Release for that version already exists, the workflow skips it to avoid duplicate publishing. You can also trigger it manually from the repository's Actions page (`workflow_dispatch`).
<Info title="">
The workflow relies on the repository's default `GITHUB_TOKEN` and requires the `contents: write` permission (already declared in the template). Make sure Actions is enabled for the repository, and that the `metadata.author`, `metadata.name`, and `metadata.version` fields in `manifest.yaml` are correct — the Release name and artifact filename are composed from these fields (`<author>-<name>-<version>.lbpkg`).
</Info>
## Install Plugin
In LangBot's plugin management page, click the top-right corner to select the GitHub installation method.
+6 -1
View File
@@ -38,7 +38,12 @@ A plugin's directory structure is similar to the following:
├── main.py # Plugin main program, listens to plugin lifecycle
├── manifest.yaml # Plugin manifest file, describes plugin metadata
├── README.md # Plugin documentation file, describes plugin functionality and usage, displayed on the plugin marketplace page
└── requirements.txt # Plugin dependencies file
├── readme
│ └── README_zh_Hans.md # Simplified Chinese documentation, for multi-language docs
├── requirements.txt # Plugin dependencies file
└── .github
└── workflows
└── release.yml # GitHub Actions workflow, automatically builds and publishes a Release when the version is bumped
```
The plugin class in main.py is common code for each plugin, initialized when the plugin starts and passed context information (configuration, etc.). You can implement initialization and shutdown logic for the plugin here. The plugin class inherits from `langbot_plugin.api.definition.plugin.BasePlugin` and provides [LangBot Global APIs](/en/plugin/dev/apis/common).