Skip to content

Manual CD to Nuget

Manual CD to Nuget #1

Workflow file for this run

name: "Manual CD to Nuget"
on:
workflow_dispatch:
inputs:
version:
description: 'Nuget Package Version'
required: true
default: 1.0.0
env:
PACKAGE_NAME: 'Hrimsoft.StringCases'
PROJECT_PATH: 'Hrimsoft.StringCases/Hrimsoft.StringCases.csproj'
TESTS_PROJECT_PATH: 'Hrimsoft.StringCases.Tests/Hrimsoft.StringCases.Tests.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
jobs:
deploy:
name: 'Deploy'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install dotnet'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 'Restore packages'
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: 'Build project'
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
- name: 'Pack project'
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols --include-source -p:PackageVersion=${{ github.event.inputs.version }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: 'Push package'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\${{ env.PACKAGE_NAME }}.${{ github.event.inputs.version }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}