Skip to content

Commit

Permalink
Publish to Nuget on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
andyevansrazor committed Mar 10, 2024
1 parent 1418a84 commit c068d24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/carbon-intensity-sdk/carbon-intensity-sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
<Description>An unofficial library for the Carbon Intensity API for use in C# application</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/evansabove/carbon-intensity-sdk</RepositoryUrl>
<PackageLicenseExpression>CC-BY-4.0</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>

Expand Down

0 comments on commit c068d24

Please sign in to comment.