Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ipvalverde authored Jul 12, 2024
1 parent e4468aa commit d397524
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,23 @@ name: Release Nuget Package

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

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: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- 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
- name: Build and publish
shell: pwsh
run: ./build.ps1 ${{ github.event.release.tag_name }} ${{ github.event.release.description }} ${{ github.event.release.is_pre_release }}
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)

0 comments on commit d397524

Please sign in to comment.