Skip to content

Commit

Permalink
Merge 25460d7 into 80d8bf8
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed Oct 29, 2023
2 parents 80d8bf8 + 25460d7 commit 4ef92a8
Show file tree
Hide file tree
Showing 89 changed files with 1,125 additions and 1,256 deletions.
10 changes: 9 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ dotnet_diagnostic.CA1034.severity = none
#Static holder types should be Static or NotInheritable
dotnet_diagnostic.CA1052.severity = none
#Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = none
dotnet_diagnostic.CA2201.severity = none

dotnet_diagnostic.CA1854.severity = none
#The enum member 'Itself' has the same constant value
dotnet_diagnostic.CA1069.severity = none
#Do not create task without passing TaskScheduler
dotnet_diagnostic.CA2008.severity = none
#Use concrete types
dotnet_diagnostic.CA1859.severity = none
1 change: 1 addition & 0 deletions .github/workflows/ci_analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- dev
- dotnet8
jobs:
sonarscanner:
name: 🔍 SonarScanner
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- dev
- dotnet8
pull_request:
branches:
- main
- dev
- dotnet8
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC
jobs:
Expand All @@ -20,11 +22,11 @@ jobs:
- name: 📤 Checkout the repository
uses: actions/checkout@main

- name: 🥅 Install .Net 7
uses: actions/setup-dotnet@v1
- name: 🥅 Install .Net 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x" # SDK Version

dotnet-version: '8.0.x'
dotnet-quality: 'preview'
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"

Expand All @@ -39,7 +41,7 @@ jobs:
dotnet test -v minimal --no-build --configuration Release --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/Client/NetDaemon.HassClient.Tests -- RunConfiguration.CollectSourceInformation=true
dotnet test -v minimal --no-build --configuration Release --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/AppModel/NetDaemon.AppModel.Tests -- RunConfiguration.CollectSourceInformation=true
dotnet test -v minimal --no-build --configuration Release --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/Runtime/NetDaemon.Runtime.Tests -- RunConfiguration.CollectSourceInformation=true
- name: 👀 Integration Tests
run: |
echo "## ❔ Integration test results" >> $GITHUB_STEP_SUMMARY
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push_docker_addon_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "feature build";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature" \\' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -47,5 +47,5 @@ jobs:
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon_addon3_1:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/netdaemon_addon3_1:feature-${{ github.event.inputs.tag }}"
--tag "netdaemon/netdaemon_addon4:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/netdaemon_addon4:feature-${{ github.event.inputs.tag }}"
16 changes: 8 additions & 8 deletions .github/workflows/push_docker_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "dev";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="dev"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -47,8 +47,8 @@ jobs:
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag netdaemon/netdaemon_addon3:dev \
--tag ghcr.io/net-daemon/netdaemon_addon3:dev
--tag netdaemon/netdaemon_addon4:dev \
--tag ghcr.io/net-daemon/netdaemon_addon4:dev
deploy_docker_dev:
name: 📦 Deploy to Docker dev
Expand All @@ -63,10 +63,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "dev";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="dev"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -91,5 +91,5 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag netdaemon/netdaemon3:dev \
--tag ghcr.io/net-daemon/netdaemon3:dev
--tag netdaemon/netdaemon4:dev \
--tag ghcr.io/net-daemon/netdaemon4:dev
16 changes: 8 additions & 8 deletions .github/workflows/push_docker_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "feature-${{ github.event.inputs.tag }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature-${{ github.event.inputs.tag }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -48,8 +48,8 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag "netdaemon/netdaemon3_1:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon3_1:feature-${{ github.event.inputs.tag }}"
--tag "netdaemon/netdaemon4:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon4:feature-${{ github.event.inputs.tag }}"
deploy_docker_addon:
name: 📦 Deploy to Docker add-on with tag
runs-on: ubuntu-latest
Expand All @@ -63,10 +63,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "feature-${{ github.event.inputs.tag }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature-${{ github.event.inputs.tag }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -89,5 +89,5 @@ jobs:
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon_addon3:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon3:feature-${{ github.event.inputs.tag }}"
--tag "netdaemon/netdaemon_addon4:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon4:feature-${{ github.event.inputs.tag }}"
14 changes: 7 additions & 7 deletions .github/workflows/push_docker_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- rc
jobs:
deploy_docker:
name: 📦 Deploy to Docker with tag
name: 📦 Deploy pre-release to Docker with tag
runs-on: ubuntu-latest
environment: CI - release environment
steps:
Expand Down Expand Up @@ -52,8 +52,8 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag "netdaemon/netdaemon:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon:${{ github.event.inputs.pre }}"
--tag "netdaemon/netdaemon4:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon4:${{ github.event.inputs.pre }}"
deploy_docker_addon:
name: 📦 Deploy to Docker add-on with tag
runs-on: ubuntu-latest
Expand All @@ -67,10 +67,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "feature-${{ github.event.inputs.pre }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature-${{ github.event.inputs.pre }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -93,5 +93,5 @@ jobs:
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon_addon:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon:${{ github.event.inputs.pre }}"
--tag "netdaemon/netdaemon_addon4:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon4:${{ github.event.inputs.pre }}"
26 changes: 4 additions & 22 deletions .github/workflows/push_nuget_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,15 @@ jobs:
echo Current version: $latest
echo "::set-output name=version::$latest"
- name: 🥅 Install .Net 7
- name: 🥅 Install .Net 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: "7.0.x" # SDK Version
dotnet-version: "8.0.x" # SDK Version

