Skip to content

Commit

Permalink
Publish nuget packages (#16)
Browse files Browse the repository at this point in the history
* Rename dotnet.yml to build.yml

* Publish nuget packages on release
  • Loading branch information
ipvalverde authored Jul 3, 2024
1 parent 52a40b3 commit e7e0f79
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will publish the nuget packages when a relase is created

name: .NET

on:
release:
types: [published, prereleased, released]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Create package
run: |
dotnet pack $(project_path) -c Release --include-symbols -o artifacts -p:PackageVersion=${{ github.event.release.tag_name }} -p:PackageReleaseNotes=${{ github.event.release.description }}
- name: Upload NuGet package (requires secret)
run: |
dotnet nuget push artifacts/PipelineNet.${{ github.event.release.tag_name }}.nupkg --source $NUGET_SOURCE --api-key $NUGET_API_KEY
dotnet nuget push artifacts/PipelineNet.${{ github.event.release.tag_name }}.symbols.nupkg --source $NUGET_SOURCE --api-key $NUGET_API_KEY
env:
project_path: src/PipelineNet/PipelineNet.csproj
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} # Replace with your NuGet source (public or private)
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} # Replace with your NuGet API key (stored as secret)

0 comments on commit e7e0f79

Please sign in to comment.