Skip to content

Workflow file for this run

name: Publish NuGet Package
on:
release:
types: [ published ]
env:
VERSION: ${{ github.event.release.tag_name }}
jobs:
publish-nuget-package:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.x'
- name: Build the solution 🔨
run: dotnet build -p:Version=${{ env.VERSION }}
- name: Create NuGet package 🌎
run: dotnet pack DolbyIO.Rest/DolbyIO.Rest.csproj -p:Configuration=Release -p:Version=${{ env.VERSION }}
- name: Sign NuGet Package
working-directory: DolbyIO.Rest/bin/Release
run: |
echo "${{ secrets.WINDOWS_CERTIFICATE }}" | base64 --decode > certificate.pfx
dotnet nuget sign DolbyIO.Rest.*.nupkg --certificate-path ./certificate.pfx --certificate-password ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD}} --timestamper http://timestamp.digicert.com/
rm certificate.pfx
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: DolbyIO.Rest/bin/Release
- name: Deploy to NuGet 🚀
working-directory: DolbyIO.Rest/bin/Release
run: dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}