-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.3.0' into main
- Loading branch information
Showing
33 changed files
with
853 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: develop ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
include: | ||
- os: windows-latest | ||
runtime: win-x64 | ||
- os: macos-latest | ||
runtime: osx-x64 | ||
- os: ubuntu-latest | ||
runtime: linux-x64 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
|
||
- name: Test | ||
run: dotnet test --configuration Release | ||
|
||
- name: Publish | ||
run: cd ViLA && dotnet publish --configuration Release --runtime ${{ matrix.runtime }} -p:PublishSingleFile=true -p:DebugType=None --no-self-contained -o publish | ||
|
||
- name: Zip Folder | ||
run: cd ViLA/publish/ && zip -r ViLA-${{ matrix.runtime }}.zip . && mkdir -p ../../build/artifacts/${{ matrix.runtime }}/ && cp -r ViLA-${{ matrix.runtime }}.zip ../../build/artifacts/${{ matrix.runtime }}/ | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ matrix.runtime }} | ||
path: build/artifacts/${{ matrix.runtime }} | ||
|
||
publish: | ||
needs: build | ||
|
||
if: github.event_name == 'push' | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Download Artifacts win-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: win-x64 | ||
|
||
- name: Download Artifacts osx-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: osx-x64 | ||
|
||
- name: Download Artifacts linux-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: linux-x64 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "alpha" | ||
files: | | ||
**/ViLA-*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: main-publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
include: | ||
- os: windows-latest | ||
runtime: win-x64 | ||
- os: macos-latest | ||
runtime: osx-x64 | ||
- os: ubuntu-latest | ||
runtime: linux-x64 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
|
||
- name: Test | ||
run: dotnet test --configuration Release | ||
|
||
- name: Publish | ||
run: cd ViLA && dotnet publish --configuration Release --runtime ${{ matrix.runtime }} -p:PublishSingleFile=true -p:DebugType=None --no-self-contained -o publish | ||
|
||
- name: Zip Folder | ||
run: cd ViLA/publish/ && zip -r ViLA-${{ matrix.runtime }}.zip . && mkdir -p ../../build/artifacts/${{ matrix.runtime }}/ && cp -r ViLA-${{ matrix.runtime }}.zip ../../build/artifacts/${{ matrix.runtime }}/ | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ matrix.runtime }} | ||
path: build/artifacts/${{ matrix.runtime }} | ||
|
||
publish: | ||
needs: build | ||
|
||
if: github.event_name == 'push' | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Download Artifacts win-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: win-x64 | ||
|
||
- name: Download Artifacts osx-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: osx-x64 | ||
|
||
- name: Download Artifacts linux-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: linux-x64 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: false | ||
title: "Latest Official Release" | ||
files: | | ||
**/ViLA-*.zip |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: release ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- "release/*" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
include: | ||
- os: windows-latest | ||
runtime: win-x64 | ||
- os: macos-latest | ||
runtime: osx-x64 | ||
- os: ubuntu-latest | ||
runtime: linux-x64 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
|
||
- name: Test | ||
run: dotnet test --configuration Release | ||
|
||
- name: Publish | ||
run: cd ViLA && dotnet publish --configuration Release --runtime ${{ matrix.runtime }} -p:PublishSingleFile=true -p:DebugType=None --no-self-contained -o publish | ||
|
||
- name: Zip Folder | ||
run: cd ViLA/publish/ && zip -r ViLA-${{ matrix.runtime }}.zip . && mkdir -p ../../build/artifacts/${{ matrix.runtime }}/ && cp -r ViLA-${{ matrix.runtime }}.zip ../../build/artifacts/${{ matrix.runtime }}/ | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ matrix.runtime }} | ||
path: build/artifacts/${{ matrix.runtime }} | ||
|
||
publish: | ||
needs: build | ||
|
||
if: github.event_name == 'push' | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Download Artifacts win-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: win-x64 | ||
|
||
- name: Download Artifacts osx-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: osx-x64 | ||
|
||
- name: Download Artifacts linux-x64 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: linux-x64 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "RC" | ||
files: | | ||
**/ViLA-*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace ViLA | ||
namespace Configuration | ||
{ | ||
public enum Comparator | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// ReSharper disable UnusedAutoPropertyAccessor.Global | ||
// ReSharper disable ClassNeverInstantiated.Global | ||
#pragma warning disable 8618 | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using Microsoft.Extensions.Logging; | ||
using Newtonsoft.Json; | ||
using Virpil.Communicator; | ||
|
||
namespace Configuration | ||
{ | ||
public class Config | ||
{ | ||
public LogLevel? LogLevel { get; set; } | ||
public bool CheckUpdates { get; set; } = true; | ||
public bool CheckPrerelease { get; set; } = false; | ||
public HashSet<string> DisabledPlugins { get; set; } = new(); | ||
|
||
public Dictionary<string, Device>? Devices { get; set; } | ||
|
||
/// <summary> | ||
/// Appends the devices of the provided config to this config. | ||
/// </summary> | ||
/// <param name="otherConfig"></param> | ||
public Config Append(Config otherConfig) | ||
{ | ||
if (otherConfig.LogLevel is not null) | ||
{ | ||
LogLevel = (LogLevel) Math.Min((int) (LogLevel ?? Microsoft.Extensions.Logging.LogLevel.None), | ||
(int) otherConfig.LogLevel); | ||
} | ||
|
||
if (otherConfig.CheckPrerelease) CheckPrerelease = otherConfig.CheckPrerelease; | ||
if (otherConfig.CheckUpdates) CheckUpdates = otherConfig.CheckUpdates; | ||
DisabledPlugins.UnionWith(otherConfig.DisabledPlugins); | ||
|
||
if (otherConfig.Devices != null) | ||
{ | ||
if (Devices is null) Devices = new Dictionary<string, Device>(); | ||
foreach (var (deviceId, device) in otherConfig.Devices) | ||
{ | ||
if (Devices.TryGetValue(deviceId, out var thisDevice)) | ||
{ | ||
foreach (var (boardType, boardActions) in device) | ||
{ | ||
if (Devices[deviceId].TryGetValue(boardType, out var thisBoardActions)) | ||
{ | ||
foreach (var (ledNumber, ledActions) in boardActions) | ||
{ | ||
if (Devices[deviceId][boardType].TryGetValue(ledNumber, out var thisLedActions)) | ||
{ | ||
thisLedActions.AddRange(ledActions); | ||
} | ||
else | ||
{ | ||
thisLedActions = ledActions; | ||
} | ||
|
||
Devices[deviceId][boardType][ledNumber] = thisLedActions; | ||
} | ||
} | ||
else | ||
{ | ||
thisBoardActions = boardActions; | ||
} | ||
|
||
Devices[deviceId][boardType] = thisBoardActions; | ||
} | ||
} | ||
else | ||
{ | ||
thisDevice = device; | ||
} | ||
|
||
Devices[deviceId] = thisDevice; | ||
} | ||
} | ||
|
||
return this; | ||
} | ||
|
||
public static Config? GetAllConfiguration() | ||
{ | ||
return Directory.EnumerateFiles("Configuration", "*.json", SearchOption.AllDirectories).AsParallel() | ||
.Select(f => JsonConvert.DeserializeObject<Config>(File.ReadAllText(f))) | ||
.Where(c => c != null) | ||
.Aggregate((s, t) => s!.Append(t!)); | ||
} | ||
} | ||
|
||
public class Device : Dictionary<BoardType, BoardActions> | ||
{ | ||
} | ||
|
||
public class BoardActions : Dictionary<int, List<LedAction>> | ||
{ | ||
} | ||
} |
Oops, something went wrong.