From be332cfb98001d51ec5e46eae0ed98d11a7d7dde Mon Sep 17 00:00:00 2001 From: Kamran Sadin Date: Sun, 1 Jun 2025 21:50:44 +0330 Subject: [PATCH 1/3] Fix minor issues in KSFramework --- .github/workflows/publish-nuget.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 7f62bdc..38c2901 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -1,9 +1,9 @@ -name: Publish NuGet Package +name: Publish NuGet Package on Tag on: push: - branches: - - main + tags: + - 'v*.*.*' jobs: publish: @@ -12,20 +12,29 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Setup .NET SDK + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - - name: Restore dependencies + - name: Extract tag version + id: tag_version + run: | + TAG=${GITHUB_REF#refs/tags/} + echo "TAG_VERSION=${TAG#v}" >> $GITHUB_OUTPUT + + - name: Restore 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: Pack + run: dotnet pack --configuration Release --no-build -o out \ + -p:PackageVersion=${{ steps.tag_version.outputs.TAG_VERSION }} - name: Push to NuGet run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json From c750cd96d86c47d7c3460f6c9dd98f222100c21c Mon Sep 17 00:00:00 2001 From: Kamran Sadin Date: Sun, 1 Jun 2025 22:01:49 +0330 Subject: [PATCH 2/3] Working on Auto Increament Version --- .github/workflows/publish-nuget.yml | 34 ++++++++++++++--------------- src/KSFramework/KSFramework.csproj | 1 - 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 38c2901..153bf70 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -1,4 +1,4 @@ -name: Publish NuGet Package on Tag +name: Publish NuGet Package on: push: @@ -12,29 +12,29 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup .NET + - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 10.0.x + dotnet-version: 8.0.x - - name: Extract tag version - id: tag_version - run: | - TAG=${GITHUB_REF#refs/tags/} - echo "TAG_VERSION=${TAG#v}" >> $GITHUB_OUTPUT + - name: Extract version from tag + id: get_version + run: echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - name: Restore - run: dotnet restore + - name: Restore dependencies + run: dotnet restore KSFramework.sln - name: Build - run: dotnet build --configuration Release --no-restore + run: dotnet build KSFramework.sln --configuration Release --no-restore - - name: Pack - run: dotnet pack --configuration Release --no-build -o out \ - -p:PackageVersion=${{ steps.tag_version.outputs.TAG_VERSION }} + - name: Pack NuGet + run: dotnet pack src/KSFramework/KSFramework.csproj \ + --configuration Release \ + -p:PackageVersion=${{ env.PACKAGE_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 + run: dotnet nuget push out/*.nupkg \ + --api-key ${{ secrets.NUGET_API_KEY }} \ + --source https://api.nuget.org/v3/index.json diff --git a/src/KSFramework/KSFramework.csproj b/src/KSFramework/KSFramework.csproj index ad6aa35..97b1869 100644 --- a/src/KSFramework/KSFramework.csproj +++ b/src/KSFramework/KSFramework.csproj @@ -8,7 +8,6 @@ KSFramework - 1.4.0 Kamran Sadin Sadin Copyright (c) 2022 SadinCo. From 5a5104352e02af880fd6de9ba95383572f128ce5 Mon Sep 17 00:00:00 2001 From: Kamran Sadin Date: Sun, 1 Jun 2025 22:19:26 +0330 Subject: [PATCH 3/3] Work on Auto Version Increament --- .github/workflows/publish-nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 153bf70..7cb4da3 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Extract version from tag id: get_version