From a3ba7cef6177609f5e03a88b76c2994405fd0c4f Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Sat, 27 Aug 2022 15:24:56 -0400 Subject: [PATCH 1/8] feature: adds the ability to send a custom command on serial join 4 --- .../._PDT.LutronQuantum.EPI.sln | Bin 0 -> 4096 bytes PDT.LutronQuantum.EPI/LutronQuantumBridge.cs | 4 ++++ .../PDT.LutronQuantum.EPI.suo | Bin 37888 -> 39936 bytes 3 files changed, 4 insertions(+) create mode 100644 PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln diff --git a/PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln b/PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln new file mode 100644 index 0000000000000000000000000000000000000000..9626bc0462a813180c5de49c82112b838eb0fc43 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vGLZbX z38I5x0Z_RBnifVNA1W@DoS&ukeOGKnpcvUpO=`EQ>l=XnpUEal#`g34eSd;bq#3>)&Fp>$S}zL G{|^9p=_;-O literal 0 HcmV?d00001 diff --git a/PDT.LutronQuantum.EPI/LutronQuantumBridge.cs b/PDT.LutronQuantum.EPI/LutronQuantumBridge.cs index 2980737..2654acb 100644 --- a/PDT.LutronQuantum.EPI/LutronQuantumBridge.cs +++ b/PDT.LutronQuantum.EPI/LutronQuantumBridge.cs @@ -31,6 +31,7 @@ public static void LinkToApiExt(this LutronQuantum lightingDevice, BasicTriList trilist.SetStringSigAction(joinMap.IntegrationIdSet, id => lightingDevice.SetIntegrationId(id)); trilist.SetStringSigAction(joinMap.ShadeGroup1IdSet, id => lightingDevice.SetShadeGroup1Id(id)); trilist.SetStringSigAction(joinMap.ShadeGroup2IdSet, id => lightingDevice.SetShadeGroup2Id(id)); + trilist.SetStringSigAction(joinMap.Commands, (s) => lightingDevice.SendLine(s)); // GenericLighitng Actions & FeedBack trilist.SetUShortSigAction(joinMap.SelectScene, u => @@ -115,6 +116,7 @@ public class LutronQuantumJoinMap : JoinMapBase public uint ShadeGroup1Lower { get; set; } public uint ShadeGroup2Raise { get; set; } public uint ShadeGroup2Lower { get; set; } + public uint Commands { get; set; } public LutronQuantumJoinMap() { @@ -136,6 +138,7 @@ public LutronQuantumJoinMap() IntegrationIdSet = 1; ShadeGroup1IdSet = 2; ShadeGroup2IdSet = 3; + Commands = 4; } public override void OffsetJoinNumbers(uint joinStart) @@ -154,6 +157,7 @@ public override void OffsetJoinNumbers(uint joinStart) IntegrationIdSet = IntegrationIdSet + joinOffset; ShadeGroup1IdSet = ShadeGroup1IdSet + joinOffset; ShadeGroup2IdSet = ShadeGroup2IdSet + joinOffset; + Commands = Commands + joinOffset; } } } diff --git a/PDT.LutronQuantum.EPI/PDT.LutronQuantum.EPI.suo b/PDT.LutronQuantum.EPI/PDT.LutronQuantum.EPI.suo index dd85d1cab616c6aedb4e157386338bbdfe185300..de5a5dba23090774718ea6e39fb7f6245dcf5311 100644 GIT binary patch delta 2569 zcma)7YfPI}7(VCg_mxr#aw%O4WfTUkz~r()$6$;yx-l3^D`YW~DB-3vqcZGn#5usY z%#Eq^ojNt@A7hqz%ldhZQ<+YksAJ-7@iP744}Ta(7Jldwsn6*JKc>k%$4%{j!PqNN{_g??qoxWWM0Y`TLH|6!{IftFO5hAiMdcpfYtPpwA?DDOQBT*7N7I-xped_|(VaDyEVR?#| zQA2APO&Vm{qimLVMpR9a=?}#rAA=p)^@H*ULU=^KUH$|@C_$F^FI2H(lxEsX>B>rz zI+>{B5=#(^6&WV8^rx|fK9DOYkmNP#!59D>K1^wb0(CAaTese*8DSO+@yd=2I9NXT&mY3oG#Il zfwVSpKD`;_$42!^T8m^#gq)-?QZk|3OMA^z(W_*h$F;q-{jqD~0<2dJTh4On2TtDf zR(h~)H;vmG#XR@Zylt3YroCA$60eFp>s(e_GOvKo6wM|S$R05{K$I`T4+gzsSw-2s z$>g?=(&fT*T5h+IzuO$jX_O?M74a0v_0pNla(ylAU$v=Ma`l|c#B<_DbJ2@=_E0|8 z(~iD+)$N>ANLtgauDeBAZ0Du359?#itc^8B^d9Jp9e!!gU5jlIu~)CB2}>roYc4QI7YowU zHZU*zb>i2`XHR5){H3gd6 zl35y<_+6rb+?=e?j^5&eapjY11~XF7EX~Fvr7h&~>$td)_|wvZ9iA0Wz`e-uqxe1w zJQmXhC-5ZnrvMe8!H&+2K{tKmO| z{2A~$a4yE5$M*|h2KX|@eU0xoz_-8!!Ag{{s-Vd~|jYWP-3Pu;b}@uZ?lJ?oeBL;|RvZDV&p>SlK#uzFa49Cim% zq0U|9Vl0#WpGRk?E?1Aa_~1^=hcMvl5r#5VJ1Xw+Jt9Zg_Yuyh6$ zf;j*LVPr7!*-JA2d*;^dg^?`U&x3xCDIKdsUlYqBDHHIIa~i6r?1p^)Mfx>Gle&8B~_RvsrEE)N$2YeSlNt zxS9Hoq|nW~Uk=uo6OY-@8P~TrKBQ?@E=p}GrW^ZG5|3xiq#Zyvr2m?w*;-@5rBK8| zaLGywX7&~t&0#T_U^`a?SxjKA5`k1KWCe5Te_dqMBF5BG;F*0ql;T2Ci zGU(lX2V$&?PHipb+Nbi<$bh`)-lDHKWY31yW-{#$(XYEq^xdIDbZ)1KZrM3TmLs>} z=|5A;hf6u#w);7ZtgAh;2~- z{E&uF$(NDaSef)VEJYp0h}3vjv=wB^rgBio$%Rl$Is;{erX5tp+ktBeGv(142LAzM z(*XKQ9~;Duoq))%K;%4r)(d_YxE@++&qw*GrPGEr^i!XcW-Uf?$|?U2TP4x~>B!+c Qwe#>%h3pMh`fX$7-#>;cga7~l delta 2488 zcmbtVZERCj7(VCTer#*Ieyn%jA6=cJjBcG{LxhcW>xHpVq>BqAq)}E%-EfYwl?_JJ zQe_D`mT_O;hY|vqr~&*~Z;V71GolzIXeOE&6NrW%#vh9O*bl&j`krq$X?j7pEBFuQQM$)T$q_WUJt|+NNS*p;!}6O(ryb$w^$R;`p<;8)`q3 ziLc@Ck#_lfW(GA-4N6R@tfE$-a1QQdbr`4%r`iQJi0FKJ=9sZSDbMMO_|})T-|$&1 z3gHMP97PB6YvT`j9Gl=^^VDqqS3^{UqFVvV40`A^<`k6TY!Tw?Gxe4~?%hl<54J;_ z{F1SaCf7EgsB9MIOg<1zs~~1>;b;}KcwHJR+Rtm{yXFoK+}>KXfN~J_STA$b!W*<@mbU~X&>IO!~-+vG$!r-4{*v+QG{OjIGaj22#|3 z@Ukknz9C!Z`tah%jEln$>S4=BmiFqh-`7mVX62nDODVq{9WJc@ik8c?HKB%EONZnk z-)#;e8>RT#wKRhjpY1!z-bnif12v;2XMt9pYd5GX1@d3$1LZ0!cUq~;Fx>2XU7pw! z=HP@&1k=vVa6H^2b%{cbRe3pgT}w z4v-!A^pRn#e}wdq5Eu^#@OfaPgOEo!;#uX03i;fb_c;Ysho5T{$d~GI?%%sj={-FE z{5bK?(1UO*;Cj4+nHRPkYy5TuBcGzj^yjEUbT4UjmnemmGKdUI!iL1TstQPx|vG*Cfu@zn*-K_htCH!#6A%Ntx3Vy6h zF9{Go=|@Y1EF}%h>J&Z$#aTMZi#$(Na`C0@!( zYf=K*u_LnM=$IO!Z`FgC(Fj|bf`~>*@)$@puDuwc Date: Sun, 28 Aug 2022 17:22:26 -0400 Subject: [PATCH 2/8] fix: workflows --- .../essentialsplugins-betabuilds.yml | 45 ++-- .../essentialsplugins-releasebuilds.yml | 227 ++++++++++++++++++ 2 files changed, 252 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/essentialsplugins-releasebuilds.yml diff --git a/.github/workflows/essentialsplugins-betabuilds.yml b/.github/workflows/essentialsplugins-betabuilds.yml index ac25c0e..5d3478a 100644 --- a/.github/workflows/essentialsplugins-betabuilds.yml +++ b/.github/workflows/essentialsplugins-betabuilds.yml @@ -17,7 +17,7 @@ env: RELEASE_BRANCH: main jobs: Build_Project: - runs-on: windows-latest + runs-on: windows-2019 steps: # First we checkout the source repo - name: Checkout repo @@ -82,11 +82,10 @@ jobs: Param ([string]$Version) #$fullVersion = $Version $baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value - $NewAssemblyVersion = 'AssemblyVersion("‘ + $baseVersion + ‘.*")' + $NewAssemblyVersion = 'AssemblyVersion("' + $baseVersion + '.*")' Write-Output "AssemblyVersion = $NewAssemblyVersion" $NewAssemblyInformationalVersion = 'AssemblyInformationalVersion("' + $Version + '")' Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion" - foreach ($o in $input) { Write-output $o.FullName $TmpFile = $o.FullName + ".tmp" @@ -99,22 +98,20 @@ jobs: move-item $TmpFile $o.FullName -force } } - - function Update-AllAssemblyInfoFiles ( $Env:VERSION ) { + function Update-AllAssemblyInfoFiles ( $version ) { foreach ($file in "AssemblyInfo.cs", "AssemblyInfo.vb" ) { get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ; } } - # validate arguments - $r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*"); + $r = [System.Text.RegularExpressions.Regex]::Match($Env:VERSION, "\d+\.\d+\.\d+.*"); if ($r.Success) { - Write-Output "Updating Assembly Version to $args ..."; - Update-AllAssemblyInfoFiles $args[0]; + Write-Output "Updating Assembly Version to $Env:VERSION ..."; + Update-AllAssemblyInfoFiles $Env:VERSION; } else { Write-Output " "; - Write-Output "Error: Input version does not match x.y.z format!" + Write-Output "Error: Input version $Env:VERSION does not match x.y.z format!" Write-Output " "; Write-Output "Unable to apply version to AssemblyInfo.cs files"; } @@ -156,7 +153,7 @@ jobs: $exclusions = "packages" # Trying to get any .json schema files (not currently working) # Gets any files with the listed extensions. - Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.nuspec" | ForEach-Object { + Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.nuspec", "*.md" | ForEach-Object { $allowed = $true; # Exclude any files in submodules foreach ($exclude in $exclusions) { @@ -224,7 +221,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Push_Nuget_Package: needs: Build_Project - runs-on: windows-latest + runs-on: windows-2019 steps: - name: Download Build Version Info uses: actions/download-artifact@v1 @@ -256,19 +253,27 @@ jobs: - name: Get nuget File shell: powershell run: | - $nuspec_file = Get-ChildItem *.nuspec -recurse - echo "NUSPEC_FILE=$($nuspec_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + $nuspec_file = (Get-ChildItem *.nuspec -recurse).BaseName + echo "NUSPEC_FILE=$($nuspec_file)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Pulls the nuget builder packages - name: Add nuget.exe + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" uses: nuget/setup-nuget@v1 + # Creating nuget Packages - name: Add Github Packages source + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - # Pushes to nuget, not needed unless publishing publicly - #- name: Add nuget.org API Key - # run: nuget setApiKey ${{ secrets.NUGET_API_KEY }} - name: Create nuget package + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }} + # Pushes to internal github registry - name: Publish nuget package to Github registry + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" run: nuget push **/*.nupkg -source github - # Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org - #- name: Publish nuget package to nuget.org - # run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json \ No newline at end of file + # Pushes to nuget gallery + - name: Add nuget.org API Key + if: github.repository_owner == 'PepperDash' && github.repository_visibility == 'public' && !contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate') + run: nuget setApiKey ${{ secrets.NUGET_API_KEY }} + - name: Publish nuget package to nuget.org + if: github.repository_owner == 'PepperDash' && github.repository_visibility == 'public' && !contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate') + run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json diff --git a/.github/workflows/essentialsplugins-releasebuilds.yml b/.github/workflows/essentialsplugins-releasebuilds.yml new file mode 100644 index 0000000..519f235 --- /dev/null +++ b/.github/workflows/essentialsplugins-releasebuilds.yml @@ -0,0 +1,227 @@ +name: Main Build using Docker + +on: + release: + types: + - released + branches: + - main + +env: + # Do not edit this, we're just creating it here + VERSION: 0.0.0-buildtype-buildnumber + # Defaults to debug for build type + BUILD_TYPE: Debug + # Defaults to master as the release branch. Change as necessary + RELEASE_BRANCH: main +jobs: + Build_Project: + runs-on: windows-2019 + steps: + # First we checkout the source repo + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + # Fetch all tags + - name: Fetch tags + run: git fetch --tags + # Generate the appropriate version number + - name: Set Version Number + shell: powershell + env: + TAG_NAME: ${{ github.event.release.tag_name }} + run: echo "VERSION=$($Env:TAG_NAME)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Use the version number to set the version of the assemblies + - name: Update AssemblyInfo.cs + shell: powershell + run: | + function Update-SourceVersion { + Param ([string]$Version) + #$fullVersion = $Version + $baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value + $NewAssemblyVersion = 'AssemblyVersion("' + $baseVersion + '.*")' + Write-Output "AssemblyVersion = $NewAssemblyVersion" + $NewAssemblyInformationalVersion = 'AssemblyInformationalVersion("' + $Version + '")' + Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion" + foreach ($o in $input) { + Write-output $o.FullName + $TmpFile = $o.FullName + ".tmp" + get-content $o.FullName | + ForEach-Object { + $_ -replace 'AssemblyVersion\(".*"\)', $NewAssemblyVersion } | + ForEach-Object { + $_ -replace 'AssemblyInformationalVersion\(".*"\)', $NewAssemblyInformationalVersion + } > $TmpFile + move-item $TmpFile $o.FullName -force + } + } + function Update-AllAssemblyInfoFiles ( $version ) { + foreach ($file in "AssemblyInfo.cs", "AssemblyInfo.vb" ) { + get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ; + } + } + # validate arguments + $r = [System.Text.RegularExpressions.Regex]::Match($Env:VERSION, "\d+\.\d+\.\d+.*"); + if ($r.Success) { + Write-Output "Updating Assembly Version to $Env:VERSION ..."; + Update-AllAssemblyInfoFiles $Env:VERSION; + } + else { + Write-Output " "; + Write-Output "Error: Input version $Env:VERSION does not match x.y.z format!" + Write-Output " "; + Write-Output "Unable to apply version to AssemblyInfo.cs files"; + } + - name: restore Nuget Packages + run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion + # Set the SOLUTION_PATH + - name: Get SLN Path + shell: powershell + run: | + $solution_path = Get-ChildItem *.sln -recurse + $solution_path = $solution_path.FullName + $solution_path = $solution_path -replace "(?:[^\\]*\\){4}", "" + Write-Output $solution_path + echo "SOLUTION_PATH=$($solution_path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Set the SOLUTION_FILE + - name: Get SLN File + shell: powershell + run: | + $solution_file = Get-ChildItem .\*.sln -recurse -Path "$($Env:GITHUB_WORKSPACE)" + echo "SOLUTION_FILE=$($solution_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Login to Docker + - name: Login to Docker + uses: azure/docker-login@v1 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + # Build the solutions in the docker image + - name: Build Solution + shell: powershell + run: | + Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_PATH)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + # Zip up the output files as needed + - name: Zip Build Output + shell: powershell + run: | + $destination = "$($Env:GITHUB_HOME)\output" + New-Item -ItemType Directory -Force -Path ($destination) + Get-ChildItem ($destination) + $exclusions = "packages" + # Trying to get any .json schema files (not currently working) + # Gets any files with the listed extensions. + Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.nuspec", "*.md" | ForEach-Object { + $allowed = $true; + # Exclude any files in submodules + foreach ($exclude in $exclusions) { + if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { + $allowed = $false; + break; + } + } + if ($allowed) { + Write-Host "allowing $($_)" + $_; + } + } | Copy-Item -Destination ($destination) -Force + Write-Host "Getting matching files..." + # Get any files from the output folder that match the following extensions + Get-ChildItem -Path $destination | Where-Object {($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz"))} | ForEach-Object { + # Replace the extensions with dll and xml and create an array + $filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -replace "cpz|clz|cplz", "xml")) + Write-Host "Filenames:" + Write-Host $filenames + if ($filenames.length -gt 0) { + # Attempt to get the files and return them to the output directory + Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force + } + } + Get-ChildItem -Path $destination\*.cplz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" } + Compress-Archive -Path $destination -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force + Write-Host "Output Contents post Zip" + Get-ChildItem -Path $destination + # Write the version to a file to be consumed by the push jobs + - name: Write Version + run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt" + # Upload output files + - name: Upload Build Output + uses: actions/upload-artifact@v1 + with: + name: Build + path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + # Upload the Version file as an artifact + - name: Upload version.txt + uses: actions/upload-artifact@v1 + with: + name: Version + path: ${{env.GITHUB_HOME}}\output\version.txt + # Upload the build package to the release + - name: Upload Release Package + id: upload_release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + asset_content_type: application/zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Push_Nuget_Package: + needs: Build_Project + runs-on: windows-2019 + steps: + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Copy Files to root & delete output directory + run: | + Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz") + Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ + Remove-Item -Path .\output -Recurse + - name: Get nuget File + shell: powershell + run: | + $nuspec_file = (Get-ChildItem *.nuspec -recurse).BaseName + echo "NUSPEC_FILE=$($nuspec_file)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Pulls the nuget builder packages + - name: Add nuget.exe + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" + uses: nuget/setup-nuget@v1 + # Creating nuget Packages + - name: Add Github Packages source + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" + run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} + - name: Create nuget package + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" + run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }} + # Pushes to internal github registry + - name: Publish nuget package to Github registry + if: "!contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')" + run: nuget push **/*.nupkg -source github + # Pushes to nuget gallery + - name: Add nuget.org API Key + if: github.repository_owner == 'PepperDash' && github.repository_visibility == 'public' && !contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate') + run: nuget setApiKey ${{ secrets.NUGET_API_KEY }} + - name: Publish nuget package to nuget.org + if: github.repository_owner == 'PepperDash' && github.repository_visibility == 'public' && !contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate') + run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json From d5f4ba6d4b43aa075e101517b4f8bf23ce245e10 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Tue, 30 Aug 2022 10:55:46 -0400 Subject: [PATCH 3/8] fix: betting init sequence for qse io polling when using serial. --- PDT.LutronQuantum.EPI/LutronQseIO.cs | 32 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/PDT.LutronQuantum.EPI/LutronQseIO.cs b/PDT.LutronQuantum.EPI/LutronQseIO.cs index 0e432d6..e0733e1 100644 --- a/PDT.LutronQuantum.EPI/LutronQseIO.cs +++ b/PDT.LutronQuantum.EPI/LutronQseIO.cs @@ -16,6 +16,7 @@ using PepperDash.Essentials.Bridges; using PepperDash.Essentials.Core; using Crestron.SimplSharpPro.DeviceSupport; +using Crestron.SimplSharpPro.CrestronThread; namespace LutronQuantum @@ -72,12 +73,31 @@ public override bool CustomActivate() } public void Initialize() { - LutronDevice.SendLine("#MONITORING,2,1"); - LutronDevice.SendLine(string.Format("~DEVICE,{0},1", _Properties.IntegrationId)); - LutronDevice.SendLine(string.Format("~DEVICE,{0},2", _Properties.IntegrationId)); - LutronDevice.SendLine(string.Format("~DEVICE,{0},3", _Properties.IntegrationId)); - LutronDevice.SendLine(string.Format("~DEVICE,{0},4", _Properties.IntegrationId)); - LutronDevice.SendLine(string.Format("~DEVICE,{0},5", _Properties.IntegrationId)); + CrestronInvoke.BeginInvoke(o => + { + Thread.Sleep(1000); + LutronDevice.SendLine("#MONITORING,2,1"); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("~DEVICE,{0},1", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("~DEVICE,{0},2", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("~DEVICE,{0},3", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("~DEVICE,{0},4", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("~DEVICE,{0},5", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("?DEVICE,{0},1,35", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("?DEVICE,{0},2,35", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("?DEVICE,{0},3,35", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("?DEVICE,{0},4,35", _Properties.IntegrationId)); + Thread.Sleep(1000); + LutronDevice.SendLine(string.Format("?DEVICE,{0},5,35", _Properties.IntegrationId)); + }); } public void ParseMessage(string[] message) { From b11d2dd551daae145fe6bf2c5a09caa10c6d0a12 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Wed, 31 Aug 2022 09:42:25 -0400 Subject: [PATCH 4/8] Update essentialsplugins-betabuilds.yml --- .github/workflows/essentialsplugins-betabuilds.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/essentialsplugins-betabuilds.yml b/.github/workflows/essentialsplugins-betabuilds.yml index ac25c0e..eb92913 100644 --- a/.github/workflows/essentialsplugins-betabuilds.yml +++ b/.github/workflows/essentialsplugins-betabuilds.yml @@ -17,7 +17,7 @@ env: RELEASE_BRANCH: main jobs: Build_Project: - runs-on: windows-latest + runs-on: windows-2019 steps: # First we checkout the source repo - name: Checkout repo @@ -271,4 +271,4 @@ jobs: run: nuget push **/*.nupkg -source github # Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org #- name: Publish nuget package to nuget.org - # run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json \ No newline at end of file + # run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json From 2940dd0fb2e91de3b0faac8c545dc8df967195fc Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Wed, 31 Aug 2022 16:19:51 -0400 Subject: [PATCH 5/8] Update essentialsplugins-betabuilds.yml --- .github/workflows/essentialsplugins-betabuilds.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/essentialsplugins-betabuilds.yml b/.github/workflows/essentialsplugins-betabuilds.yml index ac25c0e..b41d3ea 100644 --- a/.github/workflows/essentialsplugins-betabuilds.yml +++ b/.github/workflows/essentialsplugins-betabuilds.yml @@ -17,7 +17,7 @@ env: RELEASE_BRANCH: main jobs: Build_Project: - runs-on: windows-latest + runs-on: windows-2019 steps: # First we checkout the source repo - name: Checkout repo @@ -224,7 +224,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Push_Nuget_Package: needs: Build_Project - runs-on: windows-latest + runs-on: windows-2019 steps: - name: Download Build Version Info uses: actions/download-artifact@v1 @@ -271,4 +271,4 @@ jobs: run: nuget push **/*.nupkg -source github # Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org #- name: Publish nuget package to nuget.org - # run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json \ No newline at end of file + # run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json From 94e319113ee3f8f22d0ae66073bb9c1bd39edd22 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Tue, 6 Sep 2022 14:40:38 -0400 Subject: [PATCH 6/8] fix: increase qse polling time --- PDT.LutronQuantum.EPI/LutronQseIO.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PDT.LutronQuantum.EPI/LutronQseIO.cs b/PDT.LutronQuantum.EPI/LutronQseIO.cs index e0733e1..f662e49 100644 --- a/PDT.LutronQuantum.EPI/LutronQseIO.cs +++ b/PDT.LutronQuantum.EPI/LutronQseIO.cs @@ -75,27 +75,28 @@ public void Initialize() { CrestronInvoke.BeginInvoke(o => { - Thread.Sleep(1000); + Random rnd = new Random(); + Thread.Sleep(rnd.Next(10000)); LutronDevice.SendLine("#MONITORING,2,1"); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("~DEVICE,{0},1", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("~DEVICE,{0},2", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("~DEVICE,{0},3", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("~DEVICE,{0},4", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("~DEVICE,{0},5", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("?DEVICE,{0},1,35", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("?DEVICE,{0},2,35", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("?DEVICE,{0},3,35", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("?DEVICE,{0},4,35", _Properties.IntegrationId)); - Thread.Sleep(1000); + Thread.Sleep(rnd.Next(1000, 5000)); LutronDevice.SendLine(string.Format("?DEVICE,{0},5,35", _Properties.IntegrationId)); }); } From bbcc68765aa9c980419d25b8ff24e0978bf45fac Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Tue, 6 Sep 2022 15:45:56 -0400 Subject: [PATCH 7/8] fix: remove metadata file --- .../._PDT.LutronQuantum.EPI.sln | Bin 4096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln diff --git a/PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln b/PDT.LutronQuantum.EPI/._PDT.LutronQuantum.EPI.sln deleted file mode 100644 index 9626bc0462a813180c5de49c82112b838eb0fc43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vGLZbX z38I5x0Z_RBnifVNA1W@DoS&ukeOGKnpcvUpO=`EQ>l=XnpUEal#`g34eSd;bq#3>)&Fp>$S}zL G{|^9p=_;-O From 865b4da0539a40412a29af4565fbb4a7241be75e Mon Sep 17 00:00:00 2001 From: jtalborough Date: Wed, 26 Apr 2023 13:37:50 -0400 Subject: [PATCH 8/8] refoactor: remove old scripts --- .github/scripts/GenerateVersionNumber.ps1 | 45 ----------------------- .github/scripts/UpdateAssemblyVersion.ps1 | 40 -------------------- .github/scripts/ZipBuildOutput.ps1 | 42 --------------------- 3 files changed, 127 deletions(-) delete mode 100644 .github/scripts/GenerateVersionNumber.ps1 delete mode 100644 .github/scripts/UpdateAssemblyVersion.ps1 delete mode 100644 .github/scripts/ZipBuildOutput.ps1 diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 deleted file mode 100644 index b8d53c0..0000000 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -$latestVersions = $(git tag --merged origin/master) -$latestVersion = [version]"0.0.0" -Foreach ($version in $latestVersions) { - Write-Host $version - try { - if (([version]$version) -ge $latestVersion) { - $latestVersion = $version - Write-Host "Setting latest version to: $latestVersion" - } - } - catch { - Write-Host "Unable to convert $($version). Skipping" - continue; - } -} - -$newVersion = [version]$latestVersion -$phase = "" -$newVersionString = "" -switch -regex ($Env:GITHUB_REF) { - '^refs\/heads\/master*.' { - $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build - } - '^refs\/heads\/feature\/*.' { - $phase = 'alpha' - $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER - } - '^refs\/heads\/release\/*.' { - $splitRef = $Env:GITHUB_REF -split "/" - $version = [version]($splitRef[-1] -replace "v", "") - $phase = 'rc' - $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER - } - '^refs\/heads\/dev*.' { - $phase = 'beta' - $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER - } - '^refs\/heads\/hotfix\/*.' { - $phase = 'hotfix' - $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER - } -} - - -Write-Output $newVersionString diff --git a/.github/scripts/UpdateAssemblyVersion.ps1 b/.github/scripts/UpdateAssemblyVersion.ps1 deleted file mode 100644 index e52b31e..0000000 --- a/.github/scripts/UpdateAssemblyVersion.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -function Update-SourceVersion { - Param ([string]$Version) - #$fullVersion = $Version - $baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value - $NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’ - Write-Output "AssemblyVersion = $NewAssemblyVersion" - $NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’ - Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion" - - foreach ($o in $input) { - Write-output $o.FullName - $TmpFile = $o.FullName + “.tmp” - get-content $o.FullName | - ForEach-Object { - $_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion } | - ForEach-Object { - $_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion - } > $TmpFile - move-item $TmpFile $o.FullName -force - } -} - -function Update-AllAssemblyInfoFiles ( $version ) { - foreach ($file in “AssemblyInfo.cs”, “AssemblyInfo.vb” ) { - get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ; - } -} - -# validate arguments -$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*"); -if ($r.Success) { - Write-Output "Updating Assembly Version to $args ..."; - Update-AllAssemblyInfoFiles $args[0]; -} -else { - Write-Output ” “; - Write-Output “Error: Input version does not match x.y.z format!” - Write-Output ” “; - Write-Output "Unable to apply version to AssemblyInfo.cs files"; -} diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 deleted file mode 100644 index c08f166..0000000 --- a/.github/scripts/ZipBuildOutput.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -# Uncomment these for local testing -# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\essentials" -# $Env:SOLUTION_FILE = "PepperDashEssentials" -# $Env:VERSION = "0.0.0-buildType-test" - -# Sets the root directory for the operation -$destination = "$($Env:GITHUB_HOME)\output" -New-Item -ItemType Directory -Force -Path ($destination) -Get-ChildItem ($destination) -$exclusions = @(git submodule foreach --quiet 'echo $name') -# Trying to get any .json schema files (not currently working) -# Gets any files with the listed extensions. -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz" | ForEach-Object { - $allowed = $true; - # Exclude any files in submodules - foreach ($exclude in $exclusions) { - if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { - $allowed = $false; - break; - } - } - if ($allowed) { - Write-Host "allowing $($_)" - $_; - } -} | Copy-Item -Destination ($destination) -Force -Write-Host "Getting matching files..." -# Get any files from the output folder that match the following extensions -Get-ChildItem -Path $destination | Where-Object {($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz"))} | ForEach-Object { - # Replace the extensions with dll and xml and create an array - $filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -replace "cpz|clz|cplz", "xml")) - Write-Host "Filenames:" - Write-Host $filenames - if ($filenames.length -gt 0) { - # Attempt to get the files and return them to the output directory - Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force - } -} -Get-ChildItem -Path $destination\*.cplz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" } -Compress-Archive -Path $destination -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force -Write-Host "Output Contents post Zip" -Get-ChildItem -Path $destination \ No newline at end of file