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
name: Deploy NuGet Package after Release | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
deploy-nuget-package: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Determine Version | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Set the versions | |
run: | | |
echo "NUGET_VERSION=${{ steps.gitversion.outputs.SemVer }}" >> $env:GITHUB_ENV | |
echo "ASSEMBLY_VERSION=${{ steps.gitversion.outputs.AssemblySemVer }}" >> $env:GITHUB_ENV | |
echo "FILE_VERSION=${{ steps.gitversion.outputs.AssemblySemVer }}" >> $env:GITHUB_ENV | |
echo "INFORMATIONAL_VERSION=${{ steps.gitversion.outputs.InformationalVersion }}" >> $env:GITHUB_ENV | |
- name: Build NuGet package | |
run: | | |
dotnet pack ./src/RxDBDotNet/RxDBDotNet.csproj ` | |
--configuration Release ` | |
--output ./nuget ` | |
/p:Version=$env:NUGET_VERSION ` | |
/p:AssemblyVersion=$env:ASSEMBLY_VERSION ` | |
/p:FileVersion=$env:FILE_VERSION ` | |
/p:InformationalVersion=$env:INFORMATIONAL_VERSION | |
- name: Publish NuGet package to NuGet.org | |
run: | | |
$package = Get-ChildItem -Path ./nuget -Filter RxDBDotNet*.nupkg | Select-Object -First 1 | |
dotnet nuget push $package.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
- name: Display Package Info | |
run: | | |
echo "Package file:" | |
Get-ChildItem -Path ./nuget -Filter RxDBDotNet*.nupkg | Format-Table Name, FullName |