feat(plugin): 添加 NuGet 包发布配置
- 添加包元数据到 csproj - 创建 nuget.yml 发布工作流
This commit is contained in:
parent
09957364e2
commit
4839366227
40
.gitea/workflows/nuget.yml
Normal file
40
.gitea/workflows/nuget.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: Build and Publish NuGet Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'src/Fengling.Gateway.Plugin.Abstractions/**'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: gitea.shtao1.cn
|
||||||
|
PACKAGE_NAME: Fengling.Gateway.Plugin.Abstractions
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '10.0.103'
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj --configuration Release --no-restore
|
||||||
|
|
||||||
|
- name: Pack
|
||||||
|
run: dotnet pack src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj --configuration Release --no-build -o ./nupkg
|
||||||
|
|
||||||
|
- name: Publish to Gitea
|
||||||
|
run: |
|
||||||
|
dotnet nuget push ./nupkg/*.nupkg \
|
||||||
|
--source ${{ env.REGISTRY }}/api/packages/${{ github.repository_owner }}/nuget/index.json \
|
||||||
|
--username fengling \
|
||||||
|
--password ${{ secrets.GITEATOKEN }}
|
||||||
@ -5,6 +5,14 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<RootNamespace>Fengling.Gateway.Plugin.Abstractions</RootNamespace>
|
<RootNamespace>Fengling.Gateway.Plugin.Abstractions</RootNamespace>
|
||||||
|
|
||||||
|
<!-- NuGet Package Metadata -->
|
||||||
|
<PackageId>Fengling.Gateway.Plugin.Abstractions</PackageId>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<Authors>Fengling</Authors>
|
||||||
|
<Company>Fengling</Company>
|
||||||
|
<Product>Fengling Gateway Plugin</Product>
|
||||||
|
<Description>Gateway plugin abstractions for YARP reverse proxy</Description>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user