This commit is contained in:
2026-03-26 00:41:55 +08:00
parent a8439c174c
commit b2ec94e957
2 changed files with 11 additions and 3 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 }}
+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>