From 528870f1ba92c9f1ea5f27cbf85721997ad74209 Mon Sep 17 00:00:00 2001 From: Rikitav Date: Fri, 6 Mar 2026 15:03:30 +0400 Subject: [PATCH] added github workflow file for automatic nuget packages pushing --- .github/workflows/publish-nuget.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish-nuget.yml diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..14634a5 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,35 @@ +name: Build and Publish NuGet Package + +on: + push: + tags: + - 'v*' + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + permissions: + packages: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build project + run: dotnet build --configuration Release --no-restore + + - name: Push to GitHub Packages + run: dotnet nuget push ./bin/Release/*.nupkg --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + + - name: Push to NuGet.org + run: dotnet nuget push ./bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate \ No newline at end of file