- name: 🔖 Set version number
run: |
sed -i "/ private const string Version = /c\ private const string Version = \"${{ github.event.inputs.tag }}\";" ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
- name: 🎁 Pack AppModel
run: dotnet pack src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack Client
run: dotnet pack src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack Runtime
run: dotnet pack src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack HassModel
run: dotnet pack src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack HassModel integration
run: dotnet pack src/HassModel/NetDaemon.HassModel.Integration/NetDaemon.HassModel.Integration.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack HassModel codegen
run: dotnet pack src/HassModel/NetDaemon.HassModel.CodeGenerator/NetDaemon.HassModel.CodeGenerator.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack scheduling extensions
run: dotnet pack src/Extensions/NetDaemon.Extensions.Scheduling/NetDaemon.Extensions.Scheduling.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack logging extensions
run: dotnet pack src/Extensions/NetDaemon.Extensions.Logging/NetDaemon.Extensions.Logging.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack TTS extensions
run: dotnet pack src/Extensions/NetDaemon.Extensions.Tts/NetDaemon.Extensions.Tts.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack Mqtt extensions
run: dotnet pack src/Extensions/NetDaemon.Extensions.MqttEntityManager/NetDaemon.Extensions.MqttEntityManager.csproj --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 🎁 Pack
run: dotnet pack NetDaemon.sln --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }} -p:Version=${{ github.event.inputs.tag }}
- name: 📨 Push to nuget
run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
6 changes: 3 additions & 3 deletions .github/workflows/push_nuget_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- rc
jobs:
deploy_nuget:
name: 📦 publish nuget packages manual version
name: 📦 publish nuget pre-release packages manual version
runs-on: ubuntu-latest
environment: CI - release environment
steps:
Expand All @@ -43,5 +43,5 @@ jobs:
sed -i "/ private const string Version = /c\ private const string Version = \"${{ github.event.inputs.tag }}\";" ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
- name: 🎁 Pack
run: dotnet pack NetDaemon.sln --configuration Release -p:PackageVersion=${{ github.event.inputs.tag }}-${{ github.event.inputs.pre }} -p:Version=${{ github.event.inputs.tag }}-${{ github.event.inputs.pre }}
#- name: 📨 Push to nuget
#run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
- name: 📨 Push to nuget
run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
24 changes: 12 additions & 12 deletions .github/workflows/tags_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
sed -i '/ private const string Version = /c\ private const string Version = "${{ steps.version.outputs.version }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="${{ steps.version.outputs.version }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

Expand All @@ -54,10 +54,10 @@ jobs:
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag netdaemon/netdaemon_addon3_1:${{ steps.version.outputs.version }} \
--tag netdaemon/netdaemon_addon3_1:latest \
--tag ghcr.io/net-daemon/netdaemon_addon3_1:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon_addon3_1:latest
--tag netdaemon/netdaemon_addon4:${{ steps.version.outputs.version }} \
--tag netdaemon/netdaemon_addon4:latest \
--tag ghcr.io/net-daemon/netdaemon_addon4:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon_addon4:latest
deploy_docker:
name: 📦 Deploy to Docker Hub
Expand All @@ -83,10 +83,10 @@ jobs:
sed -i '/ io.hass.version=/c\ io.hass.version="${{ steps.version.outputs.version }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: 🔓 Login to Docker hub
Expand All @@ -108,7 +108,7 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag netdaemon/netdaemon3_1:latest \
--tag netdaemon/netdaemon3_1:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon3_1:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon3_1:latest
--tag netdaemon/netdaemon4:latest \
--tag netdaemon/netdaemon4:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon4:${{ steps.version.outputs.version }} \
--tag ghcr.io/net-daemon/netdaemon4:latest
Loading

0 comments on commit 4ef92a8

Please sign in to comment.