Skip to content

Commit c750cd9

Browse files
committed
Working on Auto Increament Version
1 parent be332cf commit c750cd9

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish NuGet Package on Tag
1+
name: Publish NuGet Package
22

33
on:
44
push:
@@ -12,29 +12,29 @@ jobs:
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v3
15-
with:
16-
fetch-depth: 0
1715

18-
- name: Setup .NET
16+
- name: Setup .NET SDK
1917
uses: actions/setup-dotnet@v4
2018
with:
21-
dotnet-version: 10.0.x
19+
dotnet-version: 8.0.x
2220

23-
- name: Extract tag version
24-
id: tag_version
25-
run: |
26-
TAG=${GITHUB_REF#refs/tags/}
27-
echo "TAG_VERSION=${TAG#v}" >> $GITHUB_OUTPUT
21+
- name: Extract version from tag
22+
id: get_version
23+
run: echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
2824

29-
- name: Restore
30-
run: dotnet restore
25+
- name: Restore dependencies
26+
run: dotnet restore KSFramework.sln
3127

3228
- name: Build
33-
run: dotnet build --configuration Release --no-restore
29+
run: dotnet build KSFramework.sln --configuration Release --no-restore
3430

35-
- name: Pack
36-
run: dotnet pack --configuration Release --no-build -o out \
37-
-p:PackageVersion=${{ steps.tag_version.outputs.TAG_VERSION }}
31+
- name: Pack NuGet
32+
run: dotnet pack src/KSFramework/KSFramework.csproj \
33+
--configuration Release \
34+
-p:PackageVersion=${{ env.PACKAGE_VERSION }} \
35+
--no-build -o out
3836

3937
- name: Push to NuGet
40-
run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
38+
run: dotnet nuget push out/*.nupkg \
39+
--api-key ${{ secrets.NUGET_API_KEY }} \
40+
--source https://api.nuget.org/v3/index.json

src/KSFramework/KSFramework.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<PropertyGroup>
1010
<PackageId>KSFramework</PackageId>
11-
<Version>1.4.0</Version>
1211
<Authors>Kamran Sadin</Authors>
1312
<Company>Sadin</Company>
1413
<CopyRight>Copyright (c) 2022 SadinCo.</CopyRight>

0 commit comments

Comments
 (0)