Remove .NET 6 #9
Workflow file for this run
This file contains hidden or 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: Publish NuGet Package | |
on: | |
push: | |
branches: | |
- main # وقتی روی برنچ main پوش میشه | |
tags: | |
- 'v*.*.*' # یا وقتی تگ با الگوی vX.Y.Z ساخته میشه | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
10.0.x | |
- name: Setup GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Get version info | |
id: gitversion | |
run: gitversion /output json /showvariable NuGetVersionV2 | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Pack NuGet | |
run: | | |
dotnet pack --configuration Release \ | |
-p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} \ | |
--no-build -o out | |
- name: Push to NuGet | |
if: success() && steps.gitversion.outputs.NuGetVersionV2 != '' | |
run: | | |
dotnet nuget push out/*.nupkg \ | |
--api-key ${{ secrets.NUGET_API_KEY }} \ | |
--source https://api.nuget.org/v3/index.json |