Skip to content

Commit 2e97417

Browse files
committed
fix version extraction with run on windows
1 parent 720a6d1 commit 2e97417

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/directnet-nuget-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Push the package to nuget.org
2626
run: |
2727
# Extract the version from the csproj file
28-
VERSION=$(grep -Eoi "<version>([[:digit:]\.]+)</version>" DirectNet.Net/DirectNet.Net.csproj | sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p')
28+
$VERSION=([xml] (Get-Content .\DirectNet.Net\DirectNet.Net.csproj)).Project.PropertyGroup.Version
2929
3030
# Publish the package to nuget.org
3131
dotnet nuget push ./bin/Release/DirectNet.Net.$VERSION.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.DirectNetAPIKey }}

DirectNet.Net/DirectNet.Net.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
</PropertyGroup>
99

10-
<PropertyGroup>
10+
<PropertyGroup>
1111
<PackageId>DirectNet.Net</PackageId>
1212
<Version>1.0.0</Version>
1313
<Authors>Frédéric Jacques</Authors>

0 commit comments

Comments
 (0)