Skip to content

Commit

Permalink
Website deploy config
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Jun 5, 2024
1 parent da05649 commit 6664bfd
Show file tree
Hide file tree
Showing 9 changed files with 449 additions and 11 deletions.
154 changes: 154 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Deploy Website
on:
push:
branches:
- main
- master
- dev/main
paths:
- 'Writerside/**'
- '.github/workflows/deploy-website.yml'

tags-ignore:
- v*.**.**
# Specify to run a workflow manually from the Actions tab on GitHub
workflow_dispatch:


# Gives the workflow permissions to clone the repo and create a page deployment
permissions:
id-token: write
pages: write

env:
# Name of module and id separated by a slash
INSTANCE: Writerside/ob
INSTANCE_NAME: ob
# Replace HI with the ID of the instance in capital letters
ARTIFACT: webHelpOB2-all.zip
# Writerside docker image version
DOCKER_VERSION: 241.16003
# Add the variable below to upload Algolia indexes
# Replace HI with the ID of the instance in capital letters
ALGOLIA_ARTIFACT: algolia-indexes-OB.zip
ALGOLIA_APP_NAME: VLLZ4JZE8Z
ALGOLIA_INDEX_NAME: ob-doc

jobs:
build:
runs-on: ubuntu-latest
outputs:
config_json: ${{ steps.output-config-json.outputs.config_json }}

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

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

# Add the step below to upload Algolia indexes
- name: Upload algolia-indexes
uses: actions/upload-artifact@v3
with:
name: algolia-indexes
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7

- name: Unzip artifact
run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir

- name: Output documentation config.json
id: output-config-json
run: |
echo "config_json=$(cat dir/config.json)" >> $GITHUB_OUTPUT
# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
test:
# Requires build job results
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Requires the build job results
needs: test
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

# https://www.jetbrains.com/help/writerside/configure-search.html
publish-indexes:
# Requires the build-job results
needs: [build, test]
runs-on: ubuntu-latest
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3

env:

CONFIG_JSON_VERSION: ${{ fromJSON(needs.build.outputs.config_json).productVersion }}

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: algolia-indexes


