From 47665c7b14832fe2352f00f229294f2a227ba15b Mon Sep 17 00:00:00 2001 From: Israel Valverde Date: Wed, 3 Jul 2024 20:49:34 +0100 Subject: [PATCH 1/2] Rename dotnet.yml to build.yml --- .github/workflows/{dotnet.yml => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dotnet.yml => build.yml} (100%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/dotnet.yml rename to .github/workflows/build.yml From e81696341d45d3ea4fd510804429cb316f994149 Mon Sep 17 00:00:00 2001 From: Israel Valverde Date: Wed, 3 Jul 2024 21:45:45 +0100 Subject: [PATCH 2/2] Publish nuget packages on release --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..10c1744 --- /dev/null +++ b/.github/workflows/release.yml @@ -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) \ No newline at end of file