From 05377b06fb4eaff518b82ae9ebfbe1b7db3a7d91 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 5 Mar 2020 16:07:21 -0700 Subject: [PATCH 1/6] Create main.yml Adds script for CI triggers --- .github/workflows/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..5fb11cc8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,18 @@ +name: Build Non-Release Branch + +on: + push: + branches: + - feature/* + - bugfix/* + - hotfix/* + +jobs: + build: + name: Build + runs-on: self-hosted + steps: + - run: Invoke-WebRequest -URI "http://localhost:8080/job/Essentials%20Builds/build?token=$($Env:projectToken)" -Headers @{Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("ndorin:$($Env:token)")))"} -Method POST -UseBasicParsing + env: + token: ${{ secrets.TOKEN }} + projectToken: ${{ secrets.PROJECTTOKEN}} From 27bae27771177f8c8045b5121fe67ac7ea77482d Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 5 Mar 2020 16:26:43 -0700 Subject: [PATCH 2/6] Adds Test.txt to trigger builds --- Test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Test.txt diff --git a/Test.txt b/Test.txt new file mode 100644 index 00000000..503d93a1 --- /dev/null +++ b/Test.txt @@ -0,0 +1 @@ +jaldfja \ No newline at end of file From bc004a8764b2426af2b85223370c3f18af90c3f4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 5 Mar 2020 16:49:03 -0700 Subject: [PATCH 3/6] Updates AssemblyInfo.cs files to include AssemblyInformationalVersion and resets default versions to 0.0.0.*. Updates assembly version script to accomodate changes --- PepperDashEssentials/ControlSystem.cs | 8 +++++--- .../Properties/AssemblyInfo.cs | 14 ++++++++------ .../Properties/UpdateAssemblyVersion.ps1 | 19 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 13 ++++++++----- .../Essentials_DM/Essentials_DM.csproj | 4 ++++ .../Essentials_DM/Properties/AssemblyInfo.cs | 13 ++++++++----- .../Properties/AssemblyInfo.cs | 13 ++++++++----- 7 files changed, 56 insertions(+), 28 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 62aee267..a88d932b 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -96,10 +96,12 @@ namespace PepperDash.Essentials string directoryPrefix; directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); - - var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build)); + var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false); + + AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute; + + Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion); if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS { diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index 83beada4..36e6828b 100644 --- a/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -1,8 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("PepperDashEssentials")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("PepperDashEssentials")] -[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] -[assembly: AssemblyVersion("1.4.0.*")] - +[assembly: System.Reflection.AssemblyTitle("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] diff --git a/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 b/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 index 46392b31..396b5cf0 100644 --- a/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 +++ b/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 @@ -1,13 +1,23 @@ function Update-SourceVersion { Param ([string]$Version) - $NewVersion = ‘AssemblyVersion("‘ + $Version + ‘.*")’; + $fullVersion = $Version + $baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value + $NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’ + echo "AssemblyVersion = $NewAssemblyVersion" + $NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’ + echo "AssemblyInformationalVersion = $NewAssemblyInformationalVersion" + foreach ($o in $input) - { + { Write-output $o.FullName $TmpFile = $o.FullName + “.tmp” get-content $o.FullName | - %{$_ -replace ‘AssemblyVersion\("(\d+\.\d+\.\d+)\.\*"\)’, $NewVersion } > $TmpFile + %{ + $_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion} | + %{ + $_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion + } > $TmpFile move-item $TmpFile $o.FullName -force } } @@ -21,9 +31,10 @@ function Update-AllAssemblyInfoFiles ( $version ) } # validate arguments -$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "^\d+\.\d+\.\d+$"); +$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*"); if ($r.Success) { + echo "Updating Assembly Version to $args ..."; Update-AllAssemblyInfoFiles $args[0]; } else diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs index f9464b7d..fc3f61d8 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("PepperDashEssentialsBase")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("PepperDashEssentialsBase")] -[assembly: AssemblyCopyright("Copyright © Ppperdash 2019")] -[assembly: AssemblyVersion("1.4.0.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("PepperDashEssentialsBase")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj index 6f31634d..f40cb869 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -82,6 +82,10 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe False + + False + ..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll + diff --git a/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs b/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs index d11fa984..1f506f3a 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("Essentials_DM")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("Essentials_DM")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyVersion("1.3.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("Essentials_DM")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs index 95a08a40..ccea4891 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("Essentials_Devices_Common")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("Essentials_Devices_Common")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyVersion("1.4.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("Essentials_Devices_Common")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file From c9ce835786a60a318ad65ab10bb0445890ba44ba Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 6 Mar 2020 10:42:18 -0700 Subject: [PATCH 4/6] Removes unnecessary Test.txt --- Test.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Test.txt diff --git a/Test.txt b/Test.txt deleted file mode 100644 index 503d93a1..00000000 --- a/Test.txt +++ /dev/null @@ -1 +0,0 @@ -jaldfja \ No newline at end of file From b5e5eebac60ef91d3e3c933b9c4c3f0b994ebc42 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 6 Mar 2020 12:04:51 -0700 Subject: [PATCH 5/6] updates to PD.Core v1.0.35 adds test text file to trigger CI builds --- CITest.txt | 1 + essentials-framework/pepperdashcore-builds | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 CITest.txt diff --git a/CITest.txt b/CITest.txt new file mode 100644 index 00000000..74547b16 --- /dev/null +++ b/CITest.txt @@ -0,0 +1 @@ +asdfa;sldkaf diff --git a/essentials-framework/pepperdashcore-builds b/essentials-framework/pepperdashcore-builds index acebe6b4..15206840 160000 --- a/essentials-framework/pepperdashcore-builds +++ b/essentials-framework/pepperdashcore-builds @@ -1 +1 @@ -Subproject commit acebe6b43b28cc3a93f899e9714292a0cc1ab2cc +Subproject commit 15206840b3e6338f695e4ffba634a72e51ea1be5 From 1632f5888c12747bc50172086461fa7d66627f5d Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 6 Mar 2020 12:43:26 -0700 Subject: [PATCH 6/6] removes test file --- CITest.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CITest.txt diff --git a/CITest.txt b/CITest.txt deleted file mode 100644 index 74547b16..00000000 --- a/CITest.txt +++ /dev/null @@ -1 +0,0 @@ -asdfa;sldkaf