diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml
index 97e0a10f9c..310477fa4c 100644
--- a/build/azure-pipelines.yml
+++ b/build/azure-pipelines.yml
@@ -94,23 +94,8 @@ stages:
echo "##vso[task.setvariable variable=majorVersion;isOutput=true]$major"
displayName: Set major version
name: determineMajorVersion
- - task: PowerShell@2
- displayName: Prepare nupkg
- inputs:
- targetType: inline
- script: |
- $umbracoVersion = "$(Build.BuildNumber)" -replace "\+",".g"
- $templatePaths = Get-ChildItem 'templates/**/.template.config/template.json'
-
- foreach ($templatePath in $templatePaths) {
- $a = Get-Content $templatePath -Raw | ConvertFrom-Json
- if ($a.symbols -and $a.symbols.UmbracoVersion) {
- $a.symbols.UmbracoVersion.defaultValue = $umbracoVersion
- $a | ConvertTo-Json -Depth 32 | Set-Content $templatePath
- }
- }
-
- dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
+ - script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
+ displayName: Run dotnet pack
- script: |
sha="$(Build.SourceVersion)"
sha=${sha:0:7}
diff --git a/templates/Umbraco.Templates.csproj b/templates/Umbraco.Templates.csproj
index 3f9e1f0ce4..38848d398a 100644
--- a/templates/Umbraco.Templates.csproj
+++ b/templates/Umbraco.Templates.csproj
@@ -8,6 +8,7 @@
true
true
.
+ NU5128
@@ -43,4 +44,25 @@
UmbracoProject\wwwroot
+
+
+
+
+
+
+
+ <_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
+ <_TemplateJsonFiles>
+ $(IntermediateOutputPath)%(RelativeDir)%(Filename)%(Extension)
+
+
+
+
+
+ <_PackageFiles Remove="@(_TemplateJsonFiles)" />
+ <_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
+ %(RelativeDir)
+
+
+
diff --git a/templates/UmbracoPackage/.template.config/template.json b/templates/UmbracoPackage/.template.config/template.json
index b1b4ef9425..768a7a4bee 100644
--- a/templates/UmbracoPackage/.template.config/template.json
+++ b/templates/UmbracoPackage/.template.config/template.json
@@ -41,7 +41,7 @@
"description": "The version of Umbraco.Cms to add as PackageReference.",
"type": "parameter",
"datatype": "string",
- "defaultValue": "11.0.0",
+ "defaultValue": "*",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"SkipRestore": {
diff --git a/templates/UmbracoPackageRcl/.template.config/template.json b/templates/UmbracoPackageRcl/.template.config/template.json
index c61289f6c2..be7b1c04e8 100644
--- a/templates/UmbracoPackageRcl/.template.config/template.json
+++ b/templates/UmbracoPackageRcl/.template.config/template.json
@@ -42,7 +42,7 @@
"description": "The version of Umbraco.Cms to add as PackageReference.",
"type": "parameter",
"datatype": "string",
- "defaultValue": "11.0.0",
+ "defaultValue": "*",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"SkipRestore": {
diff --git a/templates/UmbracoProject/.template.config/template.json b/templates/UmbracoProject/.template.config/template.json
index 049db86bf1..d88b23c07d 100644
--- a/templates/UmbracoProject/.template.config/template.json
+++ b/templates/UmbracoProject/.template.config/template.json
@@ -51,7 +51,7 @@
"description": "The version of Umbraco.Cms to add as PackageReference.",
"type": "parameter",
"datatype": "string",
- "defaultValue": "11.0.0",
+ "defaultValue": "*",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"UseHttpsRedirect": {