Skip to content

Commit

Permalink
Target .NET 8 instead of 7, which is no longer supported. Update depe…
Browse files Browse the repository at this point in the history
…ndencies.
  • Loading branch information
Aldaviva committed Jun 25, 2024
1 parent b12d451 commit 0e45ee2
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 43 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ jobs:
build:
env:
ProjectName: DryerDuty
TargetPlatform: linux-arm

runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3.5.2
uses: actions/checkout@v4

- name: Initialize test reporting
uses: testspace-com/setup-testspace@v1
Expand All @@ -26,8 +25,15 @@ jobs:
run: dotnet restore --locked-mode

- name: Build
run: dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime ${{ env.TargetPlatform }} --no-self-contained
run: |
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm --no-self-contained
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm64 --no-self-contained
- name: Publish
run: |
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm --no-self-contained
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm64 --no-self-contained
- name: Test
shell: bash
run: |
Expand All @@ -48,16 +54,24 @@ jobs:
- name: Stop if tests failed
run: exit ${{ env.TEST_EXIT_CODE }}

- name: Publish
run: dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime ${{ env.TargetPlatform }} --no-self-contained

- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
- name: Upload ARM32 artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}-linux-arm32
path: |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/${{ env.ProjectName }}
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.service
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.so
if-no-files-found: error

