Skip to content

add README.md;

add README.md; #5

name: "Publish to NuGet"
on:
push:
tags:
- 'v*'
env:
PROJECT_PATH: 'src'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
jobs:
deploy:
name: 'Publish nuget'
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.x.x' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Display dotnet version
run: dotnet --version
- name: Restore packages
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build project
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
- name: Get Version
id: version
uses: battila7/get-version-action@v2
- run: echo ${{ steps.get_version.outputs.version-without-v }}
- name: Pack project
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Publish package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}