submodule对gitea不管用,所以直接拉了一份拉格兰

This commit is contained in:
2025-02-04 16:29:43 +08:00
parent b0bfc803e3
commit d149a2ea0f
1023 changed files with 43308 additions and 18 deletions

View File

@@ -0,0 +1,149 @@
name: 错误报告
description: 在使用 Lagrange 的过程中遇到了错误
title: '[Bug?]: '
labels: [ "bug?" ]
body:
# User's README and agreement
- type: markdown
attributes:
value: |
## 感谢您愿意填写错误回报!
## 以下是一些注意事项,请务必阅读让我们能够更容易处理
### ❗| 确定没有相同问题的ISSUE已被提出.
### 🌎| 请准确填写环境信息
### ❔| 修改配置文件中log参数为trace或debug并提供出现问题前后的完整日志内容。**请自行删除日志内存在的个人信息及敏感内容。**
### ⚠ | 如果您有能力请使用VS提供更加详细的信息.
## 如果您不知道如何有效、精准地表述,我们建议您先阅读[《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md)
---
- type: checkboxes
id: terms
attributes:
label: 请确保您已阅读以上注意事项,并勾选下方的确认框。
options:
- label: "我已经仔细阅读上述内容"
required: true
- label: "我已经使用 [最新构建](https://github.com/LagrangeDev/Lagrange.Core/actions/) 测试过,问题依旧存在。"
required: true
- label: "我已经在 [Issue Tracker](https://github.com/LagrangeDev/Lagrange.Core/issues) 中找过我要提出的问题没有找到相同问题的ISSUE。"
required: true
- label: 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。其它疑问请考虑加入TG群询问或在discussions中提问
required: true
# User's data
- type: markdown
attributes:
value: |
## 环境信息
请根据实际使用环境修改以下信息。
# Env | Lagrange Project
- type: dropdown
id: lagrange-project
attributes:
label: Lagrange项目
description: 请选择具体使用/依赖的Lagrange项目
options:
- Audio
- Core
- OneBot
- 其它(请在下方说明)
validations:
required: true
# Env | Lagrange Commit
- type: input
id: lagrange-commit
attributes:
label: 所使用/依赖的Lagrange项目对应的commit
validations:
required: true
# Env | VM Version
- type: dropdown
id: env-vm-ver
attributes:
label: 运行环境
description: 选择运行 Lagrange 的系统版本
options:
- Windows
- MacOS
- Linux
- 其它(请在下方说明)
validations:
required: true
# Env | VM Arch
- type: dropdown
id: env-vm-arch
attributes:
label: 运行架构
description: 请选择运行 Lagrange 的系统架构
options:
- x64
- x86
- arm
- arm64
- 其它
validations:
required: true
# Env | Connection type
- type: dropdown
id: env-conn-type
attributes:
label: 连接方式
description: 如果有必要请选择对接机器人的连接方式例如使用Lagrange.OneBot
options:
- HTTP
- 正向 WebSocket
- 反向 WebSocket
# Input | Reproduce
- type: textarea
id: reproduce-steps
attributes:
label: 重现步骤
description: |
我们需要执行哪些操作才能让 bug 出现?
简洁清晰的重现步骤能够帮助我们更迅速地定位问题所在。
validations:
required: true
# Input | Expected result
- type: textarea
id: expected
attributes:
label: 期望的结果是什么?
validations:
required: true
# Input | Actual result
- type: textarea
id: actual
attributes:
label: 实际的结果是什么?
validations:
required: true
# Optional | Reproduce code
- type: textarea
id: reproduce-code
attributes:
label: 简单的复现代码/链接(可选)
render: C#
# Optional | Logging
- type: textarea
id: logging
attributes:
label: Trace 级别日志记录(可选)
render: Shell
# Optional | Extra description
- type: textarea
id: extra-desc
attributes:
label: 补充说明(可选)

View File

@@ -0,0 +1,37 @@
name: 新功能提议
description: 希望拥有新的功能
title: '[Feature Request]: '
labels: ["enhancement"]
body:
# User's README
- type: markdown
attributes:
value: |
### 为了项目的长久稳定,请不要要求提供一些敏感操作的新功能
### 项目人手有限如果您有能力请考虑提交PR
### 当 Owner 或 Member 认为该 Feature Request 不合适,可能直接关闭 ISSUE
# Env | Lagrange Project
- type: dropdown
id: lagrange-project
attributes:
label: Lagrange项目
description: 请选择您希望在哪个具体 Lagrange 项目中添加新需求
options:
- Audio
- Core
- OneBot
- 其它(请在下方说明)
validations:
required: true
# Input | Feature Content
- type: textarea
id: feature-content
attributes:
label: 新需求内容
description: |
请尽可能详细描述您的需求,如果可以,请提供代码样例或参考项目
validations:
required: true

