From 252c4103f34292882578cf77f3af1242f1a7656c Mon Sep 17 00:00:00 2001 From: ChiaraBm Date: Thu, 12 Mar 2026 13:16:50 +0000 Subject: [PATCH] Added workflow for building nuget packages --- .gitea/workflows/publish-nuget.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .gitea/workflows/publish-nuget.yml diff --git a/.gitea/workflows/publish-nuget.yml b/.gitea/workflows/publish-nuget.yml new file mode 100644 index 0000000..341ebed --- /dev/null +++ b/.gitea/workflows/publish-nuget.yml @@ -0,0 +1,53 @@ +name: "Dev Publish: Nuget" + +on: + workflow_dispatch: + push: + branches: + - v2.1 + paths: + - 'MoonlightServers.*/*.csproj' + +env: + NUGET_SOURCE: https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json + CONFIGURATION: Debug + +jobs: + publish: + name: Publish ${{ matrix.project }} + runs-on: linux_amd64 + + strategy: + matrix: + project: + - MoonlightServers.Api + - MoonlightServers.Shared + - MoonlightServers.DaemonShared + - MoonlightServers.Frontend + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + # 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 }} + + - name: Build Tailwind styles (Frontend only) + if: matrix.project == 'MoonlightServers.Frontend' + working-directory: Hosts/MoonlightServers.Frontend.Host/Styles + run: npm install && npm run build + + - name: Build project + run: dotnet build ${{ matrix.project }} --configuration ${{ env.CONFIGURATION }} + + - name: Pack NuGet package + run: dotnet pack ${{ matrix.project }} --configuration ${{ env.CONFIGURATION }} --output ./artifacts + + - name: Push NuGet package + run: | + dotnet nuget push ./artifacts/*.nupkg + --skip-duplicate + --source ${{ env.NUGET_SOURCE }} + --api-key ${{ secrets.ACCESS_TOKEN }} \ No newline at end of file