Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Nov 10, 2022
2 parents ef09ab8 + 38cad60 commit 87a0541
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.3.0",
"version": "3.0.0",
"commands": [
"dotnet-cake"
]
},
"dpi": {
"version": "2022.10.28.57",
"version": "2022.11.10.59",
"commands": [
"dpi"
]
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,27 @@
@devlead .NET Console Template is my opinionated template alternative to `dotnet new console`.

Background and more details in my blog post [My preferred .NET console stack](https://www.devlead.se/posts/2021/2021-01-15-my-preferred-console-stack).

## Installation

```PowerShell
dotnet new install Devlead.Console.Template
```

## Usage

Create a new project with same name as folder

```PowerShell
dotnet new devleadconsole
```

Create a new project with specified name
```PowerShell
dotnet new devleadconsole -n MyConsole
```

Create a new project with specified target framework `net6.0` or `net7.0` supported (*default `net7.0`*).
```PowerShell
dotnet new devleadconsole -n MyConsole --framework net6.0
```
25 changes: 25 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,30 @@ Task("Clean")
}
)
)
.Then("Create-GitHub-Release")
.WithCriteria<BuildData>( (context, data) => data.ShouldPushNuGetPackages())
.Does<BuildData>(
static (context, data) => context
.Command(
new CommandSettings {
ToolName = "GitHub CLI",
ToolExecutableNames = new []{ "gh.exe", "gh" },
EnvironmentVariables = { { "GH_TOKEN", data.GitHubNuGetApiKey } }
},
new ProcessArgumentBuilder()
.Append("release")
.Append("create")
.Append(data.Version)
.AppendSwitchQuoted("--title", data.Version)
.Append("--generate-notes")
.Append(string.Join(
' ',
context
.GetFiles(data.NuGetOutputPath.FullPath + "/*.nupkg")
.Select(path => path.FullPath.Quote())
))

)
)
.Then("GitHub-Actions")
.Run();
5 changes: 2 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"sdk": {
"version": "7.0.100-rc.2.22477.23",
"rollForward": "latestMajor",
"allowPrerelease": true
"version": "7.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework) == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-rc.2.22472.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0-rc.2.22472.3" />
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Spectre.Console.Cli.Extensions.DependencyInjection" Version="0.1.0" />
Expand Down

0 comments on commit 87a0541

Please sign in to comment.