Release Nuget Package #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will publish the nuget packages when a relase is created | |
name: Release Nuget Package | |
on: | |
release: | |
types: [published, prereleased, released] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get version from release | |
run: | | |
version=${{ github.event.release.tag_name }} | |
version=${version#"v"} # Remove "v" from the beginning | |
echo "Version without 'v': $version" | |
- name: Create package | |
run: | | |
dotnet pack $project_path -c Release --include-symbols -o artifacts -p:PackageVersion=$version | |
env: | |
project_path: src/PipelineNet/PipelineNet.csproj | |
- name: Upload NuGet package (requires secret) | |
run: | | |
dotnet nuget push artifacts/PipelineNet.$version.nupkg --source $NUGET_SOURCE --api-key $NUGET_API_KEY | |
dotnet nuget push artifacts/PipelineNet.$version.symbols.nupkg --source $NUGET_SOURCE --api-key $NUGET_API_KEY | |
env: | |
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) |