Skip to content

Commit

Permalink
Merge pull request #20 from johnkors/chore/dotnet-8
Browse files Browse the repository at this point in the history
.NET 8 support
  • Loading branch information
johnkors authored Nov 15, 2023
2 parents 41143ad + 8f84709 commit cd3b400
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
dotnet-version: "8.0.x"
- name: Test
run: dotnet test source/dotnet-pr.tests --logger "GitHubActions;report-warnings=false"
- name: Run tool in docker
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET 7
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: "5.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Pack
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET 7
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env

WORKDIR /
COPY ./ ./therepo
Expand All @@ -13,7 +13,5 @@ ENV PATH="/root/.dotnet/tools:${PATH}"
RUN dotnet tool list -g
WORKDIR /therepo/source/dotnet-PR/Strategies
RUN pr --debug
RUN pr
RUN pr some-target-branch
RUN pr atarget --debug
RUN pr --debug somothertarget
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
branches:
master:
regex: ^master$
regex: ^main$
mode: ContinuousDeployment
tag: ""
feature:
regex: ^features?[/-]|(?!^master$|^(hotfix|bugfix)(es)?[/-]|^support[/-]|(^(pull|pull\-requests|pr)[/-]))(^.*$)
regex: ^features?[/-]|(?!^main$|^(hotfix|bugfix)(es)?[/-]|^support[/-]|(^(pull|pull\-requests|pr)[/-]))(^.*$)
mode: ContinuousDeployment
tag: "feature"
pull-request:
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ This a .NET Core Global Tool that ..

## Installation

* Running the tool: [.NET 3 or 6](https://dotnet.microsoft.com/download)
* Development: Both .NET 3 and 6
* Running the tool: [.NET 7 or 8](https://dotnet.microsoft.com/download)
* Development: .NET 8 SDK

## Install

Expand Down
2 changes: 1 addition & 1 deletion source/dotnet-pr.tests/dotnet-pr.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0</TargetFrameworks>
<RootNamespace>dotnet_pr.tests</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
9 changes: 7 additions & 2 deletions source/dotnet-pr/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
var logger = serviceProvider.GetService<ILogger<Program>>();
logger.LogError($\\_(ツ)_/¯ \n{ae.Message}");
}
catch (Exception e)
{
var logger = serviceProvider.GetService<ILogger<Program>>();
logger.LogError($\\_(ツ)_/¯ \n{e.Message}");
}

ServiceProvider Bootstrap(string[] args)
{
Expand All @@ -24,11 +29,11 @@ ServiceProvider Bootstrap(string[] args)
{
var restOfArgs = args.ToList();
restOfArgs.Remove("--debug");
targetBranch = restOfArgs.Any() ? restOfArgs[0] : "master";
targetBranch = restOfArgs.Any() ? restOfArgs[0] : "main";
}
else
{
targetBranch = "master";
targetBranch = "main";
}
var debugOptions = new AppOptions
{
Expand Down
10 changes: 5 additions & 5 deletions source/dotnet-pr/dotnet-pr.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0</TargetFrameworks>
<PackageId>dotnet-pr</PackageId>
<ToolCommandName>pr</ToolCommandName>
<Authors>John Korsnes</Authors>
Expand All @@ -23,10 +23,10 @@
<PackageReference Include="LibGit2Sharp" Version="0.27.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
Expand Down

0 comments on commit cd3b400

Please sign in to comment.