diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml
index 5a9b5d23..3a0c3e09 100644
--- a/.github/workflows/nuget-release.yml
+++ b/.github/workflows/nuget-release.yml
@@ -19,6 +19,25 @@ jobs:
run: dotnet --list-sdks
- name: Check .NET runtimes
run: dotnet --list-runtimes
+
+ - name: get version from tag
+ id: get_version
+ run: |
+ realversion="${GITHUB_REF/refs\/tags\//}"
+ realversion="${realversion//v/}"
+ echo "VERSION=$realversion" >> $GITHUB_OUTPUT
+
+ - name: Update version in csproj
+ run: |
+ VERSION=${{ steps.get_version.outputs.VERSION }}
+ echo "Setting version to $VERSION"
+
+ # Update the version in the NRedisStack.csproj file
+ sed -i "s|.*|$VERSION|" ./src/NRedisStack/NRedisStack.csproj
+ sed -i "s|.*|$VERSION|" ./src/NRedisStack/NRedisStack.csproj
+ sed -i "s|.*|$VERSION|" ./src/NRedisStack/NRedisStack.csproj
+ cat ./src/NRedisStack/NRedisStack.csproj
+
- name: Build
run: dotnet pack -c Release --output .
- name: Publish