Skip to content

Commit

Permalink
Upgrade to dotnet8
Browse files Browse the repository at this point in the history
  • Loading branch information
mannkind committed Feb 4, 2024
1 parent 3622d98 commit e176efb
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 97 deletions.
79 changes: 0 additions & 79 deletions .devcontainer/Dockerfile

This file was deleted.

26 changes: 15 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "twomqtt",
"dockerFile": "Dockerfile",
"settings": {
"csharpsortusings.sort.usings.splitGroups": false
},
"remoteUser": "vscode",
"extensions": [
"ms-dotnettools.csharp",
"k--kato.docomment",
"jongrant.csharpsortusings"
]
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit"
]
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- name: Build Project
run: dotnet build -c Release -o output APC
Expand Down
6 changes: 3 additions & 3 deletions APC/APC.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>0.2.$([System.DateTime]::UtcNow.ToString(yy))$([System.DateTime]::UtcNow.DayOfYear.ToString(000)).$([System.DateTime]::UtcNow.ToString(HHmm))$([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.Second), 6))))</VersionPrefix>
<VersionPrefix>0.3.$([System.DateTime]::UtcNow.ToString(yy))$([System.DateTime]::UtcNow.DayOfYear.ToString(000)).$([System.DateTime]::UtcNow.ToString(HHmm))$([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.Second), 6))))</VersionPrefix>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<RestoreSources>$(RestoreSources);../vendor;https://api.nuget.org/v3/index.json</RestoreSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="twomqtt" Version="0.13.*" />
<PackageReference Include="twomqtt" Version="0.15.*" />
<PackageReference Include="Apcupsd.NET" Version="1.*" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<RestoreSources>$(RestoreSources);../vendor;https://api.nuget.org/v3/index.json</RestoreSources>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $BUILDPLATFORM ensures the native build platform is utilized
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 as build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 as build
WORKDIR /src
# Only fetch dependencies once
# Find the non-test csproj file, move it to the appropriate folder, and restore project deps
Expand All @@ -12,6 +12,6 @@ COPY . ./
ARG BUILD_VERSION=0.0.0.0
RUN dotnet build -o output -c Release --no-restore -p:Version=$BUILD_VERSION APC

FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
COPY --from=build /src/output app
ENTRYPOINT ["dotnet", "./app/APC.dll"]
31 changes: 31 additions & 0 deletions apc2mqtt.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APC", "APC\APC.csproj", "{9C1B55C4-D1BF-4DB4-8315-A69056631A85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APCTest", "APCTest\APCTest.csproj", "{DDCB5150-05B5-412A-9C59-2AE6542BC1E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9C1B55C4-D1BF-4DB4-8315-A69056631A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C1B55C4-D1BF-4DB4-8315-A69056631A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C1B55C4-D1BF-4DB4-8315-A69056631A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C1B55C4-D1BF-4DB4-8315-A69056631A85}.Release|Any CPU.Build.0 = Release|Any CPU
{DDCB5150-05B5-412A-9C59-2AE6542BC1E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDCB5150-05B5-412A-9C59-2AE6542BC1E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDCB5150-05B5-412A-9C59-2AE6542BC1E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDCB5150-05B5-412A-9C59-2AE6542BC1E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3A3641D4-BDC7-4C62-B9D5-AE8DA643642D}
EndGlobalSection
EndGlobal

0 comments on commit e176efb

Please sign in to comment.