Skip to content

Commit

Permalink
Upgrade to dotnet 7
Browse files Browse the repository at this point in the history
  • Loading branch information
mannkind committed Nov 20, 2022
1 parent 7245083 commit 3622d98
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

ARG DOTNETCORE_VERSION=6.0
ARG DOTNETCORE_VERSION=7.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNETCORE_VERSION}

# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
version: ${{ steps.version.outputs.number }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'

- name: Build Project
run: dotnet build -c Release -o output APC
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Obtain Version
id: version
run: echo "::set-output name=number::$(./output/APC -- version)"
run: echo "number=$(./output/APC -- version)" >> $GITHUB_OUTPUT

- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash)
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
id: build_version
run: |
BUILD_VERSION="${{ needs.build.outputs.version }}"
echo "::set-output name=number::${BUILD_VERSION:1}"
echo "number=${BUILD_VERSION:1}" >> $GITHUB_OUTPUT
- name: Build and Push (Dev)
if: github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Tag Revision
run: |
git tag -f ${{ needs.build.outputs.version }}
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.1.$([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.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>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RestoreSources>$(RestoreSources);../vendor;https://api.nuget.org/v3/index.json</RestoreSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="twomqtt" Version="0.12.*" />
<PackageReference Include="twomqtt" Version="0.13.*" />
<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>net6.0</TargetFramework>
<TargetFramework>net7.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:6.0 as build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.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:6.0 AS runtime
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
COPY --from=build /src/output app
ENTRYPOINT ["dotnet", "./app/APC.dll"]

0 comments on commit 3622d98

Please sign in to comment.