Skip to content

Commit 3cc3b09

Browse files
committed
chore: add tagging in workflow file
1 parent 594e2af commit 3cc3b09

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/dotnet-desktop.yml

+18-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
Solution_Name: CodeGenerator.sln
2020
Wpf_Project_Path: CodeGenerator\CodeGenerator.csproj
2121
Output_Dir: ${{ github.workspace }}\publish
22-
Rar_File: ${{ github.workspace }}\CodeGenerator-${{ github.sha }}.rar
22+
Rar_File: ${{ github.workspace }}\CodeGenerator.rar
2323

2424
steps:
2525
- name: Checkout
@@ -54,20 +54,28 @@ jobs:
5454
env:
5555
Configuration: ${{ matrix.configuration }}
5656

57-
# - name: Upload the .rar file
58-
# uses: actions/upload-artifact@v4
59-
# with:
60-
# name: CodeGenerator-${{ github.sha }}.rar
61-
# path: $env:Rar_File
57+
- name: Install GitVersion
58+
uses: gittools/actions/gitversion/setup@v3.0.0
59+
with:
60+
versionSpec: "6.x"
61+
62+
- name: Determine Version
63+
id: gitversion
64+
uses: gittools/actions/gitversion/execute@v3.0.0
65+
66+
- name: Create and Push git tag
67+
run: |
68+
git tag v${{ steps.gitversion.outputs.GITVERSION_MajorMinorPatch }}"
69+
git push origin v${{ steps.gitversion.outputs.GITVERSION_MajorMinorPatch }}"
6270
6371
- name: Create GitHub Release
6472
id: create_release
6573
uses: actions/create-release@v1
6674
env:
6775
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6876
with:
69-
tag_name: ${{ github.sha }}
70-
release_name: "Release ${{ github.sha }}"
77+
tag_name: v${{ steps.gitversion.outputs.GITVERSION_MajorMinorPatch }}
78+
release_name: "Release v${{ steps.gitversion.outputs.GITVERSION_MajorMinorPatch }}"
7179
draft: false
7280
prerelease: false
7381

@@ -77,6 +85,6 @@ jobs:
7785
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7886
with:
7987
upload_url: ${{ steps.create_release.outputs.upload_url }}
80-
asset_path: $env:Rar_File
81-
asset_name: CodeGenerator-${{ github.sha }}.rar
88+
asset_path: ${{ github.workspace }}\CodeGenerator.rar
89+
asset_name: CodeGenerator.rar
8290
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)