Skip to content

Commit caceee7

Browse files
committed
Fix flow
1 parent 5a2bdd1 commit caceee7

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,42 @@ name: Publish NuGet Package
33
on:
44
push:
55
tags:
6-
- 'v*.*.*' # فقط زمانی اجرا میشه که tag مثل v1.2.3 اضافه بشه
6+
- 'v*.*.*'
77

88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
15-
16-
- name: Setup .NET
17-
uses: actions/setup-dotnet@v4
18-
with:
19-
dotnet-version: |
20-
6.0.x
21-
8.0.x
22-
10.0.100-preview.4
23-
24-
- name: Extract version from tag
25-
id: tag
26-
run: |
27-
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
28-
29-
- name: Restore dependencies
30-
run: dotnet restore
31-
32-
- name: Build
33-
run: dotnet build --configuration Release --no-restore
34-
35-
- name: Pack NuGet
36-
run: |
37-
dotnet pack --configuration Release \
38-
-p:PackageVersion=${{ steps.tag.outputs.VERSION }} \
39-
--no-build -o out
40-
41-
- name: Push to NuGet
42-
run: |
43-
dotnet nuget push out/*.nupkg \
44-
--api-key ${{ secrets.NUGET_API_KEY }} \
45-
--source https://api.nuget.org/v3/index.json
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: |
20+
6.0.x
21+
8.0.x
22+
23+
- name: Extract version from tag
24+
id: tag
25+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build --configuration Release --no-restore
32+
33+
- name: Pack NuGet
34+
run: |
35+
dotnet pack --configuration Release \
36+
-p:PackageVersion=${{ steps.tag.outputs.VERSION }} \
37+
--no-build -o out
38+
39+
- name: Push to NuGet
40+
if: success() && steps.tag.outputs.VERSION != ''
41+
run: |
42+
dotnet nuget push out/*.nupkg \
43+
--api-key ${{ secrets.NUGET_API_KEY }} \
44+
--source https://api.nuget.org/v3/index.json

src/KSFramework/KSFramework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net6.0;net10.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

0 commit comments

Comments
 (0)