Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Calculate package version (for branch)
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
env:
BRANCH_NAME: ${{ github.ref_name }}
shell: pwsh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@
}
},
{
"id": "4.0.*-main-*",
"id": "4.0.*-*",
"name": {
"text": "Steeltoe 4.0"
"text": "Steeltoe 4.0 (pre-release)"
}
},
{
"id": "4.*-main-*",
"name": {
"text": "Steeltoe 4.x (unstable)"
}
}
],
"defaultValue": "4.0.*-main-*"
"defaultValue": "4.0.*-*"
},
{
"id": "DescriptionOption",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
".vscode/**"
]
},
{
"condition": "(!IsSteeltoeUnstable)",
"exclude": [
"nuget.config"
]
},
{
"condition": "(!HasAnyEfCoreConnector)",
"exclude": [
Expand Down Expand Up @@ -109,7 +115,7 @@
"description": "The Steeltoe version to use.",
"type": "parameter",
"datatype": "string",
"defaultValue": "4.0.*-main-*",
"defaultValue": "4.0.*-*",
"replaces": "$(SteeltoeVersionInCLI)"
},
"IsSteeltoeV3InCLI": {
Expand All @@ -130,6 +136,15 @@
"pattern": "^4"
}
},
"IsSteeltoeUnstableInCLI": {
"type": "generated",
"generator": "regexMatch",
"datatype": "bool",
"parameters": {
"source": "SteeltoeVersionOption",
"pattern": "-main"
}
},
"ChooseSteeltoeVersionInIDE": {
"type": "parameter",
"datatype": "choice",
Expand All @@ -138,7 +153,10 @@
"choice": "3.2.*"
},
{
"choice": "4.0.*-main-*"
"choice": "4.0.*-*"
},
{
"choice": "4.*-main-*"
}
],
"replaces": "$(ChosenSteeltoeVersionInIDE)"
Expand Down Expand Up @@ -170,6 +188,15 @@
"pattern": "^4"
}
},
"HasChosenSteeltoeUnstableInIDE": {
"type": "generated",
"generator": "regexMatch",
"datatype": "bool",
"parameters": {
"source": "ChooseSteeltoeVersionInIDE",
"pattern": "-main"
}
},
"IsSteeltoeV3": {
"type": "computed",
"value": "(HasChosenSteeltoeVersionInIDE && HasChosenSteeltoeV3InIDE) || (!HasChosenSteeltoeVersionInIDE && IsSteeltoeV3InCLI)"
Expand All @@ -178,6 +205,10 @@
"type": "computed",
"value": "(HasChosenSteeltoeVersionInIDE && HasChosenSteeltoeV4InIDE) || (!HasChosenSteeltoeVersionInIDE && IsSteeltoeV4InCLI)"
},
"IsSteeltoeUnstable": {
"type": "computed",
"value": "(HasChosenSteeltoeVersionInIDE && HasChosenSteeltoeUnstableInIDE) || (!HasChosenSteeltoeVersionInIDE && IsSteeltoeUnstableInCLI)"
},
"DescriptionOption": {
"description": "Add a project description.",
"type": "parameter",
Expand Down
9 changes: 9 additions & 0 deletions test/NetCoreTool.Template.WebApi.Test/DefaultsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ protected override async Task AssertProjectGeneration(ProjectOptions options)
await base.AssertProjectGeneration(options);

Sandbox.FileExists("app.config").Should().BeTrue();

if (options.IsUnstableVersion)
{
Sandbox.FileExists("nuget.config").Should().BeTrue();
}
else
{
Sandbox.FileExists("nuget.config").Should().BeFalse();
}
}

protected override void AssertPackageReferencesHook(ProjectOptions options, List<(string, string)> packages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class ProjectOptions
{
public SteeltoeVersion SteeltoeVersion { get; set; }

public bool IsUnstableVersion { get; set; }

public Framework Framework { get; set; }

public Language Language { get; set; }
Expand Down
12 changes: 7 additions & 5 deletions test/NetCoreTool.Template.WebApi.Test/Models/TemplateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ public IEnumerator<object[]> GetEnumerator()
{
return new List<object[]>
{
new object[] { "3.2.8", "net6.0", "C#", },
new object[] { "3.2.8", "net8.0", "C#", },
new object[] { "3.2.8", "net9.0", "C#", },
new object[] { "4.0.*-main-*", "net8.0", "C#", },
new object[] { "4.0.*-main-*", "net9.0", "C#", }
new object[] { "3.2.8", "net6.0", "C#" },
new object[] { "3.2.8", "net8.0", "C#" },
new object[] { "3.2.8", "net9.0", "C#" },
new object[] { "4.0.*-*", "net8.0", "C#" },
new object[] { "4.0.*-*", "net9.0", "C#" },
new object[] { "4.*-main-*", "net8.0", "C#" },
new object[] { "4.*-main-*", "net9.0", "C#" }
}.GetEnumerator();
}

Expand Down
7 changes: 4 additions & 3 deletions test/NetCoreTool.Template.WebApi.Test/ProjectOptionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ protected static string GetPackageVersionForFramework(Framework framework)
};
}

private static ProjectOptions ToProjectOptions(string steeltoeVerison, string framework, string language)
private static ProjectOptions ToProjectOptions(string steeltoeVersion, string framework, string language)
{
return new ProjectOptions
{
SteeltoeVersion = ToSteeltoeEnum(steeltoeVerison),
SteeltoeVersion = ToSteeltoeEnum(steeltoeVersion),
IsUnstableVersion = steeltoeVersion.Contains("-main"),
Framework = ToFrameworkEnum(framework),
Language = ToLanguageEnum(language),
};
Expand All @@ -272,7 +273,7 @@ private static SteeltoeVersion ToSteeltoeEnum(string steeltoe)
{
return SteeltoeVersion.Steeltoe32;
}
if (steeltoe.StartsWith("4.0"))
if (steeltoe.StartsWith("4."))
{
return SteeltoeVersion.Steeltoe40;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ public class SteeltoeParameterTest : ParameterTest
public SteeltoeParameterTest(ITestOutputHelper logger) : base("steeltoe", "The Steeltoe version to use.", logger)
{
Values.Add("3.2.*");
Values.Add("4.0.*-main-*");
Values.Add("4.0.*-*");
Values.Add("4.*-main-*");
}
}
}