From ea9b4fe814cfa70ba869f58f7659c1bc8fa9e192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Szab=C3=B3?= Date: Fri, 7 Jul 2023 09:07:50 +0200 Subject: [PATCH] Fixed generating class names from razor files containing dash ('-') characters --- .github/workflows/cd-nuget.yml | 7 +++---- src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj | 6 +++--- src/TypedRoutes/TypedRoutesGenerator.cs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-nuget.yml b/.github/workflows/cd-nuget.yml index 136c732..dea3501 100644 --- a/.github/workflows/cd-nuget.yml +++ b/.github/workflows/cd-nuget.yml @@ -1,4 +1,4 @@ -on: { push: { tags: ["*"] } } +on: { push: { tags: ["v[0-9]+.[0-9]+.[0-9]+*"] } } jobs: publish: @@ -6,6 +6,5 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v3 - - run: dotnet pack -c:Release -p:Version=${{ github.ref_name }} -p:RepositoryCommit=${{ github.sha }} - - env: { NUGET_API_KEY: "${{ secrets.NUGET_API_KEY }}" } - run: dotnet nuget push ./src/TypedRoutes/bin/Release/PodNet.Blazor.TypedRoutes.*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json + - run: dotnet pack -c:Release -p:Version=$(echo ${{ github.ref_name }} | sed 's/^v//') -p:RepositoryCommit=${{ github.sha }} + - run: dotnet nuget push ./src/TypedRoutes/bin/Release/PodNet.Blazor.TypedRoutes.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json diff --git a/src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj b/src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj index 501ced7..0edb782 100644 --- a/src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj +++ b/src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj @@ -4,14 +4,14 @@ netstandard2.0 true - 0.0.0-unset + 0.0.0-debug true false false true $(NoWarn);NU5128 - + PodNet.Blazor.TypedRoutes PodNet.Blazor.TypedRoutes $(Version) @@ -33,7 +33,7 @@ - + diff --git a/src/TypedRoutes/TypedRoutesGenerator.cs b/src/TypedRoutes/TypedRoutesGenerator.cs index fcb764c..98d633c 100644 --- a/src/TypedRoutes/TypedRoutesGenerator.cs +++ b/src/TypedRoutes/TypedRoutesGenerator.cs @@ -107,7 +107,7 @@ static IEnumerable GetRoutesFromPageDirectives((AdditionalText Additi @namespace = input.Build.RootNamespace; } - var @className = Path.GetFileNameWithoutExtension(input.AdditionalText.Path); + var @className = Path.GetFileNameWithoutExtension(input.AdditionalText.Path).Replace('-', '_'); if (typeparam != null) @className += $"<{typeparam}>";