diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..b4150d1 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,38 @@ +name: Publish NuGet Package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Pack + run: dotnet pack --configuration Release --no-build --output ./nupkg + + - name: Publish to NuGet.org + run: | + dotnet nuget push ./nupkg/*.nupkg \ + --api-key az \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate diff --git a/ContosoMCP/ContosoMCP.csproj b/ContosoMCP/ContosoMCP.csproj index 27b02ba..f214892 100644 --- a/ContosoMCP/ContosoMCP.csproj +++ b/ContosoMCP/ContosoMCP.csproj @@ -14,7 +14,7 @@ README.md ContosoMCPServer - 0.1.0-beta + 0.2.0-beta AI; MCP; server; stdio An MCP server using the MCP C# SDK.