Skip to content

Commit

Permalink
Merge pull request #16 from VisconFactoryIntelligence/build-etc
Browse files Browse the repository at this point in the history
Build etc
  • Loading branch information
mycroes committed May 15, 2023
2 parents c255a98 + 9efc4f1 commit f637a20
Show file tree
Hide file tree
Showing 106 changed files with 360 additions and 271 deletions.
99 changes: 84 additions & 15 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,97 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: .NET

on:
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
push:
branches: [ "main" ]
branches:
- 'main' # Run the workflow when pushing to the main branch
pull_request:
branches: [ "main" ]
branches:
- '*' # Run the workflow for all pull requests
release:
types:
- published # Run the workflow when a new GitHub release is published

jobs:
build:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget

runs-on: ubuntu-latest
defaults:
run:
shell: pwsh

jobs:
create_nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Get all history to allow automatic versioning

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '6.x'
includePrerelease: true
preferLatestVersion: true

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0

- name: Setup .NET
uses: actions/setup-dotnet@v3

- run: >
dotnet pack
--configuration Release
/p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemVer }}
/p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }}
/p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }}
/p:PackageVersion=${{ steps.gitversion.outputs.semVer }}
--output ${{ env.NuGetDirectory }}
- uses: actions/upload-artifact@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
name: nuget
if-no-files-found: error
retention-days: 7
path: |
${{ env.NuGetDirectory }}/*.nupkg
${{ env.NuGetDirectory }}/*.snupkg
run_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Run tests
run: dotnet test --configuration Release

deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
# You can update this logic if you want to manage releases differently
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ create_nuget, run_test ]
steps:
- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}

- name: Setup .NET Core
uses: actions/setup-dotnet@v3

# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
37 changes: 20 additions & 17 deletions AdsClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,42 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FAE628B5-BAFA-4F21-8174-7E47DCC63E29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ads.Client", "src\AdsClient\Ads.Client.csproj", "{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{42A63E66-DB8D-48F6-AA8A-5943080A0202}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsClient.Test", "test\AdsClient\AdsClient.Test.csproj", "{C686A0A5-2143-4447-B99F-D717CA1FC7D1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsDumper", "src\AdsDumper\AdsDumper.csproj", "{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Viscon.Communication.Ads", "src\AdsClient\Viscon.Communication.Ads.csproj", "{EC644FCA-386D-431B-AD82-922081D0DA45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsDumper", "src\AdsDumper\AdsDumper.csproj", "{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Viscon.Communication.Ads.Test", "test\AdsClient\Viscon.Communication.Ads.Test.csproj", "{C32CE653-CDB2-4354-9174-4EDBD82E769A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F}.Release|Any CPU.Build.0 = Release|Any CPU
{C686A0A5-2143-4447-B99F-D717CA1FC7D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C686A0A5-2143-4447-B99F-D717CA1FC7D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C686A0A5-2143-4447-B99F-D717CA1FC7D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C686A0A5-2143-4447-B99F-D717CA1FC7D1}.Release|Any CPU.Build.0 = Release|Any CPU
{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F}.Release|Any CPU.Build.0 = Release|Any CPU
{EC644FCA-386D-431B-AD82-922081D0DA45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC644FCA-386D-431B-AD82-922081D0DA45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC644FCA-386D-431B-AD82-922081D0DA45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC644FCA-386D-431B-AD82-922081D0DA45}.Release|Any CPU.Build.0 = Release|Any CPU
{C32CE653-CDB2-4354-9174-4EDBD82E769A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C32CE653-CDB2-4354-9174-4EDBD82E769A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C32CE653-CDB2-4354-9174-4EDBD82E769A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C32CE653-CDB2-4354-9174-4EDBD82E769A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A0F5651E-012E-4ABA-A9E6-23D58AA39A3F} = {FAE628B5-BAFA-4F21-8174-7E47DCC63E29}
{C686A0A5-2143-4447-B99F-D717CA1FC7D1} = {42A63E66-DB8D-48F6-AA8A-5943080A0202}
{DA8FC5FD-E7B9-49F4-9B5D-2C6E9EE5DA7F} = {FAE628B5-BAFA-4F21-8174-7E47DCC63E29}
{EC644FCA-386D-431B-AD82-922081D0DA45} = {FAE628B5-BAFA-4F21-8174-7E47DCC63E29}
{C32CE653-CDB2-4354-9174-4EDBD82E769A} = {42A63E66-DB8D-48F6-AA8A-5943080A0202}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0528BDEE-A5EE-4879-B57E-35AC1826F92B}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2011 Inando
Copyright (c) 2023 Michael Croes
Copyright (c) 2023 Viscon Factory Intelligence B.V.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
Binary file added icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions src/AdsClient/Ads.Client.csproj

This file was deleted.

32 changes: 16 additions & 16 deletions src/AdsClient/AdsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Ads.Client.CommandResponse;
using Ads.Client.Commands;
using Ads.Client.Common;
using Ads.Client.Conversation;
using Ads.Client.Conversation.CreateVariableHandles;
using Ads.Client.Conversation.ReadDataTypes;
using Ads.Client.Conversation.ReadMultiple;
using Ads.Client.Conversation.ReadSymbols;
using Ads.Client.Conversation.ReadUploadInfo;
using Ads.Client.Conversation.WriteMultiple;
using Ads.Client.Helpers;
using Ads.Client.Internal;
using Ads.Client.Special;
using Ads.Client.Variables;

namespace Ads.Client
using Viscon.Communication.Ads.CommandResponse;
using Viscon.Communication.Ads.Commands;
using Viscon.Communication.Ads.Common;
using Viscon.Communication.Ads.Conversation;
using Viscon.Communication.Ads.Conversation.CreateVariableHandles;
using Viscon.Communication.Ads.Conversation.ReadDataTypes;
using Viscon.Communication.Ads.Conversation.ReadMultiple;
using Viscon.Communication.Ads.Conversation.ReadSymbols;
using Viscon.Communication.Ads.Conversation.ReadUploadInfo;
using Viscon.Communication.Ads.Conversation.WriteMultiple;
using Viscon.Communication.Ads.Helpers;
using Viscon.Communication.Ads.Internal;
using Viscon.Communication.Ads.Special;
using Viscon.Communication.Ads.Variables;

namespace Viscon.Communication.Ads
{
public class AdsClient : IDisposable

Check warning on line 23 in src/AdsClient/AdsClient.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'AdsClient'

Check warning on line 23 in src/AdsClient/AdsClient.cs

View workflow job for this annotation

GitHub Actions / run_test

Missing XML comment for publicly visible type or member 'AdsClient'
{
Expand Down
10 changes: 5 additions & 5 deletions src/AdsClient/Ams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Ads.Client.Common;
using Ads.Client.Helpers;
using Ads.Client.Conversation;
using Ads.Client.Internal;
using Viscon.Communication.Ads.Common;
using Viscon.Communication.Ads.Conversation;
using Viscon.Communication.Ads.Helpers;
using Viscon.Communication.Ads.Internal;

namespace Ads.Client
namespace Viscon.Communication.Ads
{

public class Ams : IDisposable
Expand Down
6 changes: 3 additions & 3 deletions src/AdsClient/AmsSocket.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Ads.Client.Internal;
using System;
using System;
using System.Net.Sockets;
using System.Threading.Tasks;
using Viscon.Communication.Ads.Internal;

namespace Ads.Client
namespace Viscon.Communication.Ads
{
internal class AmsSocket : IAmsSocket, IDisposable
{
Expand Down
9 changes: 4 additions & 5 deletions src/AdsClient/AmsSocketConnection.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Ads.Client.Helpers;
using Ads.Client.Internal;
using System;
using System.Diagnostics;
using System;
using System.Net.Sockets;
using System.Threading.Tasks;
using Viscon.Communication.Ads.Helpers;
using Viscon.Communication.Ads.Internal;

namespace Ads.Client;
namespace Viscon.Communication.Ads;

internal class AmsSocketConnection
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsAddDeviceNotificationCommandResponse : AdsCommandResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/AdsClient/CommandResponse/AdsCommandResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsCommandResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsDeleteDeviceNotificationCommandResponse : AdsCommandResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/AdsClient/CommandResponse/AdsReadCommandResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsReadCommandResponse : AdsCommandResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using Ads.Client.Common;
using Ads.Client.Helpers;
using Viscon.Communication.Ads.Common;
using Viscon.Communication.Ads.Helpers;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsReadDeviceInfoCommandResponse : AdsCommandResponse
{
Expand Down
4 changes: 2 additions & 2 deletions src/AdsClient/CommandResponse/AdsReadStateCommandResponse.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Ads.Client.Common;
using Viscon.Communication.Ads.Common;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsReadStateCommandResponse : AdsCommandResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/AdsClient/CommandResponse/AdsWriteCommandResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsWriteCommandResponse : AdsCommandResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Ads.Client.CommandResponse
namespace Viscon.Communication.Ads.CommandResponse
{
public class AdsWriteReadCommandResponse : AdsCommandResponse
{
Expand Down
6 changes: 3 additions & 3 deletions src/AdsClient/Commands/AdsAddDeviceNotificationCommand.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Ads.Client.CommandResponse;
using Ads.Client.Common;
using Viscon.Communication.Ads.CommandResponse;
using Viscon.Communication.Ads.Common;

namespace Ads.Client.Commands
namespace Viscon.Communication.Ads.Commands
{
public class AdsAddDeviceNotificationCommand : AdsCommand<AdsAddDeviceNotificationCommandResponse>
{
Expand Down
8 changes: 4 additions & 4 deletions src/AdsClient/Commands/AdsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Ads.Client.CommandResponse;
using Ads.Client.Common;
using Ads.Client.Conversation;
using Viscon.Communication.Ads.CommandResponse;
using Viscon.Communication.Ads.Common;
using Viscon.Communication.Ads.Conversation;

namespace Ads.Client.Commands
namespace Viscon.Communication.Ads.Commands
{
public abstract class AdsCommand<TResponse> where TResponse : AdsCommandResponse, new()
{
Expand Down

0 comments on commit f637a20

Please sign in to comment.