From 52749a299c1b00998355686364afbc3c24f55d9a Mon Sep 17 00:00:00 2001 From: Nice3point Date: Sun, 27 Sep 2026 14:01:32 +0300 Subject: [PATCH] [CI] Publish packages to NuGet through trusted publishing --- .github/workflows/PublishRelease.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishRelease.yml b/.github/workflows/PublishRelease.yml index 20324a2..f0e4139 100644 --- a/.github/workflows/PublishRelease.yml +++ b/.github/workflows/PublishRelease.yml @@ -5,6 +5,11 @@ on: tags: - '*' +permissions: + contents: write + packages: read + id-token: write + jobs: windows: name: windows-2025 @@ -23,6 +28,12 @@ jobs: key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Directory.Build.props', 'Directory.Packages.props') }} restore-keys: ${{ runner.os }}-nuget- + - name: Log in to NuGet + id: nuget + uses: NuGet/login@v1 + with: + user: Nice3point + - name: Publish release run: dotnet run -c Release -- pack publish working-directory: "build" @@ -31,4 +42,4 @@ jobs: DOTNET_ENVIRONMENT: ${{ (github.ref_name == 'main' || github.ref_type == 'tag') && 'Production' || 'Development' }} Publish__Version: ${{ github.ref_name }} NuGet__InternalApiKey: ${{ secrets.GITHUB_TOKEN }} - NuGet__ApiKey: ${{ secrets.NUGET_API_KEY }} \ No newline at end of file + NuGet__ApiKey: ${{ steps.nuget.outputs.NUGET_API_KEY }} \ No newline at end of file