name: Pack and Push NuGet Package on: push: branches: - main jobs: publish: container: image: mcr.microsoft.com/dotnet/sdk:9.0 steps: - name: Install Node.js and dependencies run: | apt-get update apt-get install -y curl gnupg curl -fsSL https://deb.nodesource.com/setup_18.x | bash - apt-get install -y nodejs git - name: Checkout uses: actions/checkout@v3 - name: Restore dependencies run: dotnet restore ./code/MessengerApi.Client/MessengerApi.Client.csproj - name: Build project run: dotnet build ./code/MessengerApi.Client/MessengerApi.Client.csproj -c Release - name: Pack NuGet Package run: | dotnet pack ./code/MessengerApi.Client/MessengerApi.Client.csproj -c Release -o out - name: Push to Gitea NuGet Registry run: | dotnet nuget push out/*.nupkg \ --api-key "${{ secrets.NUGET_PUBLISH_TOKEN }}" \ --source "https://gitea.masita.net/api/packages/${{ secrets.NUGET_PUBLISH_USERNAME }}/nuget/index.json"