- name: Upload ARM64 artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}
name: ${{ env.ProjectName }}-linux-arm64
path: |
${{ env.ProjectName }}/bin/Release/net7.0/${{ env.TargetPlatform }}/publish/${{ env.ProjectName }}
${{ env.ProjectName }}/bin/Release/net7.0/${{ env.TargetPlatform }}/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net7.0/${{ env.TargetPlatform }}/publish/*.service
${{ env.ProjectName }}/bin/Release/net7.0/${{ env.TargetPlatform }}/publish/*.so
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/${{ env.ProjectName }}
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.service
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.so
if-no-files-found: error
8 changes: 4 additions & 4 deletions DryerDuty/DryerDuty.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifiers>linux-arm;win-x64;linux-x64</RuntimeIdentifiers>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifiers>linux-arm;linux-arm64;win-x64;linux-x64</RuntimeIdentifiers>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RollForward>major</RollForward>
<RollForward>latestMajor</RollForward>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<ServerGarbageCollection>true</ServerGarbageCollection>
<NoWarn>CS8524</NoWarn>
Expand All @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Iot.Device.Bindings" Version="3.1.0" />
<PackageReference Include="Iot.Device.Bindings" Version="3.2.0" />
<PackageReference Include="PagerDuty" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DryerDuty/dryerduty.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Enable auto-start: sudo systemctl enable dryerduty.service
# Start: sudo systemctl start dryerduty.service
# Check status: sudo systemctl status dryerduty.service
# Read logs: sudo journalctl -u dryerduty.service
# Read logs: sudo journalctl -f -u dryerduty.service

[Unit]
Description=DryerDuty
Expand Down
111 changes: 99 additions & 12 deletions DryerDuty/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"version": 1,
"dependencies": {
"net7.0": {
"net8.0": {
"Iot.Device.Bindings": {
"type": "Direct",
"requested": "[3.1.0, )",
"resolved": "3.1.0",
"contentHash": "sYRUgAlLsHaRgeAhygd1YSTZE9g4/DEUpUt43h9DMPaoFKhqQ02kBRo6qnIc0/2R2dtoakGKEqa8kao5oywZjA==",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "aOYcxAOs2wS3DwnRGsWqMOQrdniWHhcRVhLSwL/CJolzJisAJwrYG6srBPAZ8OsxRuSdEJwsHE5NGnu3gry5Og==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "7.0.0",
"System.Device.Gpio": "3.1.0",
"Microsoft.Extensions.Logging.Abstractions": "7.0.1",
"System.Device.Gpio": "3.2.0",
"System.Drawing.Common": "6.0.0",
"System.IO.Pipelines": "7.0.0",
"System.IO.Ports": "5.0.1",
"System.Management": "5.0.0",
"System.Text.Json": "6.0.1",
"System.Text.Json": "6.0.9",
"UnitsNet": "5.31.0"
}
},
Expand Down Expand Up @@ -380,8 +380,8 @@
},
"System.Device.Gpio": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "4Jw7+lTwdU63zsaD9a6H47YC/LK6lGhi3SKBGdf1jV0ySj22NJkglQ35dBZWbtwiXOzbBn3Gl8XzIcpv1pai3Q=="
"resolved": "3.2.0",
"contentHash": "jaL93IC1S2wZfCSLWt8/1lQCp/pDAzDNE5dfLq+pubEhCp0BjDZze6rJMu2KdOuCOeRxHmBuhtWrIRlrTKFsTg=="
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
Expand Down Expand Up @@ -458,7 +458,7 @@
"contentHash": "c+vDz+kkDFy6EZVqpypezp9u9c+ktwcuaPxu0ofVFsDoh85qUyQE8ICDoGr8nX6Ydui6hgN+SCPcIeBtXdp81g=="
}
},
"net7.0/linux-arm": {
"net8.0/linux-arm": {
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
Expand Down Expand Up @@ -545,7 +545,7 @@
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
}
},
"net7.0/linux-x64": {
"net8.0/linux-arm64": {
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
Expand Down Expand Up @@ -632,7 +632,94 @@
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
}
},
"net7.0/win-x64": {
"net8.0/linux-x64": {
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
"dependencies": {
"System.Security.AccessControl": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"Microsoft.Win32.SystemEvents": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A=="
},
"runtime.linux-arm.runtime.native.System.IO.Ports": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "mHgdZplUo48ThUaZB3S3M0alxAcHU7R3GLxNbsBzwShKTBn6vHO31YP4PQT+nbOkc/ErieFP2cSkBA/pbH3Hsw=="
},
"runtime.linux-arm64.runtime.native.System.IO.Ports": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "2vSH+NumQa1hwccFfn+ISDQnkPcGviVd6is+TuM7HwcPkbE2WY64q1E6nAulm7E+62Loxx3b9bS2sSazjM6bfw=="
},
"runtime.linux-x64.runtime.native.System.IO.Ports": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "aagetZzzxDXxiGKrdyB1gxIHPRzeunUYTbV9aqprVe+iKVgi474I8fTVaxiZjwxDMeB3bWnOmpa4hgsiFXQ9GA=="
},
"runtime.osx-x64.runtime.native.System.IO.Ports": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "KOWNOPDzXNZkKHwfCs9gBzJS1JeOli7fBmI93l92FcTb/42Fc0ojKYL9gUZANYtM7x5nRPPzUJtW29klkt+2Zw=="
},
"System.Diagnostics.EventLog": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
},
"System.Drawing.Common": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==",
"dependencies": {
"Microsoft.Win32.SystemEvents": "6.0.0"
}
},
"System.IO.Ports": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "cOfs0q0+lmq8oXgIeYDzzT2IxQ0gIij2/awNDXn3OjykDii26EgzzY09BhabUlxt3rwGNpAOxYkdac5udWWJgQ==",
"dependencies": {
"Microsoft.Win32.Registry": "5.0.0",
"runtime.native.System.IO.Ports": "5.0.1"
}
},
"System.Management": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"Microsoft.Win32.Registry": "5.0.0",
"System.CodeDom": "5.0.0"
}
},
"System.Security.AccessControl": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"System.Security.Principal.Windows": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
}
},
"net8.0/win-x64": {
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- [Raspberry Pi OS Lite](https://www.raspberrypi.com/software/operating-systems/), verified with 11 (Bullseye)
- [USB Wi-Fi adapter](https://www.canakit.com/raspberry-pi-wifi.html), unless you have a Raspberry Pi 3 or later with built-in Wi-Fi
- USB AC adapter with a sufficiently long cable to reach the top of the dryer
- [.NET 7 ARM32 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet) or later
- [.NET 8 ARM32 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet) or later
- Neither Raspberry Pi OS or Microsoft package archives offer APT packages of .NET for ARM
- You can install .NET using [my unofficial APT repository of .NET for Raspberry Pi](https://github.com/Aldaviva/RaspberryPiDotnetRepository), packaged from official Microsoft builds
```sh
Expand Down
9 changes: 4 additions & 5 deletions Sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
<Platforms>AnyCPU;x86</Platforms>
<RuntimeIdentifiers>linux-arm;linux-x86</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Iot.Device.Bindings" Version="2.2.0" />
<PackageReference Include="Iot.Device.Bindings" Version="3.1.0" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<Platforms>AnyCPU;x86;ARM32</Platforms>
<Platforms>AnyCPU;x86;ARM32;ARM64</Platforms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="8.1.0" />
<PackageReference Include="FakeItEasy" Version="8.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 0e45ee2

Please sign in to comment.