- name: Unzip artifact
run: |
unzip -O UTF-8 -qq ${{ env.ALGOLIA_ARTIFACT }} -d algolia-indexes
env "algolia-key=${{secrets.ALGOLIA_KEY}}" java -jar /opt/builder/help-publication-agent.jar \
update-index \
--application-name ${{env.ALGOLIA_APP_NAME}} \
--index-name ${{env.ALGOLIA_INDEX_NAME}} \
--product ${{env.INSTANCE_NAME}} \
--version ${{env.CONFIG_JSON_VERSION}} \
--index-directory algolia-indexes/ \
2>&1 | tee algolia-update-index-log.txt
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,18 @@ public class MyApp {
## License

```
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option)
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program.
You should have received a copy of the GNU Lesser General Public
License along with this program.
If not, see <https://www.gnu.org/licenses/>.
```
7 changes: 4 additions & 3 deletions Writerside/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
<noindex-content>false</noindex-content>
<analytics-head-script-file>head-script.html</analytics-head-script-file>
<algolia-id>VLLZ4JZE8Z</algolia-id>
<algolia-index>qg-doc</algolia-index>
<algolia-index>ob-doc</algolia-index>
<algolia-api-key>e60d9ee16618a0ad3a338ecc73cb840e</algolia-api-key>
<web-root>http://component-qqguild.simbot.forte.love</web-root>
<web-root>https://simple-robot.github.io/simbot-component-onebot</web-root>
</variables>

<build-profile instance="qg">
<build-profile instance="ob">
<variables>
<noindex-content>false</noindex-content>
</variables>
<sitemap priority="0.45" change-frequency="weekly" />
</build-profile>

<footer>
Expand Down
5 changes: 5 additions & 0 deletions Writerside/ob.tree
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
name="Simple Robot | OneBot"
start-page="Home.md">
<toc-element topic="Home.md"/>
<toc-element toc-title="基础内容">
<toc-element topic="Event.md">
</toc-element>
<toc-element topic="Message.md"/>
</toc-element>
</instance-profile>
112 changes: 112 additions & 0 deletions Writerside/topics/Event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# 事件

## 原始事件

我们根据 OneBot11 协议中定义的所有事件结构,
在模块 `simbot-component-onebot-v11-event` 中提供了所有的实现类型。
它们是最基础的可序列化数据类,不含有任何功能。

<deflist>
<def id="MetaEvent" title="元事件 MetaEvent">
<deflist>
<def id="HeartbeatEvent" title="HeartbeatEvent"></def>
<def id="LifecycleEvent" title="LifecycleEvent"></def>
</deflist>
</def>
<def id="MessageEvent" title="消息事件 MessageEvent">
<deflist>
<def id="GroupMessageEvent" title="GroupMessageEvent"></def>
<def id="PrivateMessageEvent" title="PrivateMessageEvent"></def>
</deflist>
</def>
<def id="RequestEvent" title="请求事件 RequestEvent">
<deflist>
<def id="FriendRequestEvent" title="FriendRequestEvent"></def>
<def id="GroupRequestEvent" title="GroupRequestEvent"></def>
</deflist>
</def>
<def id="NoticeEvent" title="通知事件 NoticeEvent">
<deflist>
<def id="FriendAddEvent" title="FriendAddEvent"></def>
<def id="FriendRecallEvent" title="FriendRecallEvent"></def>
<def id="GroupAdminEvent" title="GroupAdminEvent"></def>
<def id="GroupBanEvent" title="GroupBanEvent"></def>
<def id="GroupDecreaseEvent" title="GroupDecreaseEvent"></def>
<def id="GroupIncreaseEvent" title="GroupIncreaseEvent"></def>
<def id="GroupRecallEvent" title="GroupRecallEvent"></def>
<def id="GroupUploadEvent" title="GroupUploadEvent"></def>
<def id="NotifyEvent" title="NotifyEvent"></def>
</deflist>
</def>
<def id="UnknownEvent" title="未知事件 UnknownEvent">

一个特殊的事件类型。
它是当遇到无法被上述这些类型所解析时使用的兜底类型,
它不可序列化,除 `time``selfId``postType`
之外直接提供 `raw` 属性(也就是原始的JSON字符串)。

</def>
</deflist>

## 组件事件

组件实现是基于simbot标准API中定义的事件类型、对上述**原始事件**的包装,
并提供相对应的功能性API实现。

### 消息事件

<deflist>
<def id="OneBotMessageEvent" title="OneBotMessageEvent">
与消息相关的事件。

<deflist>
<def id="OneBotGroupMessageEvent" title="OneBotGroupMessageEvent">
与群消息相关的事件。

<deflist>
<def id="OneBotNormalGroupMessageEvent" title="OneBotNormalGroupMessageEvent">
与普通群消息相关的事件。
</def>
<def id="OneBotAnonymousGroupMessageEvent" title="OneBotAnonymousGroupMessageEvent">
与匿名群消息相关的事件。
</def>
<def id="OneBotNoticeGroupMessageEvent" title="OneBotNoticeGroupMessageEvent">
与群系统消息通知相关的事件。
</def>
</deflist>

</def>
<def id="OneBotPrivateMessageEvent" title="OneBotPrivateMessageEvent">
与私聊消息相关的事件。

<deflist>
<def id="OneBotFriendMessageEvent" title="OneBotFriendMessageEvent">
好友私信消息事件。
</def>
<def id="OneBotGroupPrivateMessageEvent" title="OneBotGroupPrivateMessageEvent">
群成员临时会话消息事件。
</def>
</deflist>

</def>
</deflist>

</def>
</deflist>



### 未知事件

`OneBotUnknownEvent`

是对上述原始事件中的 `UnknownEvent` 类型的包装。

### 未支持事件

`OneBotUnsupportedEvent`

是当出现了原始事件中有(除了 `UnknownEvent`)、
但是尚未提供对应的**组件事件**实现的事件类型时用来兜底的类型。

这些原始事件类型会被统一装入此事件中。
57 changes: 56 additions & 1 deletion Writerside/topics/Home.md
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
# Home
# 欢迎!

这里是
[**Simple Robot v4**](https://github.com/simple-robot/simpler-robot/tree/v4-dev)
[OneBot组件](https://github.com/simple-robot/simbot-component-onebot/)
应用手册!

## 概述

Simple Robot OneBot 组件是一个将
[OneBot11协议](https://github.com/botuniverse/onebot-11)
[Simple Robot](http://github.com/simple-robot/simpler-robot) 标准API下实现的组件库,
并由此提供simbot中的各项能力。

借助simbot核心库提供的能力,它可以支持很多高级功能和封装,比如组件协同、Spring支持等,
祝你快速开发 OneBot 客户端应用!

序列化和网络请求相关分别基于 [Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization)
[Ktor](https://ktor.io/)


### 了解 **Simple Robot**

- [Simple Robot 应用手册](https://simbot.forte.love)
- [Simple Robot 组织库](https://github.com/simple-robot)

### API文档

- [API文档引导站](https://docs.simbot.forte.love)

## 反馈与协助!

我们欢迎并期望着您的
[反馈](https://github.com/simple-robot/simbot-component-onebot/issues)
[协助](https://github.com/simple-robot/simbot-component-onebot/pulls)
感谢您的贡献与支持!

```
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program.
If not, see <https://www.gnu.org/licenses/>.
```
Loading

0 comments on commit 6664bfd

Please sign in to comment.