Skip to content

Commit 47ffb5c

Browse files
committed
Change YML files
1 parent 15300a1 commit 47ffb5c

File tree

3 files changed

+54
-58
lines changed

3 files changed

+54
-58
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,47 @@ name: Publish NuGet Package
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
6-
- 'v*.*.*' # فقط زمانی اجرا شود که یک تگ با فرمت vX.Y.Z پوش شود
8+
- 'v*.*.*'
79

810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
11-
# یک شرط اضافه برای اطمینان از اینکه فقط برای تگ‌ها اجرا می‌شود (اختیاری چون trigger اصلی همین کار را می‌کند)
12-
# if: startsWith(github.ref, 'refs/tags/')
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v4 # استفاده از نسخه جدیدتر
17-
with:
18-
fetch-depth: 0 # بسیار مهم برای GitVersion
16+
uses: actions/checkout@v3
1917

20-
- name: Setup .NET SDK
21-
uses: actions/setup-dotnet@v4 # استفاده از نسخه جدیدتر
18+
- name: Setup .NET SDKs
19+
uses: actions/setup-dotnet@v4
2220
with:
23-
dotnet-version: 8.0.x # یا هر نسخه‌ای که پروژه شما نیاز دارد. اگر فقط یکی لازم است، دومی را حذف کنید.
24-
# اگر پروژه شما به 10.0.x هم نیاز دارد، آن را نگه دارید:
25-
# dotnet-version: |
26-
# 8.0.x
27-
# 10.0.x # توجه: .NET 10 هنوز منتشر نشده، احتمالا منظورتان .NET Core 3.1 یا .NET 6/7 بوده؟ یا شاید یک نسخه preview؟
21+
dotnet-version: |
22+
8.0.x
23+
10.0.100-preview.4.25258.110
2824
2925
- name: Install GitVersion
30-
uses: gittools/actions/gitversion/[email protected] # نسخه جدیدتر اکشن
31-
with:
32-
versionSpec: '5.x' # مشخص کردن نسخه GitVersion CLI
26+
uses: gittools/actions/gitversion/[email protected]
3327

34-
- name: Determine Version using GitVersion
35-
id: gitversion # <<<<< اضافه کردن ID برای ارجاع به خروجی
36-
uses: gittools/actions/gitversion/[email protected] # نسخه جدیدتر اکشن
28+
- name: Use GitVersion
29+
uses: gittools/actions/gitversion/[email protected]
3730

3831
- name: Restore dependencies
39-
# اگر فایل csproj در روت نیست، مسیر را مشخص کنید: e.g., src/MyPackage/MyPackage.csproj
40-
run: dotnet restore YourProject.csproj # <--- مسیر فایل csproj خود را جایگزین کنید
32+
run: dotnet restore
4133

4234
- name: Build
43-
# اگر فایل csproj در روت نیست، مسیر را مشخص کنید
44-
run: dotnet build YourProject.csproj --configuration Release --no-restore -p:Version=${{ steps.gitversion.outputs.NuGetVersionV2 }} # <--- مسیر فایل csproj و استفاده از نسخه
35+
run: dotnet build --configuration Release --no-restore
4536

4637
- name: Pack NuGet
47-
# اگر فایل csproj در روت نیست، مسیر را مشخص کنید
4838
run: |
49-
dotnet pack YourProject.csproj --configuration Release \
39+
dotnet pack --configuration Release \
5040
-p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} \
51-
--no-build -o ./out # <--- مسیر فایل csproj خود را جایگزین کنید
41+
--no-build -o out
5242
5343
- name: Push to NuGet
54-
# if: success() # این شرط به طور پیش‌فرض وجود دارد، اگر مراحل قبلی موفق باشند این مرحله اجرا می‌شود
44+
if: success()
5545
run: |
56-
dotnet nuget push ./out/*.nupkg \
46+
dotnet nuget push out/*.nupkg \
5747
--api-key ${{ secrets.NUGET_API_KEY }} \
58-
--source https://api.nuget.org/v3/index.json \
59-
--skip-duplicate # جلوگیری از خطا در صورت وجود نسخه تکراری
48+
--source https://api.nuget.org/v3/index.json

GitVersion.yml

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,47 @@ mode: ContinuousDeployment
22
branches:
33
main:
44
regex: ^main$
5+
tag: ''
56
increment: Minor
6-
track-merge-target: false
77
prevent-increment-of-merged-branch-version: true
8+
track-merge-target: false
9+
tracks-release-branches: false
10+
is-release-branch: false
811
is-mainline: true
9-
pre-release-weight: 0
10-
develop:
11-
regex: ^develop$
12+
pre-release-weight: 55000
13+
release:
14+
regex: ^releases?[/-]
15+
mode: ContinuousDelivery
16+
tag: beta
1217
increment: Patch
18+
prevent-increment-of-merged-branch-version: true
1319
track-merge-target: false
14-
pre-release-weight: 3000
15-
source-branches:
16-
- main
17-
- release
20+
tracks-release-branches: false
21+
is-release-branch: true
22+
is-mainline: false
23+
pre-release-weight: 30000
1824
feature:
1925
regex: ^features?[/-]
20-
increment: Patch
21-
source-branches:
22-
- develop
23-
bugfix:
24-
regex: ^bugfix(es)?[/-]
25-
increment: Patch
26-
source-branches:
27-
- develop
28-
release:
29-
regex: ^release(s)?[/-]
26+
mode: ContinuousDelivery
27+
tag: useBranchName
28+
increment: Inherit
29+
prevent-increment-of-merged-branch-version: false
30+
track-merge-target: false
31+
tracks-release-branches: false
32+
is-release-branch: false
33+
is-mainline: false
34+
pre-release-weight: 30000
35+
develop:
36+
regex: ^dev(elop)?(ment)?$
37+
mode: ContinuousDeployment
38+
tag: alpha
3039
increment: Minor
31-
source-branches:
32-
- develop
33-
hotfix:
34-
regex: ^hotfix(es)?[/-]
35-
increment: Patch
36-
source-branches:
37-
- main
40+
prevent-increment-of-merged-branch-version: true
41+
track-merge-target: false
42+
tracks-release-branches: true
43+
is-release-branch: false
44+
is-mainline: false
45+
pre-release-weight: 0
3846
ignore:
3947
sha: []
40-
merge-message-strategy: MergeMessage
41-
commit-message-incrementing: Enabled
48+
merge-message-formats: {}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.0"
3+
"version": "10.0.100-preview.4.25258.110"
44
}
55
}

0 commit comments

Comments
 (0)