From c068d24527338a974ee163c0615b66d7ff2702ef Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 10 Mar 2024 16:40:08 +0000 Subject: [PATCH] Publish to Nuget on tag --- .github/workflows/dotnet.yml | 12 ++++++++++++ src/carbon-intensity-sdk/carbon-intensity-sdk.csproj | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 504c13e..3ac9bda 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -28,3 +28,15 @@ jobs: - name: Integration Tests run: dotnet test --no-build --verbosity normal + + release: + runs-on: ubuntu-latest + needs: build + if: startsWith(github.ref, 'refs/tags/') + + steps: + - name: Create package + run: dotnet pack --no-build --output nupkgs --version-suffix ${{ steps.branch_name.outputs.SOURCE_TAG }} + + - name: Publish package + run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/src/carbon-intensity-sdk/carbon-intensity-sdk.csproj b/src/carbon-intensity-sdk/carbon-intensity-sdk.csproj index 5339d47..18e2fad 100644 --- a/src/carbon-intensity-sdk/carbon-intensity-sdk.csproj +++ b/src/carbon-intensity-sdk/carbon-intensity-sdk.csproj @@ -10,9 +10,10 @@ An unofficial library for the Carbon Intensity API for use in C# application README.md https://github.com/evansabove/carbon-intensity-sdk + CC-BY-4.0 - + True