From 1475b896600badf07efa3241c8931e9e438236bb Mon Sep 17 00:00:00 2001 From: ChiaraBm Date: Thu, 12 Mar 2026 13:31:49 +0000 Subject: [PATCH] Updated workflow to handle sources aithout persisting them --- .gitea/workflows/publish-nuget.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/publish-nuget.yml b/.gitea/workflows/publish-nuget.yml index fcb8925..2530b14 100644 --- a/.gitea/workflows/publish-nuget.yml +++ b/.gitea/workflows/publish-nuget.yml @@ -10,6 +10,7 @@ on: env: NUGET_SOURCE: https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json + NUGET_PUBLIC: https://api.nuget.org/v3/index.json CONFIGURATION: Debug jobs: @@ -28,14 +29,20 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - - name: Add moonlight nuget source - run: dotnet nuget add source --name Moonlight-Panel ${{ env.NUGET_SOURCE }} - + + - name: Restore NuGet packages + run: > + dotnet restore ${{ matrix.project }} + --source ${{ env.NUGET_PUBLIC }} + --source ${{ env.NUGET_SOURCE }} + # Frontend requires a host build + Tailwind compilation first - name: Build frontend host (Frontend only) if: matrix.project == 'MoonlightServers.Frontend' - run: dotnet build Hosts/MoonlightServers.Frontend.Host --configuration ${{ env.CONFIGURATION }} + run: > + dotnet build Hosts/MoonlightServers.Frontend.Host + --configuration ${{ env.CONFIGURATION }} + --no-restore - name: Build Tailwind styles (Frontend only) if: matrix.project == 'MoonlightServers.Frontend' @@ -43,13 +50,20 @@ jobs: run: npm install && npm run build - name: Build project - run: dotnet build ${{ matrix.project }} --configuration ${{ env.CONFIGURATION }} + run: > + dotnet build ${{ matrix.project }} + --configuration ${{ env.CONFIGURATION }} + --no-restore - name: Pack NuGet package - run: dotnet pack ${{ matrix.project }} --configuration ${{ env.CONFIGURATION }} --output ./artifacts + run: > + dotnet pack ${{ matrix.project }} + --configuration ${{ env.CONFIGURATION }} + --output ./artifacts + --no-build - name: Push NuGet package - run: | + run: > dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source ${{ env.NUGET_SOURCE }}