Skip to content

Commit

Permalink
Switch to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Nov 14, 2023
1 parent 129df42 commit 5d7a74e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # 3.2.0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Run tests
# Tests need access to secrets, so we can't run them against PRs because of limited trust
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # 3.2.0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Publish app
run: >
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Version>2.42.3</Version>
<Company>Tyrrrz</Company>
<Copyright>Copyright (c) Oleksii Holub</Copyright>
Expand Down
4 changes: 2 additions & 2 deletions DiscordChatExporter.Cli.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -- Build
# Specify the platform here so that we pull the SDK image matching the host platform,
# instead of the target platform specified during build by the `--platform` option.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build

# Expose the target architecture set by the `docker build --platform` option, so that
# we can build the assembly for the correct platform.
Expand All @@ -26,7 +26,7 @@ RUN dotnet publish DiscordChatExporter.Cli \

# -- Run
# Use `runtime-deps` instead of `runtime` because we have a self-contained assembly
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine AS run
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine AS run

LABEL org.opencontainers.image.title="DiscordChatExporter.Cli"
LABEL org.opencontainers.image.description="DiscordChatExporter is an application that can be used to export message history from any Discord channel to a file."
Expand Down
3 changes: 1 addition & 2 deletions DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using DiscordChatExporter.Core.Exporting;
using DiscordChatExporter.Core.Exporting.Filtering;
using DiscordChatExporter.Core.Exporting.Partitioning;
using DiscordChatExporter.Core.Utils;
using DiscordChatExporter.Core.Utils.Extensions;
using Gress;
using Spectre.Console;
Expand Down Expand Up @@ -163,7 +162,7 @@ protected async ValueTask ExportAsync(IConsole console, IReadOnlyList<Channel> c
|| OutputPath.Contains('%')
// Otherwise, require an existing directory or an unambiguous directory path
|| Directory.Exists(OutputPath)
|| PathEx.IsDirectoryPath(OutputPath);
|| Path.EndsInDirectorySeparator(OutputPath);

if (!isValidOutputPath)
{
Expand Down
3 changes: 0 additions & 3 deletions DiscordChatExporter.Core/Utils/PathEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ public static string EscapeFileName(string path)

return buffer.ToString();
}

public static bool IsDirectoryPath(string path) =>
path.EndsWith(Path.DirectorySeparatorChar) || path.EndsWith(Path.AltDirectorySeparatorChar);
}

0 comments on commit 5d7a74e

Please sign in to comment.