Skip to content

Commit 26be3d7

Browse files
committed
Revert "tweak nuget workflow"
This reverts commit de29436.
1 parent de29436 commit 26be3d7

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
- name: Install dependencies 📦️
2727
run: dotnet restore
2828

29-
# - name: Build 🔨
30-
# run: dotnet build --no-restore -c Release ./src/RazorLight/RazorLight.csproj
29+
- name: Build 🔨
30+
run: dotnet build --no-restore -c Release
3131

3232
# If not using <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
33-
- name: Build 🔨 & Pack NuGet 🏗️
33+
- name: Pack NuGet 🏗️
3434
run: |
35-
dotnet pack -v normal --include-symbols -o nupkg
35+
dotnet pack --no-build -v normal --include-symbols -o nupkg
3636
3737
# Get a short-lived NuGet API key
3838
- name: NuGet login (OIDC → temp API key)

Directory.Build.props

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Deterministic>true</Deterministic>
4+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
5+
6+
<PackageIconUrl>https://raw.githubusercontent.com/jcamp-code/RazorLight/main/assets/razorlight_logo_64x64.png</PackageIconUrl>
7+
<PackageProjectUrl>https://github.com/jcamp-code/RazorLight</PackageProjectUrl>
8+
9+
<RepositoryUrl>https://github.com/jcamp-code/RazorLight</RepositoryUrl>
10+
<RepositoryType>git</RepositoryType>
11+
12+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
13+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
14+
<DebugSymbols>true</DebugSymbols>
15+
<IncludeSymbols>true</IncludeSymbols>
16+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<SourceRoot Include="$(NuGetPackageRoot)" Condition="'$(NuGetPackageRoot)' != ''"/>
25+
</ItemGroup>
26+
</Project>

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Install-Package RazorLight -Version 3.0.0
4141
The simplest scenario is to create a template from string. Each template must have a `templateKey` that is associated with it, so you can render the same template next time without recompilation.
4242

4343
<!-- snippet: simple -->
44+
4445
<a id='snippet-simple'></a>
46+
4547
```cs
4648
var engine = new RazorLightEngineBuilder()
4749
// required to have a default RazorLightProject type,
@@ -56,13 +58,17 @@ ViewModel model = new ViewModel {Name = "John Doe"};
5658

5759
string result = await engine.CompileRenderStringAsync("templateKey", template, model);
5860
```
61+
5962
<sup><a href='/tests/RazorLight.Tests/Snippets/Snippets.cs#L18-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-simple' title='Start of snippet'>anchor</a></sup>
63+
6064
<!-- endSnippet -->
6165

6266
To render a compiled template:
6367

6468
<!-- snippet: RenderCompiledTemplate -->
69+
6570
<a id='snippet-rendercompiledtemplate'></a>
71+
6672
```cs
6773
var cacheResult = engine.Handler.Cache.RetrieveTemplate("templateKey");
6874
if(cacheResult.Success)
@@ -71,7 +77,9 @@ if(cacheResult.Success)
7177
string result = await engine.RenderTemplateAsync(templatePage, model);
7278
}
7379
```
80+
7481
<sup><a href='/tests/RazorLight.Tests/Snippets/Snippets.cs#L39-L46' title='Snippet source file'>snippet source</a> | <a href='#snippet-rendercompiledtemplate' title='Start of snippet'>anchor</a></sup>
82+
7583
<!-- endSnippet -->
7684

7785
# Template sources
@@ -83,7 +91,9 @@ RazorLight can resolve templates from any source, but there are a built-in provi
8391
When resolving a template from filesystem, templateKey - is a relative path to the root folder, that you pass to RazorLightEngineBuilder.
8492

8593
<!-- snippet: FileSource -->
94+
8695
<a id='snippet-filesource'></a>
96+
8797
```cs
8898
var engine = new RazorLightEngineBuilder()
8999
.UseFileSystemProject("C:/RootFolder/With/YourTemplates")
@@ -93,7 +103,9 @@ var engine = new RazorLightEngineBuilder()
93103
var model = new {Name = "John Doe"};
94104
string result = await engine.CompileRenderAsync("Subfolder/View.cshtml", model);
95105
```
106+
96107
<sup><a href='/tests/RazorLight.Tests/Snippets/Snippets.cs#L51-L60' title='Snippet source file'>snippet source</a> | <a href='#snippet-filesource' title='Start of snippet'>anchor</a></sup>
108+
97109
<!-- endSnippet -->
98110

99111
## EmbeddedResource source
@@ -115,7 +127,9 @@ Project.Core/
115127
```
116128

117129
<!-- snippet: EmbeddedResourceSource -->
130+
118131
<a id='snippet-embeddedresourcesource'></a>
132+
119133
```cs
120134
var engine = new RazorLightEngineBuilder()
121135
.UseEmbeddedResourcesProject(typeof(SomeService).Assembly)
@@ -125,13 +139,17 @@ var engine = new RazorLightEngineBuilder()
125139
var model = new Model();
126140
string html = await engine.CompileRenderAsync("EmailTemplates.Body", model);
127141
```
142+
128143
<sup><a href='/tests/RazorLight.Tests/Snippets/Snippets.cs#L65-L74' title='Snippet source file'>snippet source</a> | <a href='#snippet-embeddedresourcesource' title='Start of snippet'>anchor</a></sup>
144+
129145
<!-- endSnippet -->
130146

131147
Setting the root namespace allows you to leave that piece off when providing the template name as the key:
132148

133149
<!-- snippet: EmbeddedResourceSourceWithRootNamespace -->
150+
134151
<a id='snippet-embeddedresourcesourcewithrootnamespace'></a>
152+
135153
```cs
136154
var engine = new RazorLightEngineBuilder()
137155
.UseEmbeddedResourcesProject(typeof(SomeService).Assembly, "Project.Core.EmailTemplates")
@@ -141,7 +159,9 @@ var engine = new RazorLightEngineBuilder()
141159
var model = new Model();
142160
string html = await engine.CompileRenderAsync("Body", model);
143161
```
162+
144163
<sup><a href='/tests/RazorLight.Tests/Snippets/Snippets.cs#L79-L88' title='Snippet source file'>snippet source</a> | <a href='#snippet-embeddedresourcesourcewithrootnamespace' title='Start of snippet'>anchor</a></sup>
164+
145165
<!-- endSnippet -->
146166

147167
## Custom source

src/Directory.Build.props

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
<Project>
2+
<!-- This is what currently determines the version number. -->
23
<PropertyGroup>
3-
<Deterministic>true</Deterministic>
4-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
5-
6-
<PackageIconUrl>https://raw.githubusercontent.com/jcamp-code/RazorLight/main/assets/razorlight_logo_64x64.png</PackageIconUrl>
7-
<PackageProjectUrl>https://github.com/jcamp-code/RazorLight</PackageProjectUrl>
8-
9-
<RepositoryUrl>https://github.com/jcamp-code/RazorLight</RepositoryUrl>
10-
<RepositoryType>git</RepositoryType>
11-
12-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
13-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
14-
<DebugSymbols>true</DebugSymbols>
15-
<IncludeSymbols>true</IncludeSymbols>
16-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
174
<Version>3.0.0</Version>
185
</PropertyGroup>
19-
20-
<ItemGroup>
21-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
22-
</ItemGroup>
236

24-
<ItemGroup>
25-
<SourceRoot Include="$(NuGetPackageRoot)" Condition="'$(NuGetPackageRoot)' != ''"/>
26-
</ItemGroup>
277
</Project>

0 commit comments

Comments
 (0)