From 11e894a29a82d548f3935935df649bfa3e60fcb0 Mon Sep 17 00:00:00 2001 From: Sameer Umar <72575280+XtraCube@users.noreply.github.com> Date: Mon, 19 Oct 2026 17:20:30 +0000 Subject: [PATCH] Add NuGet login step and update push command --- .github/workflows/main.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ad0f7544..50db579b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -5,6 +5,8 @@ on: ["workflow_dispatch", "push", "pull_request"] jobs: build: runs-on: ubuntu-22.04 + permissions: + id-token: write steps: - uses: actions/checkout@v4 with: @@ -38,14 +40,21 @@ jobs: with: name: AllOfUs.MiraAPI.nupkg path: MiraAPI/bin/Release/AllOfUs.MiraAPI.*.nupkg - + - uses: softprops/action-gh-release@v2 if: github.ref_type == 'tag' with: draft: true files: MiraAPI/bin/Release/net6.0/MiraAPI.dll - + + - name: NuGet login + if: github.ref_type == 'tag' + uses: NuGet/login@v1 + id: login + with: + user: xtracube + - name: Push NuGet package if: github.ref_type == 'tag' run: | - dotnet nuget push MiraAPI/bin/Release/AllOfUs.MiraAPI.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} \ No newline at end of file + dotnet nuget push MiraAPI/bin/Release/AllOfUs.MiraAPI.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }}