From ee7048ca57646f0e6e671ddc7677ea4270c831ca Mon Sep 17 00:00:00 2001 From: Kamran Sadin Date: Sun, 1 Jun 2025 19:46:43 +0330 Subject: [PATCH] Merge --- .github/workflows/publish-nuget.yml | 56 +++++++++++------------------ 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index f1768df..f56c699 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -2,44 +2,30 @@ name: Publish NuGet Package on: push: - tags: - - 'v*.*.*' # فقط زمانی اجرا میشه که tag مثل v1.2.3 اضافه بشه + branches: + - main 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: | - 6.0.x - 8.0.x - 10.0.100-preview.4 - - - name: Extract version from tag - id: tag - run: | - echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - - - 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.tag.outputs.VERSION }} \ - --no-build -o out - - - name: Push to NuGet - run: | - dotnet nuget push out/*.nupkg \ - --api-key ${{ secrets.NUGET_API_KEY }} \ - --source https://api.nuget.org/v3/index.json + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Pack NuGet + run: dotnet pack --configuration Release --no-build -o out + + - name: Push to NuGet + run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json