View File

@@ -0,0 +1,39 @@
name: Lagrange.Core NuGet Push
on:
push:
branches:
- master
paths:
- "Lagrange.Core/**"
- "Lagrange.Core.sln"
- "LICENSE"
- "README.md"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Pack
run: |
dotnet build -c Release Lagrange.Core
dotnet pack -c Release Lagrange.Core
dotnet pack -c Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg Lagrange.Core
- name: Add private GitHub registry to NuGet
run: dotnet nuget add source --username Linwenxuan05 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/LagrangeDev/index.json"
- name: Push generated package to GitHub registry
run: dotnet nuget push ./Lagrange.Core/bin/Release/*.nupkg --source "github" --skip-duplicate --api-key ${{ secrets.GIT_TOKEN }}
- name: Push generated package to NuGet
run: dotnet nuget push ./Lagrange.Core/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.NUGETAPIKEY }}

View File

@@ -0,0 +1,72 @@
name: Lagrange.OneBot Build
on:
push:
branches:
- master
paths:
- "Lagrange.Core/**"
- "Lagrange.OneBot/**"
- "Lagrange.Core.sln"
- "LICENSE"
- "!Lagrange.OneBot/Resources/Dockerfile"
- "!Lagrange.OneBot/Resources/docker-entrypoint.sh"
pull_request:
branches:
- master
paths:
- "Lagrange.Core/**"
- "Lagrange.OneBot/**"
- "Lagrange.Core.sln"
- "LICENSE"
- "!Lagrange.OneBot/Resources/Dockerfile"
- "!Lagrange.OneBot/Resources/docker-entrypoint.sh"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
runtimeIdentifier:
[
win-x64,
win-x86,
linux-x64,
linux-arm,
linux-arm64,
osx-x64,
osx-arm64,
linux-musl-x64,
linux-musl-arm,
linux-musl-arm64,
]
steps:
- uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Build Lagrange.OneBot .NET 8.0
run: dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj --no-self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net8.0
- name: Build Lagrange.OneBot .NET 9.0
run: dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj --no-self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net9.0
- name: Upload binary files(${{ matrix.runtimeIdentifier }}) for .NET 8.0
uses: actions/upload-artifact@v4
if: github.event_name != 'pull_request'
with:
name: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net8.0_NoSelfContained
path: Lagrange.OneBot/bin/Release/net8.0/${{ matrix.runtimeIdentifier }}/publish
- name: Upload binary files(${{ matrix.runtimeIdentifier }}) for .NET 9.0
uses: actions/upload-artifact@v4
if: github.event_name != 'pull_request'
with:
name: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_NoSelfContained
path: Lagrange.OneBot/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish

View File

@@ -0,0 +1,62 @@
name: Lagrange.OneBot Docker Push
on:
push:
branches:
- master
paths:
- "Lagrange.Core/**"
- "Lagrange.OneBot/**"
- "Lagrange.Core.sln"
- "LICENSE"
pull_request:
branches:
- master
paths:
- "Lagrange.Core/**"
- "Lagrange.OneBot/**"
- "Lagrange.Core.sln"
- "LICENSE"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/lagrange.onebot
tags: |
type=edge
type=sha,event=branch
type=ref,event=tag
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: "Lagrange.OneBot/Resources/Dockerfile"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64, linux/arm

View File

@@ -0,0 +1,76 @@
name: Lagrange.OneBot Release
on:
workflow_dispatch:
env:
GH_TOKEN: ${{ github.token }}
jobs:
delete-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- run: gh release delete nightly --cleanup-tag -y -R ${{ github.repository }}
create-tag:
needs:
- delete-tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- run: echo -e "> ⚠This is a nightly release.\r\n> ⚠This is not the latest version." > note
- run: gh release create nightly -F ./note -p -t "Nightly Release" -R ${{ github.repository }}
build-and-upload-release:
if: ${{ always() }}
needs:
- create-tag
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
runtimeIdentifier:
[
win-x64,
win-x86,
linux-x64,
linux-arm,
linux-arm64,
osx-x64,
osx-arm64,
linux-musl-x64,
linux-musl-arm,
linux-musl-arm64,
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- run: dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net9.0
- run: |
if [[ ${{ matrix.runtimeIdentifier }} == 'win-x64' || ${{ matrix.runtimeIdentifier }} == 'win-x86' ]]; then
zip -r Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.zip ./Lagrange.OneBot/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish
gh release upload nightly Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.zip -R ${{ github.repository }}
else
tar -czvf Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.tar.gz ./Lagrange.OneBot/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish
gh release upload nightly Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.tar.gz -R ${{ github.repository }}
fi