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 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