Compare commits

..
2 Commits
Author SHA1 Message Date
xrain c8b78ce86d add tags for doc 2026-03-26 00:52:52 +08:00
xrain b2ec94e957 fix ci 2026-03-26 00:41:55 +08:00
3 changed files with 24 additions and 6 deletions
+8 -3
View File
@@ -9,16 +9,21 @@ jobs:
publish: publish:
name: Publish Project to Nuget name: Publish Project to Nuget
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup .NET Core - name: Setup .NET Core
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v5
with: with:
dotnet-version: "10.x.x" dotnet-version: "10.x.x"
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish - name: Publish
run: | run: |
version=`git describe --tags` version=`git describe --tags`
dotnet build --configuration release -p:Version=$version dotnet build --configuration release -p:Version=$version
dotnet nuget push bin/release/Simcu.SimApi.$version.nupkg -k ${NUGET_APIKEY} -s https://www.nuget.org/api/v2/package dotnet nuget push bin/release/Simcu.SimApi.$version.nupkg -k ${{steps.login.outputs.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
env:
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
+13 -3
View File
@@ -12,12 +12,12 @@ public class SimApiDocAttribute : SwaggerOperationAttribute
/// <summary> /// <summary>
/// 定义接口说明 /// 定义接口说明
/// </summary> /// </summary>
/// <param name="tag">接口分组</param> /// <param name="tags">接口分组列表</param>
/// <param name="name">接口名称</param> /// <param name="name">接口名称</param>
/// <param name="description">接口描述</param> /// <param name="description">接口描述</param>
public SimApiDocAttribute(string tag, string name, string? description = null) public SimApiDocAttribute(string[] tags, string name, string? description = null)
{ {
Tags = [tag]; Tags = tags;
Summary = name; Summary = name;
if (description != null) if (description != null)
{ {
@@ -26,4 +26,14 @@ public class SimApiDocAttribute : SwaggerOperationAttribute
// Consumes = new[] {"application/json"}; // Consumes = new[] {"application/json"};
// Produces = new[] {"application/json"}; // Produces = new[] {"application/json"};
} }
/// <summary>
/// 定义接口说明
/// </summary>
/// <param name="tag">接口分组</param>
/// <param name="name">接口名称</param>
/// <param name="description">接口描述</param>
public SimApiDocAttribute(string tag, string name, string? description = null) : this([tag], name, description)
{
}
} }
+3
View File
@@ -26,6 +26,9 @@
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.1.0" /> <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.0" /> <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include=".github\workflows\nuget-publish.yml" />
</ItemGroup>
<ProjectExtensions> <ProjectExtensions>
<MonoDevelop> <MonoDevelop>
<Properties> <Properties>