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 }}