Skip to content

Commit

Permalink
Auto set version in csproj (#392)
Browse files Browse the repository at this point in the history
auto set version in csproj
  • Loading branch information
atakavci authored Feb 7, 2025
1 parent 3ec82af commit 07caabc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/nuget-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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>.*</Version>|<Version>$VERSION</Version>|" ./src/NRedisStack/NRedisStack.csproj
sed -i "s|<ReleaseVersion>.*</ReleaseVersion>|<ReleaseVersion>$VERSION</ReleaseVersion>|" ./src/NRedisStack/NRedisStack.csproj
sed -i "s|<PackageVersion>.*</PackageVersion>|<PackageVersion>$VERSION</PackageVersion>|" ./src/NRedisStack/NRedisStack.csproj
cat ./src/NRedisStack/NRedisStack.csproj
- name: Build
run: dotnet pack -c Release --output .
- name: Publish
Expand Down

0 comments on commit 07caabc

Please sign in to comment.