From 61d84d2ebe278e52439237a099acf5606868d33a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 13 Mar 2020 10:53:22 -0600 Subject: [PATCH 001/117] Adds all branch qualifiers --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4cf0f9..0976b0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,9 @@ on: - feature/* - bugfix/* - hotfix/* - + - release/* + - development + - master jobs: build: From 6cf5fe5ec4f2e0c50856e2a5fae5afd4ecb2898c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 12:30:31 -0600 Subject: [PATCH 002/117] added updated files & scripts --- .github/scripts/GenerateVersionNumber.ps1 | 39 ++++++++++ .github/scripts/UpdateAssemblyVersion.ps1 | 40 ++++++++++ .github/scripts/ZipBuildOutput.ps1 | 23 ++++++ .github/workflows/docker.yml | 75 +++++++++++++++++++ .../SystemInfo/SystemInfoToSimpl.cs | 1 + 5 files changed, 178 insertions(+) create mode 100644 .github/scripts/GenerateVersionNumber.ps1 create mode 100644 .github/scripts/UpdateAssemblyVersion.ps1 create mode 100644 .github/scripts/ZipBuildOutput.ps1 create mode 100644 .github/workflows/docker.yml diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 new file mode 100644 index 0000000..276f9e4 --- /dev/null +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -0,0 +1,39 @@ +$tagCount = $(git rev-list --tags='*.*.*' --count) +if ($tagCount -eq 0) { + $latestVersion = "0.0.0" +} +else { + $latestVersions = $(git describe --tags $(git rev-list --tags='*.*.*' --max-count=10) --abbrev=0) + $latestVersion = "" + Foreach ($version in $latestVersions) { + Write-Output $version + if ($version -match '^[1-9]+.\d+.\d+$') { + $latestVersion = $version + Write-Output "Setting latest version to: $latestVersion" + break + } + } +} +$newVersion = [version]$latestVersion +$phase = "" +$newVersionString = "" +switch -regex ($Env:GITHUB_REF) { + '^refs\/heads\/master\/*.' { + $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1) + } + '^refs\/heads\/feature\/*.' { + $phase = 'alpha' + } + '^refs\/heads\/release\/*.' { + $phase = 'rc' + } + '^refs\/heads\/development\/*.' { + $phase = 'beta' + } + '^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 new file mode 100644 index 0000000..e52b31e --- /dev/null +++ b/.github/scripts/UpdateAssemblyVersion.ps1 @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..02165c2 --- /dev/null +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -0,0 +1,23 @@ +$destination = "$($Env:GITHUB_WORKSPACE)\output" +New-Item -ItemType Directory -Force -Path ($destination) +Get-ChildItem ($destination) +$exclusions = @(git submodule foreach --quiet 'echo $name') +Write-Output "Exclusions $($exclusions)" +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz") | ForEach-Object{ + Write-Host "checking $($_)" + $allowed = $true; + foreach($exclude in $exclusions) { + if((Split-Path $_.FullName -Parent).contains("$($exclude)")) { + Write-Host "excluding $($_)" + $allowed = $false; + break; + } + } + if($allowed) { + Write-Host "allowing $($_)" + $_; + } +} | Copy-Item -Destination ($destination) +Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\output.zip" +Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..9927532 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,75 @@ +name: Branch Build + +on: + push: + branches: + - feature/* + +env: + # solution path doesn't need slashes unless there it is multiple folders deep + SOLUTION_PATH: pepperdash-generic-colorlightz6-epi + SOLUTION_FILE: pepperdash-generic-colorlightz6-epi.sln + VERSION: 0.0.0-buildtype-buildnumber + BUILD_TYPE: Debug + RELEASE_BRANCH: master +jobs: + build_project: + runs-on: windows-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Checkout submodules + shell: bash + run: | + git config --global url."https://github.com/".insteadOf "git@github.com:" + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + - name: Set Build to Relase if triggered from Master + run: | + if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { + Write-Host "Setting build type to Release" + Write-Output "::set-env name=BUILD_TYPE::Release" + } + - name: Set Version Number + shell: powershell + run: | + $version = ./.github/scripts/GenerateVersionNumber.ps1 + Write-Output "::set-env name=VERSION::$version" + - name: Update AssemblyInfo.cs + shell: powershell + run: | + Write-Output ${{ env.VERSION }} + ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + - 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)\$($Env:SOLUTION_FILE)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + ./.github/scripts/ZipBuildOutput.ps1 + - name: Upload Artifact + uses: actions/upload-artifact@v1 + with: + name: Build + path: ./output.zip + - name: Create Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: v${{ env.VERSION }} + release_name: v${{ env.VERSION }} + prerelease: ${{contains('debug', env.BUILD_TYPE)}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload + id: upload_release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./output.zip + asset_name: output.zip + asset_content_type: application/zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/Pepperdash Core/Pepperdash Core/SystemInfo/SystemInfoToSimpl.cs b/Pepperdash Core/Pepperdash Core/SystemInfo/SystemInfoToSimpl.cs index 80c8246..1d58a80 100644 --- a/Pepperdash Core/Pepperdash Core/SystemInfo/SystemInfoToSimpl.cs +++ b/Pepperdash Core/Pepperdash Core/SystemInfo/SystemInfoToSimpl.cs @@ -432,6 +432,7 @@ namespace PepperDash.Core.SystemInfo protected void OnProgramChange(ProgramInfo program, ushort index, ushort type) { var handler = ProgramChange; + if (handler != null) { var args = new ProgramChangeEventArgs(program, type); From fe5ab01abceb7a524f5b41a37266c6a5cef31a27 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:20:07 -0600 Subject: [PATCH 003/117] updated version number to look at only tags on master --- .github/scripts/GenerateVersionNumber.ps1 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 276f9e4..82d919c 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -3,14 +3,18 @@ if ($tagCount -eq 0) { $latestVersion = "0.0.0" } else { - $latestVersions = $(git describe --tags $(git rev-list --tags='*.*.*' --max-count=10) --abbrev=0) - $latestVersion = "" + $latestVersions = $(git describe --tags $(git tag --merged master) --abbrev=0) + $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { - Write-Output $version - if ($version -match '^[1-9]+.\d+.\d+$') { - $latestVersion = $version - Write-Output "Setting latest version to: $latestVersion" - break + 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; } } } @@ -18,7 +22,7 @@ $newVersion = [version]$latestVersion $phase = "" $newVersionString = "" switch -regex ($Env:GITHUB_REF) { - '^refs\/heads\/master\/*.' { + '^refs\/heads\/master*.' { $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1) } '^refs\/heads\/feature\/*.' { @@ -27,7 +31,7 @@ switch -regex ($Env:GITHUB_REF) { '^refs\/heads\/release\/*.' { $phase = 'rc' } - '^refs\/heads\/development\/*.' { + '^refs\/heads\/development*.' { $phase = 'beta' } '^refs\/heads\/hotfix\/*.' { From 46f775e584edb404b0412fb7c4dc2d8f03c38631 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:31:46 -0600 Subject: [PATCH 004/117] fixed solution name --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9927532..72cc1d0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,8 +7,8 @@ on: env: # solution path doesn't need slashes unless there it is multiple folders deep - SOLUTION_PATH: pepperdash-generic-colorlightz6-epi - SOLUTION_FILE: pepperdash-generic-colorlightz6-epi.sln + SOLUTION_PATH: PepperDash Core + SOLUTION_FILE: PepperDash Core.sln VERSION: 0.0.0-buildtype-buildnumber BUILD_TYPE: Debug RELEASE_BRANCH: master From 13205833e856ae2abd6b592812256dd26b09a7e3 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:43:57 -0600 Subject: [PATCH 005/117] removed check for tag count --- .github/scripts/GenerateVersionNumber.ps1 | 29 ++++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 82d919c..137ee78 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,23 +1,18 @@ -$tagCount = $(git rev-list --tags='*.*.*' --count) -if ($tagCount -eq 0) { - $latestVersion = "0.0.0" -} -else { - $latestVersions = $(git describe --tags $(git tag --merged master) --abbrev=0) - $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; +$latestVersions = $(git describe --tags $(git tag --merged master) --abbrev=0) +$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 = "" From a0ddeb9328e4e0808fbc8d22b83a4c674f374392 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:44:43 -0600 Subject: [PATCH 006/117] removed Jenkins action and changed name --- .github/workflows/docker.yml | 2 +- .github/workflows/main.yml | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 72cc1d0..8f203bc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: Branch Build +name: Branch Build Using Docker on: push: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0976b0a..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build Non-Release Branch - - -on: - push: - branches: - - feature/* - - bugfix/* - - hotfix/* - - release/* - - development - - master - -jobs: - build: - name: Build - runs-on: self-hosted - steps: - - run: Invoke-WebRequest -URI "http://localhost:8080/job/PepperDash%20Core%20Branch%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 73088c9977d337a6a78a1b7c8e55ec072281241d Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:54:30 -0600 Subject: [PATCH 007/117] commented out steps to enable better testing --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- .github/workflows/docker.yml | 70 +++++++++++------------ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 137ee78..4a4482c 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = $(git describe --tags $(git tag --merged master) --abbrev=0) +$latestVersions = $(git describe --tags $(git tag --merged master)) $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8f203bc..6d06a70 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,7 +27,7 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Set Build to Relase if triggered from Master + - name: Set Build to Release if triggered from Master run: | if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { Write-Host "Setting build type to Release" @@ -38,38 +38,38 @@ jobs: run: | $version = ./.github/scripts/GenerateVersionNumber.ps1 Write-Output "::set-env name=VERSION::$version" - - name: Update AssemblyInfo.cs - shell: powershell - run: | - Write-Output ${{ env.VERSION }} - ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} - - 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)\$($Env:SOLUTION_FILE)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" - ./.github/scripts/ZipBuildOutput.ps1 - - name: Upload Artifact - uses: actions/upload-artifact@v1 - with: - name: Build - path: ./output.zip - - name: Create Release - id: create_release - uses: actions/create-release@v1 - with: - tag_name: v${{ env.VERSION }} - release_name: v${{ env.VERSION }} - prerelease: ${{contains('debug', env.BUILD_TYPE)}} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload - id: upload_release - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./output.zip - asset_name: output.zip - asset_content_type: application/zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Update AssemblyInfo.cs + # shell: powershell + # run: | + # Write-Output ${{ env.VERSION }} + # ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + # - 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)\$($Env:SOLUTION_FILE)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + # ./.github/scripts/ZipBuildOutput.ps1 + # - name: Upload Artifact + # uses: actions/upload-artifact@v1 + # with: + # name: Build + # path: ./output.zip + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # with: + # tag_name: v${{ env.VERSION }} + # release_name: v${{ env.VERSION }} + # prerelease: ${{contains('debug', env.BUILD_TYPE)}} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Upload + # id: upload_release + # uses: actions/upload-release-asset@v1 + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./output.zip + # asset_name: output.zip + # asset_content_type: application/zip + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b650e5186e81d713132e02d53d593e992ecd6263 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 13:56:24 -0600 Subject: [PATCH 008/117] removed git describe command & commented more steps out --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- .github/workflows/docker.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 4a4482c..529aa22 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = $(git describe --tags $(git tag --merged master)) +$latestVersions = $(git tag --merged master) $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6d06a70..ef66bad 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,12 +27,12 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Set Build to Release if triggered from Master - run: | - if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { - Write-Host "Setting build type to Release" - Write-Output "::set-env name=BUILD_TYPE::Release" - } + # - name: Set Build to Release if triggered from Master + # run: | + # if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { + # Write-Host "Setting build type to Release" + # Write-Output "::set-env name=BUILD_TYPE::Release" + # } - name: Set Version Number shell: powershell run: | From 4dc9d0b59b1dbb6d0e93f8479300a0ee4a7ef916 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:00:01 -0600 Subject: [PATCH 009/117] getting git version & checking command validity --- .github/workflows/docker.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ef66bad..bf9adb7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,17 +27,23 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + - name: Testing git command + shell: powershell + run: | + Write-Host $(git --version) + Write-Host $(git tag --merged master) + # - name: Set Build to Release if triggered from Master # run: | # if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { # Write-Host "Setting build type to Release" # Write-Output "::set-env name=BUILD_TYPE::Release" # } - - name: Set Version Number - shell: powershell - run: | - $version = ./.github/scripts/GenerateVersionNumber.ps1 - Write-Output "::set-env name=VERSION::$version" + # - name: Set Version Number + # shell: powershell + # run: | + # $version = ./.github/scripts/GenerateVersionNumber.ps1 + # Write-Output "::set-env name=VERSION::$version" # - name: Update AssemblyInfo.cs # shell: powershell # run: | From 2cfaada92d810317bb583a86c2dc3dc1c8ed803c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:07:10 -0600 Subject: [PATCH 010/117] trying quotes --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 529aa22..3b1cd40 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = $(git tag --merged master) +$latestVersions = $(git tag --merged "master") $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version From 9fd1a23019a776bfe0da5af923a532134a2d153f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:14:05 -0600 Subject: [PATCH 011/117] trying without wrapping in $() --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 3b1cd40..e7eeb06 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = $(git tag --merged "master") +$latestVersions = git tag --merged master $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version From 2afd9e65ce133fc8681850a10f47c1fdb6e46201 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:16:06 -0600 Subject: [PATCH 012/117] added jenkins workflow back in --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 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 0000000..0976b0a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Build Non-Release Branch + + +on: + push: + branches: + - feature/* + - bugfix/* + - hotfix/* + - release/* + - development + - master + +jobs: + build: + name: Build + runs-on: self-hosted + steps: + - run: Invoke-WebRequest -URI "http://localhost:8080/job/PepperDash%20Core%20Branch%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 15cf4ca0c28886c85d3722bc3f6c777c79df6ec2 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:17:06 -0600 Subject: [PATCH 013/117] forgot to save the yaml --- .github/workflows/docker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bf9adb7..63ffea9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,8 +30,9 @@ jobs: - name: Testing git command shell: powershell run: | - Write-Host $(git --version) - Write-Host $(git tag --merged master) + git --version + git branch + git tag --merged master # - name: Set Build to Release if triggered from Master # run: | From fd9669d8bdeb3947cabc03400299bda50559a0ed Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:19:07 -0600 Subject: [PATCH 014/117] added git fetch command --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 63ffea9..befae68 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,6 +31,7 @@ jobs: shell: powershell run: | git --version + git fetch git branch git tag --merged master From 35a6d43e6f820d5e6033e15ba9a637578071e898 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:22:47 -0600 Subject: [PATCH 015/117] changed fetch command to match the one from the actions/checkout repo --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index befae68..9c8800e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,7 +31,7 @@ jobs: shell: powershell run: | git --version - git fetch + git fetch --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* git branch git tag --merged master From 3edcd36d29572efc84c4d363a613fae7b665f399 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:24:06 -0600 Subject: [PATCH 016/117] removed version commands --- .github/workflows/docker.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9c8800e..850d5e1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,13 +27,8 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Testing git command - shell: powershell - run: | - git --version - git fetch --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git branch - git tag --merged master + - name: Fetching the rest of the branches + run: git fetch --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* # - name: Set Build to Release if triggered from Master # run: | From e7b63e19ae853f09b64b028ed014bc2ac6c98423 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:25:56 -0600 Subject: [PATCH 017/117] added version set step back in --- .github/workflows/docker.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 850d5e1..d65d62b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -36,11 +36,11 @@ jobs: # Write-Host "Setting build type to Release" # Write-Output "::set-env name=BUILD_TYPE::Release" # } - # - name: Set Version Number - # shell: powershell - # run: | - # $version = ./.github/scripts/GenerateVersionNumber.ps1 - # Write-Output "::set-env name=VERSION::$version" + - name: Set Version Number + shell: powershell + run: | + $version = ./.github/scripts/GenerateVersionNumber.ps1 + Write-Output "::set-env name=VERSION::$version" # - name: Update AssemblyInfo.cs # shell: powershell # run: | From d4565dbee94fec9226e54fa4a09c784bbb6b9b8e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:33:48 -0600 Subject: [PATCH 018/117] changed to pull tags from origin/master instead of just master --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- .github/workflows/docker.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index e7eeb06..51e7daf 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = git tag --merged master +$latestVersions = git tag --merged origin/master $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d65d62b..2d988d3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,8 +27,6 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Fetching the rest of the branches - run: git fetch --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* # - name: Set Build to Release if triggered from Master # run: | From 1373dd8c8f851f40d23f8543ab4962c5e8a45a41 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:43:49 -0600 Subject: [PATCH 019/117] back to testing in yaml --- .github/workflows/docker.yml | 12 ++++++---- aklfjdskal | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 aklfjdskal diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2d988d3..f9f98d6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,6 +27,8 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + - name: Check for tags + run: git tag --merged origin/master # - name: Set Build to Release if triggered from Master # run: | @@ -34,11 +36,11 @@ jobs: # Write-Host "Setting build type to Release" # Write-Output "::set-env name=BUILD_TYPE::Release" # } - - name: Set Version Number - shell: powershell - run: | - $version = ./.github/scripts/GenerateVersionNumber.ps1 - Write-Output "::set-env name=VERSION::$version" + # - name: Set Version Number + # shell: powershell + # run: | + # $version = ./.github/scripts/GenerateVersionNumber.ps1 + # Write-Output "::set-env name=VERSION::$version" # - name: Update AssemblyInfo.cs # shell: powershell # run: | diff --git a/aklfjdskal b/aklfjdskal new file mode 100644 index 0000000..3e37075 --- /dev/null +++ b/aklfjdskal @@ -0,0 +1,46 @@ +0.0.0001 +0.0.10_DoNotUse_BadBuild +0.0.11 +0.0.12 +0.0.13 +0.0.14 +0.0.15 +0.0.16 +0.0.17 +0.0.19 +0.0.2 +0.0.20 +0.0.21 +0.0.25 +0.0.29 +0.0.3 +0.0.30 +0.0.5 +0.0.6 +0.0.7 +0.0.8 +0.0.9 +1.0.18 +1.0.22 +1.0.23 +1.0.24 +1.0.25 +1.0.26 +1.0.27 +1.0.28 +1.0.29 +1.0.30 +1.0.31 +1.0.32 +1.0.33 +1.0.34 +1.0.35 +1.0.36-alpha-157 +1.0.36-alpha-159 +1.0.36-alpha-160 +release +v1.0.11.x +v1.0.13 +v1.0.14.27867 +v1.0.15.26179 +v1.0.16.20061 From 80f2c0a08222c373176a3ee2be9783be507aba2c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:47:21 -0600 Subject: [PATCH 020/117] trying git tag --merged --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f9f98d6..4f687ce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Check for tags - run: git tag --merged origin/master + run: git tag --merged # - name: Set Build to Release if triggered from Master # run: | From 83ac93d302db0912bf121b0f00c822813dd0f321 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:48:31 -0600 Subject: [PATCH 021/117] added logic to print list of tags --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4f687ce..2e43683 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Check for tags - run: git tag --merged + run: Write-Host $(git tag --merged) # - name: Set Build to Release if triggered from Master # run: | From f68382d83109610eb28df1a2e70e207e828efc63 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:49:56 -0600 Subject: [PATCH 022/117] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2e43683..dec6f17 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Check for tags - run: Write-Host $(git tag --merged) + run: Write-Output $(git tag --merged) # - name: Set Build to Release if triggered from Master # run: | From 5b4523a96577b0dc6aa36bc902c8cf60e9d9a0ec Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:51:53 -0600 Subject: [PATCH 023/117] trying script with git tag --merged --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- .github/workflows/docker.yml | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 51e7daf..4386546 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = git tag --merged origin/master +$latestVersions = git tag --merged $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dec6f17..ef66bad 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,20 +27,17 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Check for tags - run: Write-Output $(git tag --merged) - # - name: Set Build to Release if triggered from Master # run: | # if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { # Write-Host "Setting build type to Release" # Write-Output "::set-env name=BUILD_TYPE::Release" # } - # - name: Set Version Number - # shell: powershell - # run: | - # $version = ./.github/scripts/GenerateVersionNumber.ps1 - # Write-Output "::set-env name=VERSION::$version" + - name: Set Version Number + shell: powershell + run: | + $version = ./.github/scripts/GenerateVersionNumber.ps1 + Write-Output "::set-env name=VERSION::$version" # - name: Update AssemblyInfo.cs # shell: powershell # run: | From 45174c7d8b11f4bd444f32af02df330608b53c95 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:53:11 -0600 Subject: [PATCH 024/117] added UpdateAssemblyInfo.cs --- .github/workflows/docker.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ef66bad..475f951 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,11 +38,11 @@ jobs: run: | $version = ./.github/scripts/GenerateVersionNumber.ps1 Write-Output "::set-env name=VERSION::$version" - # - name: Update AssemblyInfo.cs - # shell: powershell - # run: | - # Write-Output ${{ env.VERSION }} - # ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + - name: Update AssemblyInfo.cs + shell: powershell + run: | + Write-Output ${{ env.VERSION }} + ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} # - name: Build Solution # shell: powershell # run: | From 646c03b860b6d0aef42464dbda3fa9c4850a1276 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:55:59 -0600 Subject: [PATCH 025/117] adding $() back in --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 4386546..96b8b07 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = git tag --merged +$latestVersions = $(git tag --merged) $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version From 29e56e5011fca01ac9c84e8b057f8e00cddf6edf Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 14:59:03 -0600 Subject: [PATCH 026/117] added step to fetch tags --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 475f951..c031588 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,6 +33,8 @@ jobs: # Write-Host "Setting build type to Release" # Write-Output "::set-env name=BUILD_TYPE::Release" # } + - name: Fetch tags + run: git fetch --tags - name: Set Version Number shell: powershell run: | From 21f665fff6c0ca6797626c5782c7e3d62aeb167b Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:00:36 -0600 Subject: [PATCH 027/117] trying origin/master again --- .github/scripts/GenerateVersionNumber.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index 96b8b07..d05aecd 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -1,4 +1,4 @@ -$latestVersions = $(git tag --merged) +$latestVersions = $(git tag --merged origin/master) $latestVersion = [version]"0.0.0" Foreach ($version in $latestVersions) { Write-Host $version From 6a5ba9811fb6790204b0fe4e75dfd1017e1e2bde Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:04:35 -0600 Subject: [PATCH 028/117] modified zip name to include solution name and version# --- .github/scripts/ZipBuildOutput.ps1 | 2 +- .github/workflows/docker.yml | 61 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 02165c2..156eb90 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -19,5 +19,5 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c } } | Copy-Item -Destination ($destination) Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\output.zip" +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION) $($Env.VERSION).zip" Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c031588..e40a75e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,8 +7,9 @@ on: env: # solution path doesn't need slashes unless there it is multiple folders deep + # solution name does not include extension. .sln is assumed SOLUTION_PATH: PepperDash Core - SOLUTION_FILE: PepperDash Core.sln + SOLUTION_FILE: PepperDash Core VERSION: 0.0.0-buildtype-buildnumber BUILD_TYPE: Debug RELEASE_BRANCH: master @@ -45,33 +46,33 @@ jobs: run: | Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} - # - 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)\$($Env:SOLUTION_FILE)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" - # ./.github/scripts/ZipBuildOutput.ps1 - # - name: Upload Artifact - # uses: actions/upload-artifact@v1 - # with: - # name: Build - # path: ./output.zip - # - name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # with: - # tag_name: v${{ env.VERSION }} - # release_name: v${{ env.VERSION }} - # prerelease: ${{contains('debug', env.BUILD_TYPE)}} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload - # id: upload_release - # uses: actions/upload-release-asset@v1 - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ./output.zip - # asset_name: output.zip - # asset_content_type: application/zip - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + ./.github/scripts/ZipBuildOutput.ps1 + - name: Upload Artifact + uses: actions/upload-artifact@v1 + with: + name: Build + path: ./output.zip + - name: Create Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: v${{ env.VERSION }} + release_name: v${{ env.VERSION }} + prerelease: ${{contains('debug', env.BUILD_TYPE)}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload + id: upload_release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./output.zip + asset_name: output.zip + asset_content_type: application/zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 33421ec0649691da4cbbf38feeb84e30de18cba9 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:15:15 -0600 Subject: [PATCH 029/117] fixed filenames to match everywhere --- .github/scripts/ZipBuildOutput.ps1 | 2 +- .github/workflows/docker.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 156eb90..39ae2b4 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -19,5 +19,5 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c } } | Copy-Item -Destination ($destination) Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION) $($Env.VERSION).zip" +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION)-$($Env.VERSION).zip" Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e40a75e..1cf2330 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -70,8 +70,8 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./output.zip - asset_name: output.zip + asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}} asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 524df330a19d0047762ab22d7947411e4ff9cd26 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:24:16 -0600 Subject: [PATCH 030/117] missed one --- .github/workflows/docker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1cf2330..baf8202 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,12 +28,12 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - # - name: Set Build to Release if triggered from Master - # run: | - # if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { - # Write-Host "Setting build type to Release" - # Write-Output "::set-env name=BUILD_TYPE::Release" - # } + - name: Set Build to Release if triggered from Master + run: | + if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { + Write-Host "Setting build type to Release" + Write-Output "::set-env name=BUILD_TYPE::Release" + } - name: Fetch tags run: git fetch --tags - name: Set Version Number @@ -55,7 +55,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: Build - path: ./output.zip + path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip - name: Create Release id: create_release uses: actions/create-release@v1 From 3c7330857705d4478c124b8f0542a1b248f5dcb0 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:37:45 -0600 Subject: [PATCH 031/117] fixed env variables and added steps to checkout build repos --- .github/scripts/ZipBuildOutput.ps1 | 2 +- .github/workflows/docker.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 39ae2b4..b8abd0a 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -19,5 +19,5 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c } } | Copy-Item -Destination ($destination) Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION)-$($Env.VERSION).zip" +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env.VERSION).zip" Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index baf8202..d71eb43 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,6 +34,19 @@ jobs: Write-Host "Setting build type to Release" Write-Output "::set-env name=BUILD_TYPE::Release" } + - name: Checkout Builds Repo + if: contains('release', env.BUILD_TYPE) + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILD_TOKEN }} + path: ./builds_repo + repo: PepperDash/PepperDashCore-Builds + - name: Checkout Builds Repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILD_TOKEN }} + path: ./internal_builds_repo + repo: PepperDash-Engineering/pepperdash-core-builds - name: Fetch tags run: git fetch --tags - name: Set Version Number From 02d54f88a93d77273fbfcc26c2b25c20f31adc89 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:40:15 -0600 Subject: [PATCH 032/117] fixed input names --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d71eb43..0fd34a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,13 +40,13 @@ jobs: with: token: ${{ secrets.BUILD_TOKEN }} path: ./builds_repo - repo: PepperDash/PepperDashCore-Builds + repository: PepperDash/PepperDashCore-Builds - name: Checkout Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILD_TOKEN }} path: ./internal_builds_repo - repo: PepperDash-Engineering/pepperdash-core-builds + repository: PepperDash-Engineering/pepperdash-core-builds - name: Fetch tags run: git fetch --tags - name: Set Version Number From 646b6ab6131d325ff53639307a3a558832f6360e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:51:26 -0600 Subject: [PATCH 033/117] added branch just for testing --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0fd34a5..67d6842 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,7 @@ on: push: branches: - feature/* + - hotfix/* env: # solution path doesn't need slashes unless there it is multiple folders deep From 38b49d723f1c404f8e037d80a3e106e68ea16fa2 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 15:56:55 -0600 Subject: [PATCH 034/117] forgot an S --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 67d6842..fe9205c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -39,13 +39,13 @@ jobs: if: contains('release', env.BUILD_TYPE) uses: actions/checkout@v2 with: - token: ${{ secrets.BUILD_TOKEN }} + token: ${{ secrets.BUILDS_TOKEN }} path: ./builds_repo repository: PepperDash/PepperDashCore-Builds - name: Checkout Builds Repo uses: actions/checkout@v2 with: - token: ${{ secrets.BUILD_TOKEN }} + token: ${{ secrets.BUILDS_TOKEN }} path: ./internal_builds_repo repository: PepperDash-Engineering/pepperdash-core-builds - name: Fetch tags From 369c5f56562df8d324326a7159e2a7acbaf2d1de Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 16:05:32 -0600 Subject: [PATCH 035/117] changed . to : --- .github/scripts/ZipBuildOutput.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index b8abd0a..8f20101 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -18,6 +18,7 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c $_; } } | Copy-Item -Destination ($destination) -Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env.VERSION).zip" +Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output"] +$version = $Env +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" From 67850f58d78550cfdfc692f09580cff46274dcb2 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 16:24:02 -0600 Subject: [PATCH 036/117] added .zip to asset name for upload to release --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fe9205c..1b28839 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -85,7 +85,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip - asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}} + asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2bed6325ed8743acfaf291301831600361bb8b3b Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 16:49:53 -0600 Subject: [PATCH 037/117] added logic to get dll & xml files --- .github/scripts/ZipBuildOutput.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 8f20101..9e006a5 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,13 +2,10 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Write-Output "Exclusions $($exclusions)" Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz") | ForEach-Object{ - Write-Host "checking $($_)" $allowed = $true; foreach($exclude in $exclusions) { if((Split-Path $_.FullName -Parent).contains("$($exclude)")) { - Write-Host "excluding $($_)" $allowed = $false; break; } @@ -18,7 +15,12 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c $_; } } | Copy-Item -Destination ($destination) -Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output"] +Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { + $filenames = @($_ -replace "cpz|clz|cplz","dll",$_ -replace "cpz|clz|cplz","xml") + if($filenames.length > 0) { + Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) + } +} $version = $Env Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" From cbfa24bce1d5acd6625d4538c50c09666e261450 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 16:58:12 -0600 Subject: [PATCH 038/117] missed a - --- .github/scripts/ZipBuildOutput.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 9e006a5..d8c70ff 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -15,7 +15,7 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c $_; } } | Copy-Item -Destination ($destination) -Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { +Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { $filenames = @($_ -replace "cpz|clz|cplz","dll",$_ -replace "cpz|clz|cplz","xml") if($filenames.length > 0) { Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) From 0a33e498a7cbbf492249ab11825f1bc90bf15603 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 11:24:06 -0600 Subject: [PATCH 039/117] Adding second job to handle push actions --- .github/workflows/docker.yml | 70 ++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b28839..8013b3d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,19 +35,7 @@ jobs: Write-Host "Setting build type to Release" Write-Output "::set-env name=BUILD_TYPE::Release" } - - name: Checkout Builds Repo - if: contains('release', env.BUILD_TYPE) - uses: actions/checkout@v2 - with: - token: ${{ secrets.BUILDS_TOKEN }} - path: ./builds_repo - repository: PepperDash/PepperDashCore-Builds - - name: Checkout Builds Repo - uses: actions/checkout@v2 - with: - token: ${{ secrets.BUILDS_TOKEN }} - path: ./internal_builds_repo - repository: PepperDash-Engineering/pepperdash-core-builds + - name: Fetch tags run: git fetch --tags - name: Set Version Number @@ -70,23 +58,45 @@ jobs: with: name: Build path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip - - name: Create Release - id: create_release - uses: actions/create-release@v1 + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # with: + # tag_name: v${{ env.VERSION }} + # release_name: v${{ env.VERSION }} + # prerelease: ${{contains('debug', env.BUILD_TYPE)}} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Upload + # id: upload_release + # uses: actions/upload-release-asset@v1 + # with: + # upload_url: ${{ steps.create_release.outputs.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_output: + needs: build_project + steps: + - name: Checkout Public Builds Repo + if: contains('master', env.GITHUB_REF) || contains('release', env.GITHUB_REF) + uses: actions/checkout@v2 with: - tag_name: v${{ env.VERSION }} - release_name: v${{ env.VERSION }} - prerelease: ${{contains('debug', env.BUILD_TYPE)}} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload - id: upload_release - uses: actions/upload-release-asset@v1 + token: ${{ secrets.BUILDS_TOKEN }} + path: ./builds_repo + repository: PepperDash/PepperDashCore-Builds + - name: Checkout Internal Builds Repo + uses: actions/checkout@v2 with: - upload_url: ${{ steps.create_release.outputs.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 }} + token: ${{ secrets.BUILDS_TOKEN }} + path: ./internal_builds_repo + repository: PepperDash-Engineering/pepperdash-core-builds + - name: Download Artifact + uses: action/download-artifact@v1 + with: + name: Build + - name: Check Directory + run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} From a9a14589af437fab66300cb34b4bce8756c92bfc Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 11:49:24 -0600 Subject: [PATCH 040/117] Adds runs-on property to push_output job --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8013b3d..2b64b09 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -79,6 +79,7 @@ jobs: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} push_output: needs: build_project + runs-on: windows-latest steps: - name: Checkout Public Builds Repo if: contains('master', env.GITHUB_REF) || contains('release', env.GITHUB_REF) From cca17afa01d14d7765a9213a37ff76fa0a0fbbe7 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 11:53:43 -0600 Subject: [PATCH 041/117] Delete main.yml Removes action-runner script that triggered Jenkins pipeline --- .github/workflows/main.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0976b0a..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build Non-Release Branch - - -on: - push: - branches: - - feature/* - - bugfix/* - - hotfix/* - - release/* - - development - - master - -jobs: - build: - name: Build - runs-on: self-hosted - steps: - - run: Invoke-WebRequest -URI "http://localhost:8080/job/PepperDash%20Core%20Branch%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 f0ba30ce96758d5baee387cdd3ebfe2a50710e09 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 12:07:52 -0600 Subject: [PATCH 042/117] adds missing s to actions/ --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2b64b09..8418d9b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -95,7 +95,7 @@ jobs: path: ./internal_builds_repo repository: PepperDash-Engineering/pepperdash-core-builds - name: Download Artifact - uses: action/download-artifact@v1 + uses: actions/download-artifact@v1 with: name: Build - name: Check Directory From c80aa71208b1635a4ecf63a65e703166745b3ba8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 13:34:01 -0600 Subject: [PATCH 043/117] added logic to write version to file and pickup in next job --- .github/.vscode/settings.json | 7 +++++ .github/workflows/docker.yml | 48 ++++++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 .github/.vscode/settings.json diff --git a/.github/.vscode/settings.json b/.github/.vscode/settings.json new file mode 100644 index 0000000..c4ce7a4 --- /dev/null +++ b/.github/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "workbench.colorCustomizations": { + "activityBar.background": "#19340D", + "titleBar.activeBackground": "#234912", + "titleBar.activeForeground": "#F6FCF3" + } +} \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8418d9b..be197d4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,7 +35,7 @@ jobs: Write-Host "Setting build type to Release" Write-Output "::set-env name=BUILD_TYPE::Release" } - + - name: Fetch tags run: git fetch --tags - name: Set Version Number @@ -53,11 +53,18 @@ jobs: 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" ./.github/scripts/ZipBuildOutput.ps1 - - name: Upload Artifact + - name: Write Version + run: Write-Output $($Env:VERSION) | Out-File -FilePath ".\output\version.txt" + - name: Upload Build Output uses: actions/upload-artifact@v1 with: name: Build path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + - name: Upload Version.txt + uses: actions/upload-artifact@v1 + with: + name: Version + path: ./output/version.txt # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -67,37 +74,48 @@ jobs: # prerelease: ${{contains('debug', env.BUILD_TYPE)}} # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload + # - name: Upload # id: upload_release # uses: actions/upload-release-asset@v1 # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} + # upload_url: ${{ steps.create_release.outputs.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_output: + internal_push_output: needs: build_project runs-on: windows-latest steps: - - name: Checkout Public Builds Repo - if: contains('master', env.GITHUB_REF) || contains('release', env.GITHUB_REF) - uses: actions/checkout@v2 - with: - token: ${{ secrets.BUILDS_TOKEN }} - path: ./builds_repo - repository: PepperDash/PepperDashCore-Builds - name: Checkout Internal Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - path: ./internal_builds_repo repository: PepperDash-Engineering/pepperdash-core-builds - - name: Download Artifact + - name: Download Build output uses: actions/download-artifact@v1 with: name: Build + - name: Download Version info + uses: actions/download-artifact@v1 + with: + name: Version - name: Check Directory run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} - + # public_push_output: + # needs: build_project + # runs-on: windows-latest + # steps: + # - name: Checkout public Builds Repo + # uses: actions/checkout@v2 + # with: + # token: ${{ secrets.BUILDS_TOKEN }} + # path: ./internal_builds_repo + # repository: PepperDash-Engineering/pepperdash-core-builds + # - name: Download Artifact + # uses: actions/download-artifact@v1 + # with: + # name: Build + # - name: Check Directory + # run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} From bba2838936ef34e8bccb91d7a88666377285d9f8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 14:16:30 -0600 Subject: [PATCH 044/117] added logic to get version from previous step --- .github/scripts/ZipBuildOutput.ps1 | 14 +++++++------- .github/workflows/docker.yml | 12 +++++++++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index d8c70ff..485d0ab 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,22 +2,22 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz") | ForEach-Object{ +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz") | ForEach-Object { $allowed = $true; - foreach($exclude in $exclusions) { - if((Split-Path $_.FullName -Parent).contains("$($exclude)")) { + foreach ($exclude in $exclusions) { + if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { $allowed = $false; break; - } } - if($allowed) { + } + if ($allowed) { Write-Host "allowing $($_)" $_; } } | Copy-Item -Destination ($destination) Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { - $filenames = @($_ -replace "cpz|clz|cplz","dll",$_ -replace "cpz|clz|cplz","xml") - if($filenames.length > 0) { + $filenames = @($_ -replace "cpz|clz|cplz", "dll", $_ -replace "cpz|clz|cplz", "xml") + if ($filenames.length -gt 0) { Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) } } diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index be197d4..960f265 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -97,12 +97,22 @@ jobs: uses: actions/download-artifact@v1 with: name: Build + path: ./build.zip - name: Download Version info uses: actions/download-artifact@v1 with: name: Version + path: ./version.zip + - name: Set Version Number + run: | + Expand-Archive -Path ./version.zip -DestinationPath ./ + $version = Get-Content -Path ./version.txt + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./version.zip + Remove-Item -Path ./version.txt - name: Check Directory - run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} + run: | + Get-ChildItem ./ # public_push_output: # needs: build_project # runs-on: windows-latest From 8b2fe1422452fe1f68971ff02cc3c2ee6fca15b7 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 14:27:30 -0600 Subject: [PATCH 045/117] checking directories --- .github/workflows/docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 960f265..85692af 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -103,6 +103,8 @@ jobs: with: name: Version path: ./version.zip + - name: Check Directory + run: Get-ChildItem "./" - name: Set Version Number run: | Expand-Archive -Path ./version.zip -DestinationPath ./ @@ -112,7 +114,7 @@ jobs: Remove-Item -Path ./version.txt - name: Check Directory run: | - Get-ChildItem ./ + Get-ChildItem "./" # public_push_output: # needs: build_project # runs-on: windows-latest From c841e46afd8a5311810d790973cec70f091696eb Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 14:32:49 -0600 Subject: [PATCH 046/117] Adds shell property --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 960f265..ea8d3f4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -104,6 +104,7 @@ jobs: name: Version path: ./version.zip - name: Set Version Number + shell: powershell run: | Expand-Archive -Path ./version.zip -DestinationPath ./ $version = Get-Content -Path ./version.txt From 0e53378af2bbf5b95277dd8fc53cb3f05e49255c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 14:45:48 -0600 Subject: [PATCH 047/117] taking it 1 step at a time --- .github/workflows/docker.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5eb59b6..676a262 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -108,11 +108,12 @@ jobs: - name: Set Version Number shell: powershell run: | - Expand-Archive -Path ./version.zip -DestinationPath ./ - $version = Get-Content -Path ./version.txt - Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./version.zip - Remove-Item -Path ./version.txt + Expand-Archive -Path version.zip -DestinationPath ./ + Get-ChildItem "./" + # $version = Get-Content -Path ./version.txt + # Write-Output "::set-env name=VERSION::$version" + # Remove-Item -Path ./version.zip + # Remove-Item -Path ./version.txt - name: Check Directory run: | Get-ChildItem "./" From 5f0e528e376ab63fcf7a9e15394752b575ab2bd5 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 15:25:15 -0600 Subject: [PATCH 048/117] Trying as though version is a txt file, not zip --- .github/workflows/docker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 676a262..4ec14b1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -102,18 +102,18 @@ jobs: uses: actions/download-artifact@v1 with: name: Version - path: ./version.zip + path: ./version.txt - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number shell: powershell run: | - Expand-Archive -Path version.zip -DestinationPath ./ - Get-ChildItem "./" - # $version = Get-Content -Path ./version.txt - # Write-Output "::set-env name=VERSION::$version" - # Remove-Item -Path ./version.zip - # Remove-Item -Path ./version.txt + Get-ChildItem "./" + # Expand-Archive -Path version.zip -DestinationPath ./ + $version = Get-Content -Path ./version.txt + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./version.zip + Remove-Item -Path ./version.txt - name: Check Directory run: | Get-ChildItem "./" From 982aea5b7fa02c7e06c4124cb38695b63e8bd257 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 15:25:58 -0600 Subject: [PATCH 049/117] Moved script line --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4ec14b1..2e8d4f0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -109,7 +109,6 @@ jobs: shell: powershell run: | Get-ChildItem "./" - # Expand-Archive -Path version.zip -DestinationPath ./ $version = Get-Content -Path ./version.txt Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./version.zip @@ -133,3 +132,4 @@ jobs: # name: Build # - name: Check Directory # run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} + # Expand-Archive -Path version.zip -DestinationPath ./ From d2012b1535ea4eebc63d4919f8280f096b82c1f2 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 15:28:02 -0600 Subject: [PATCH 050/117] Syntax issue? --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2e8d4f0..7b1d6d8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -108,7 +108,7 @@ jobs: - name: Set Version Number shell: powershell run: | - Get-ChildItem "./" + Get-ChildItem "./" $version = Get-Content -Path ./version.txt Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./version.zip From d6826bfd839ff450b0c4fea03a022d8e87d530ae Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 15:55:45 -0600 Subject: [PATCH 051/117] unzips to root directory --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b1d6d8..aa8a886 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -102,13 +102,14 @@ jobs: uses: actions/download-artifact@v1 with: name: Version - path: ./version.txt + path: ./ - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number shell: powershell run: | Get-ChildItem "./" + Expand-Archive -Path version.zip -DestinationPath ./ $version = Get-Content -Path ./version.txt Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./version.zip @@ -132,4 +133,3 @@ jobs: # name: Build # - name: Check Directory # run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} - # Expand-Archive -Path version.zip -DestinationPath ./ From 91e52db5c92c8917effa0beb610ebe03922d510a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 16:04:55 -0600 Subject: [PATCH 052/117] removes unzip step --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index aa8a886..85652b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -109,7 +109,6 @@ jobs: shell: powershell run: | Get-ChildItem "./" - Expand-Archive -Path version.zip -DestinationPath ./ $version = Get-Content -Path ./version.txt Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./version.zip From ec71e80c536f1bf6af0c9e8501b0eee6124ccfa1 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 16:09:34 -0600 Subject: [PATCH 053/117] Removes path property from Download Version info step --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 85652b2..a3fcc3f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -98,11 +98,10 @@ jobs: with: name: Build path: ./build.zip - - name: Download Version info + - name: Download Version Info uses: actions/download-artifact@v1 with: name: Version - path: ./ - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number From 11d7b76592741acb43777a150c4049eef01365d7 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 16:13:19 -0600 Subject: [PATCH 054/117] Removes reference to version.zip --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a3fcc3f..6df95e4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -110,7 +110,6 @@ jobs: Get-ChildItem "./" $version = Get-Content -Path ./version.txt Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./version.zip Remove-Item -Path ./version.txt - name: Check Directory run: | From 7c80fc2ae5bf1adda51f2be52958b39de325092f Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 16:18:15 -0600 Subject: [PATCH 055/117] Added folder name to affected paths --- .github/workflows/docker.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6df95e4..8770fb6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -107,10 +107,10 @@ jobs: - name: Set Version Number shell: powershell run: | - Get-ChildItem "./" - $version = Get-Content -Path ./version.txt + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./version.txt + Remove-Item -Path ./Version/version.txt - name: Check Directory run: | Get-ChildItem "./" @@ -124,9 +124,24 @@ jobs: # token: ${{ secrets.BUILDS_TOKEN }} # path: ./internal_builds_repo # repository: PepperDash-Engineering/pepperdash-core-builds - # - name: Download Artifact - # uses: actions/download-artifact@v1 - # with: - # name: Build - # - name: Check Directory - # run: Get-ChildItem ${{env.GITHUB_WORKSPACE}} + # - name: Download Build output + # uses: actions/download-artifact@v1 + # with: + # name: Build + # path: ./build.zip + # - name: Download Version Info + # uses: actions/download-artifact@v1 + # with: + # name: Version + # - name: Check Directory + # run: Get-ChildItem "./" + # - name: Set Version Number + # shell: powershell + # run: | + # Get-ChildItem "./" + # $version = Get-Content -Path ./version.txt + # Write-Output "::set-env name=VERSION::$version" + # Remove-Item -Path ./version.txt + # - name: Check Directory + # run: | + # Get-ChildItem "./" From 62d80e8fe35341ac7ee21418a4bfe5559c424ef6 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 17:02:50 -0600 Subject: [PATCH 056/117] Write out the version and remove the folder --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8770fb6..ea7681d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -109,8 +109,10 @@ jobs: run: | Get-ChildItem "./Version" $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./Version/version.txt + Remove-Item -Path /Version - name: Check Directory run: | Get-ChildItem "./" From 67e1507f079096221b6e58811b8bc7e312396081 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 17:11:55 -0600 Subject: [PATCH 057/117] adds path previx to Version folder --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ea7681d..00f75d0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -112,7 +112,7 @@ jobs: Write-Host "Version: $version" Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./Version/version.txt - Remove-Item -Path /Version + Remove-Item -Path ./Version - name: Check Directory run: | Get-ChildItem "./" From 72fb11b79045fd0d8f7350f52bf26ca205f4ad88 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:11:23 -0600 Subject: [PATCH 058/117] adds copying build output and pushing to builds repo --- .github/workflows/docker.yml | 66 +++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 00f75d0..18e0d15 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -97,7 +97,6 @@ jobs: uses: actions/download-artifact@v1 with: name: Build - path: ./build.zip - name: Download Version Info uses: actions/download-artifact@v1 with: @@ -107,12 +106,25 @@ jobs: - name: Set Version Number shell: powershell run: | - Get-ChildItem "./Version" - $version = Get-Content -Path ./Version/version.txt - Write-Host "Version: $version" - Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./Version/version.txt - Remove-Item -Path ./Version + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + - name: Copy build output and push + run: | + $branch = $(${{ env.GITHUB_REF }}) -Replace "refs/heads/"; + git checkout -b $branch + Get-ChildItem -Path "./Build" | Copy-Item -Path ./ + Remove-Item -Path ./Build -Recurse + git add . + git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" + git tag ${{ env.VERSION }} + git push --set-upstream origin +$branch --force + git push --tags origin + + # "Build #${SOURCE_BUILD_NUMBER} from commit: https://github.com/PepperDash/PepperDashCore/commit/${COMMIT}" - name: Check Directory run: | Get-ChildItem "./" @@ -127,23 +139,23 @@ jobs: # path: ./internal_builds_repo # repository: PepperDash-Engineering/pepperdash-core-builds # - name: Download Build output - # uses: actions/download-artifact@v1 - # with: - # name: Build - # path: ./build.zip - # - name: Download Version Info - # uses: actions/download-artifact@v1 - # with: - # name: Version - # - name: Check Directory - # run: Get-ChildItem "./" - # - name: Set Version Number - # shell: powershell - # run: | - # Get-ChildItem "./" - # $version = Get-Content -Path ./version.txt - # Write-Output "::set-env name=VERSION::$version" - # Remove-Item -Path ./version.txt - # - name: Check Directory - # run: | - # Get-ChildItem "./" + # uses: actions/download-artifact@v1 + # with: + # name: Build + # path: ./build.zip + # - name: Download Version Info + # uses: actions/download-artifact@v1 + # with: + # name: Version + # - name: Check Directory + # run: Get-ChildItem "./" + # - name: Set Version Number + # shell: powershell + # run: | + # Get-ChildItem "./" + # $version = Get-Content -Path ./version.txt + # Write-Output "::set-env name=VERSION::$version" + # Remove-Item -Path ./version.txt + # - name: Check Directory + # run: | + # Get-ChildItem "./" From d9e243c30d4c9f3212c5a6e347d544c2f36017ba Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:20:51 -0600 Subject: [PATCH 059/117] adds $() for branch name and fixes env for getting ref --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 18e0d15..d5a50ed 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -115,7 +115,7 @@ jobs: - name: Copy build output and push run: | $branch = $(${{ env.GITHUB_REF }}) -Replace "refs/heads/"; - git checkout -b $branch + git checkout -b $($branch) Get-ChildItem -Path "./Build" | Copy-Item -Path ./ Remove-Item -Path ./Build -Recurse git add . From 8474c5c7b7075cee45693c87aefa45a9b637a2d5 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:29:23 -0600 Subject: [PATCH 060/117] Removes variable for branch name --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d5a50ed..e442a45 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -114,8 +114,7 @@ jobs: Remove-Item -Path ./Version - name: Copy build output and push run: | - $branch = $(${{ env.GITHUB_REF }}) -Replace "refs/heads/"; - git checkout -b $($branch) + git checkout -b $($Env:GITHUB_REF -Replace "refs/heads/") Get-ChildItem -Path "./Build" | Copy-Item -Path ./ Remove-Item -Path ./Build -Recurse git add . From 8f40629e651608534ea06109028e723e98f92c36 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:39:59 -0600 Subject: [PATCH 061/117] fixes pushing branch to origin --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e442a45..7732cce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -120,7 +120,7 @@ jobs: git add . git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" git tag ${{ env.VERSION }} - git push --set-upstream origin +$branch --force + git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force git push --tags origin # "Build #${SOURCE_BUILD_NUMBER} from commit: https://github.com/PepperDash/PepperDashCore/commit/${COMMIT}" From 4cfd51f76ef2d05238b20a3b46d831dc75b69935 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:48:34 -0600 Subject: [PATCH 062/117] adds -Recurse for copying from Build directory --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7732cce..258a356 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -115,7 +115,7 @@ jobs: - name: Copy build output and push run: | git checkout -b $($Env:GITHUB_REF -Replace "refs/heads/") - Get-ChildItem -Path "./Build" | Copy-Item -Path ./ + Get-ChildItem -Path "./Build" -Recurse | Copy-Item -Path ./ Remove-Item -Path ./Build -Recurse git add . git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" From 2632dccbec467499693ca39608d30679d82e8f8e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 17 Mar 2020 18:58:51 -0600 Subject: [PATCH 063/117] switches up the order of some operations --- .github/workflows/docker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 258a356..a6fb477 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -93,10 +93,6 @@ jobs: with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds - - name: Download Build output - uses: actions/download-artifact@v1 - with: - name: Build - name: Download Version Info uses: actions/download-artifact@v1 with: @@ -112,11 +108,15 @@ jobs: Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./Version/version.txt Remove-Item -Path ./Version + - name: Create new branch + run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ - name: Copy build output and push run: | - git checkout -b $($Env:GITHUB_REF -Replace "refs/heads/") - Get-ChildItem -Path "./Build" -Recurse | Copy-Item -Path ./ - Remove-Item -Path ./Build -Recurse git add . git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" git tag ${{ env.VERSION }} From b75f3be62daa94f8d989cec395bcb69a082572cc Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 21:04:36 -0600 Subject: [PATCH 064/117] Additions to internal_push_output --- .github/workflows/docker.yml | 59 ++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 00f75d0..f88429f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,6 +5,9 @@ on: branches: - feature/* - hotfix/* + - release/* + - master + - development env: # solution path doesn't need slashes unless there it is multiple folders deep @@ -54,7 +57,8 @@ jobs: 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version - run: Write-Output $($Env:VERSION) | Out-File -FilePath ".\output\version.txt" + run: + Write-Output "VERSION = $($Env:VERSION), BRANCH = $($Env:GITHUB_REF)" | Out-File -FilePath ".\properties.txt" - name: Upload Build Output uses: actions/upload-artifact@v1 with: @@ -63,8 +67,8 @@ jobs: - name: Upload Version.txt uses: actions/upload-artifact@v1 with: - name: Version - path: ./output/version.txt + name: Properties + path: ./output/properties.txt # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -88,34 +92,51 @@ jobs: needs: build_project runs-on: windows-latest steps: - - name: Checkout Internal Builds Repo - uses: actions/checkout@v2 - with: - token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/pepperdash-core-builds - - name: Download Build output + - name: Download Build Propeties uses: actions/download-artifact@v1 with: - name: Build - path: ./build.zip - - name: Download Version Info - uses: actions/download-artifact@v1 - with: - name: Version + name: Properties - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number shell: powershell run: | - Get-ChildItem "./Version" - $version = Get-Content -Path ./Version/version.txt + Get-ChildItem "./Properties" + Write-Host "Workflow Commit: ${{ env.GITHUB_SHA}}" + Write-Host "Workflow Branch: ${{ env.GITHUB_REF}}" + $properties = Get-Content -Path ./properties.txt + Write-Host $properties + $properties -match "VERSION = (?.*),.*BRANCH = (?.*)" + $version = $matches['version'] + $branch = $matches['build'] Write-Host "Version: $version" + Write-Host "Branch: $branch" Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./Version/version.txt - Remove-Item -Path ./Version + Write-Output "::set-env name=BRANCH::$branch" + Remove-Item -Path ./Properties/Properties.txt + Remove-Item -Path ./Properties - name: Check Directory run: | Get-ChildItem "./" + - name: Checkout Internal Builds Repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILDS_TOKEN }} + repository: PepperDash-Engineering/pepperdash-core-builds + ref: ${{ env.BRANCH }} + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./build.zip + - name: + shell: powershell + run: | + git add . + git commit -m "Build # ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/PepperDash/PepperDashCore/commit/${{ env.GITHUB_SHA }}" + git tag ${{ env.VERSION }} --dry-run + git push --set-upstream origin +${{ env.GITHUB_REF#*/}} --force --dry-run + git push tags origin --dry-run # public_push_output: # needs: build_project # runs-on: windows-latest From 779de596ebf86d3b3975c1c0eae5629ac2790b0c Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 21:13:59 -0600 Subject: [PATCH 065/117] Adds credentials --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d3260ef..f0799fe 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -121,6 +121,8 @@ jobs: path: ./ - name: Copy build output and push run: | + git config user.email "actions@pepperdash.com" + git config user.name "GitHub Actions" git add . git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" git tag ${{ env.VERSION }} From a4f2d7d8c23a5ea53d85a9dfa34f1c0f819fb792 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 21:16:16 -0600 Subject: [PATCH 066/117] Comments out unecessary stuff --- .github/workflows/docker.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f0799fe..9a3d42f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -139,19 +139,19 @@ jobs: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ env.BRANCH }} - - name: Download Build output - uses: actions/download-artifact@v1 - with: - name: Build - path: ./build.zip - - name: - shell: powershell - run: | - git add . - git commit -m "Build # ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/PepperDash/PepperDashCore/commit/${{ env.GITHUB_SHA }}" - git tag ${{ env.VERSION }} --dry-run - git push --set-upstream origin +${{ env.GITHUB_REF#*/}} --force --dry-run - git push tags origin --dry-run + # - name: Download Build output + # uses: actions/download-artifact@v1 + # with: + # name: Build + # path: ./build.zip + # - name: + # shell: powershell + # run: | + # git add . + # git commit -m "Build # ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/PepperDash/PepperDashCore/commit/${{ env.GITHUB_SHA }}" + # git tag ${{ env.VERSION }} --dry-run + # git push --set-upstream origin +${{ env.GITHUB_REF#*/}} --force --dry-run + # git push tags origin --dry-run # public_push_output: # needs: build_project # runs-on: windows-latest From bffe60147a49305f30505c9eb1dca61cfea6116e Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 21:24:12 -0600 Subject: [PATCH 067/117] Fixes version.txt generation --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9a3d42f..9cefdf5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,7 +58,7 @@ jobs: ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version run: - Write-Output "VERSION = $($Env:VERSION), BRANCH = $($Env:GITHUB_REF)" | Out-File -FilePath ".\version.txt" + Write-Output "VERSION = $($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" - name: Upload Build Output uses: actions/upload-artifact@v1 with: From 3a2e10183fef0f8a90d85a600f53d6b7d041300f Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Mar 2020 22:09:22 -0600 Subject: [PATCH 068/117] Testing comm params --- .github/workflows/docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9cefdf5..ab5df24 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -124,7 +124,9 @@ jobs: git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . - git commit -m "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" + $commit = "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" + Write-Host $commit + git commit -m $commit git tag ${{ env.VERSION }} git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force git push --tags origin From a6fa9df647a5267ba70b344f7a9867625a5e67dd Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 10:02:45 -0600 Subject: [PATCH 069/117] Moving back to putting all necessary properties in the file --- .github/workflows/docker.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9cefdf5..c32c9a1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,17 +58,17 @@ jobs: ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version run: - Write-Output "VERSION = $($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" + Write-Output "VERSION = $($Env:VERSION)" | Out-File -FilePath ".\output\properties.txt" - name: Upload Build Output uses: actions/upload-artifact@v1 with: name: Build path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip - - name: Upload Version.txt + - name: Upload properties.txt uses: actions/upload-artifact@v1 with: name: Version - path: ./output/version.txt + path: ./output/properties.txt # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -97,21 +97,21 @@ jobs: with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds - - name: Download Version Info + - name: Download Build Property Info uses: actions/download-artifact@v1 with: - name: Version + name: Properties - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number shell: powershell run: | - Get-ChildItem "./Version" - $version = Get-Content -Path ./Version/version.txt + Get-ChildItem "./Properties" + $version = Get-Content -Path ./Version/properties.txt Write-Host "Version: $version" Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./Version/version.txt - Remove-Item -Path ./Version + Remove-Item -Path ./Properties/properties.txt + Remove-Item -Path ./Properties - name: Create new branch run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") - name: Download Build output @@ -177,9 +177,9 @@ jobs: # shell: powershell # run: | # Get-ChildItem "./" - # $version = Get-Content -Path ./version.txt + # $version = Get-Content -Path ./properties.txt # Write-Output "::set-env name=VERSION::$version" - # Remove-Item -Path ./version.txt + # Remove-Item -Path ./properties.txt # - name: Check Directory # run: | # Get-ChildItem "./" From a49f57208e03ff9fe4abdf294a28ba3e985ec125 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 13:24:08 -0600 Subject: [PATCH 070/117] Updates to correct subsitution syntax --- .github/workflows/docker.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6f354b1..e55027f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,17 +58,17 @@ jobs: ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version run: - Write-Output "VERSION = $($Env:VERSION)" | Out-File -FilePath ".\output\properties.txt" + Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" - name: Upload Build Output uses: actions/upload-artifact@v1 with: name: Build path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip - - name: Upload properties.txt + - name: Upload version.txt uses: actions/upload-artifact@v1 with: name: Version - path: ./output/properties.txt + path: ./output/version.txt # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -97,21 +97,22 @@ jobs: with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds + ref: $(Env:GITHUB_REF) - name: Download Build Property Info uses: actions/download-artifact@v1 with: - name: Properties + name: Version - name: Check Directory run: Get-ChildItem "./" - name: Set Version Number shell: powershell run: | Get-ChildItem "./Properties" - $version = Get-Content -Path ./Version/properties.txt + $version = Get-Content -Path ./Version/version.txt Write-Host "Version: $version" Write-Output "::set-env name=VERSION::$version" - Remove-Item -Path ./Properties/properties.txt - Remove-Item -Path ./Properties + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version - name: Create new branch run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") - name: Download Build output @@ -124,23 +125,21 @@ jobs: git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . - $commit = "Build ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}" + $commit = "Build $(Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$(Env:GITHUB_REPOSITORY)/commit/$(Env:GITHUB_SHA)" Write-Host $commit git commit -m $commit - git tag ${{ env.VERSION }} + git tag ${{ env:VERSION }} git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force git push --tags origin - - # "Build #${SOURCE_BUILD_NUMBER} from commit: https://github.com/PepperDash/PepperDashCore/commit/${COMMIT}" - name: Check Directory run: | Get-ChildItem "./" - - name: Checkout Internal Builds Repo - uses: actions/checkout@v2 - with: - token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/pepperdash-core-builds - ref: ${{ env.BRANCH }} + # - name: Checkout Internal Builds Repo + # uses: actions/checkout@v2 + # with: + # token: ${{ secrets.BUILDS_TOKEN }} + # repository: PepperDash-Engineering/pepperdash-core-builds + # ref: $(Env:GITHUB_REF) # - name: Download Build output # uses: actions/download-artifact@v1 # with: From 66103c57b25cb5ac43f0ef2b2833acc4fef4a33a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 13:26:53 -0600 Subject: [PATCH 071/117] Fixes Version substitution syntax --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e55027f..7408250 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -128,7 +128,7 @@ jobs: $commit = "Build $(Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$(Env:GITHUB_REPOSITORY)/commit/$(Env:GITHUB_SHA)" Write-Host $commit git commit -m $commit - git tag ${{ env:VERSION }} + git tag $($Env:VERSION) git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force git push --tags origin - name: Check Directory From c8116fcb6f8442e374e86dda05cec4a108aa2bff Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 13:48:20 -0600 Subject: [PATCH 072/117] Trying alternative format for ref --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7408250..4be3dae 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -97,7 +97,7 @@ jobs: with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds - ref: $(Env:GITHUB_REF) + ref: ${{ Env:GITHUB_REF }} - name: Download Build Property Info uses: actions/download-artifact@v1 with: From 4eb81b41786932a51b485e2f3bfe81d9a0e92221 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 13:50:00 -0600 Subject: [PATCH 073/117] Swapped colon for dot --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4be3dae..a853ce3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -97,7 +97,7 @@ jobs: with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds - ref: ${{ Env:GITHUB_REF }} + ref: ${{ Env.GITHUB_REF }} - name: Download Build Property Info uses: actions/download-artifact@v1 with: From de390f3f3c441c42a52b3e9a13697aa671f29bc3 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 13:58:10 -0600 Subject: [PATCH 074/117] Fixes old refernce to Properties folder --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a853ce3..5b5b01e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -107,7 +107,7 @@ jobs: - name: Set Version Number shell: powershell run: | - Get-ChildItem "./Properties" + Get-ChildItem "./Version" $version = Get-Content -Path ./Version/version.txt Write-Host "Version: $version" Write-Output "::set-env name=VERSION::$version" From 57fef5d0c79bf5dd964204d6c083dee6d79781a4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 14:07:42 -0600 Subject: [PATCH 075/117] trying again... --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5b5b01e..42ad4cb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -98,7 +98,7 @@ jobs: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ Env.GITHUB_REF }} - - name: Download Build Property Info + - name: Download Build Version Info uses: actions/download-artifact@v1 with: name: Version @@ -121,6 +121,7 @@ jobs: name: Build path: ./ - name: Copy build output and push + shell: powershell run: | git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" From d525ab8dfa35fc556d54ba03f9be3f903f8364a0 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 14:25:18 -0600 Subject: [PATCH 076/117] Adds missing $s --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 42ad4cb..f2d9ae0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -126,7 +126,7 @@ jobs: git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . - $commit = "Build $(Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$(Env:GITHUB_REPOSITORY)/commit/$(Env:GITHUB_SHA)" + $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)" Write-Host $commit git commit -m $commit git tag $($Env:VERSION) From eb5e77c9a02dc11422d4e27dd2492a7911864394 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 14:39:10 -0600 Subject: [PATCH 077/117] Attempting to fix branch replacement --- .github/workflows/docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f2d9ae0..3f08439 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,7 +130,9 @@ jobs: Write-Host $commit git commit -m $commit git tag $($Env:VERSION) - git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force + $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" + Write-Host $branch + git push --set-upstream origin $branch --force git push --tags origin - name: Check Directory run: | From a607781e1b3c9ebc23523042b665379af560cf97 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 14:51:54 -0600 Subject: [PATCH 078/117] added parentheses around the env variable for the branch name --- .github/workflows/docker.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3f08439..1840dd2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,8 +57,7 @@ jobs: 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version - run: - Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" + run: Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" - name: Upload Build Output uses: actions/upload-artifact@v1 with: @@ -132,7 +131,7 @@ jobs: git tag $($Env:VERSION) $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" Write-Host $branch - git push --set-upstream origin $branch --force + git push --set-upstream origin $($branch) --force git push --tags origin - name: Check Directory run: | @@ -148,7 +147,7 @@ jobs: # with: # name: Build # path: ./build.zip - # - name: + # - name: # shell: powershell # run: | # git add . From f42854a8b76a7f170fb145fe248218f2b73dd17a Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 15:09:47 -0600 Subject: [PATCH 079/117] removed push statements and added unzip step --- .github/workflows/docker.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1840dd2..a8074a1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -119,6 +119,12 @@ jobs: with: name: Build path: ./ + - name: Unzip Build file + run: | + Get-ChildItem ./ + Get-ChildItem -Path ./ -include @("*.zip") | Expand-Archive -DestinationPath ./ + Remove-Item -Path ./ -include @("*.zip") + Get-ChildItem ./ - name: Copy build output and push shell: powershell run: | @@ -130,9 +136,9 @@ jobs: git commit -m $commit git tag $($Env:VERSION) $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" - Write-Host $branch - git push --set-upstream origin $($branch) --force - git push --tags origin + Write-Output $branch + # git push --set-upstream origin $($branch) --force + # git push --tags origin - name: Check Directory run: | Get-ChildItem "./" From e0d1b791a05e2d6771f45ad67111e7bb57a51856 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 15:19:35 -0600 Subject: [PATCH 080/117] added a couple of check steps and the push back in --- .github/workflows/docker.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a8074a1..9fd18e2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -119,12 +119,14 @@ jobs: with: name: Build path: ./ + - name: Check directory + run: Get-ChildItem ./ - name: Unzip Build file run: | - Get-ChildItem ./ Get-ChildItem -Path ./ -include @("*.zip") | Expand-Archive -DestinationPath ./ Remove-Item -Path ./ -include @("*.zip") - Get-ChildItem ./ + - name: Check directory again + run: Get-ChildItem ./ - name: Copy build output and push shell: powershell run: | @@ -137,8 +139,8 @@ jobs: git tag $($Env:VERSION) $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" Write-Output $branch - # git push --set-upstream origin $($branch) --force - # git push --tags origin + git push --set-upstream origin $branch --force + git push --tags origin - name: Check Directory run: | Get-ChildItem "./" From e31e804a9bf5e5874cc8ec27ab8aafffe74d75d4 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 15:32:49 -0600 Subject: [PATCH 081/117] added some quotes in some places --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9fd18e2..ee93816 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -123,8 +123,8 @@ jobs: run: Get-ChildItem ./ - name: Unzip Build file run: | - Get-ChildItem -Path ./ -include @("*.zip") | Expand-Archive -DestinationPath ./ - Remove-Item -Path ./ -include @("*.zip") + Get-ChildItem -Path "./" -include @("*.zip") | Expand-Archive -DestinationPath ./ + Remove-Item -Path "./" -include @("*.zip") - name: Check directory again run: Get-ChildItem ./ - name: Copy build output and push @@ -139,7 +139,7 @@ jobs: git tag $($Env:VERSION) $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" Write-Output $branch - git push --set-upstream origin $branch --force + git push --set-upstream origin "$($branch)" --force git push --tags origin - name: Check Directory run: | From 1570e32fd9fc9ddfcdb5280154a9307863211a7e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 15:45:02 -0600 Subject: [PATCH 082/117] back to trying things... --- .github/workflows/docker.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ee93816..bc1bb92 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -123,8 +123,8 @@ jobs: run: Get-ChildItem ./ - name: Unzip Build file run: | - Get-ChildItem -Path "./" -include @("*.zip") | Expand-Archive -DestinationPath ./ - Remove-Item -Path "./" -include @("*.zip") + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\ -include @("*.zip") - name: Check directory again run: Get-ChildItem ./ - name: Copy build output and push @@ -137,9 +137,7 @@ jobs: Write-Host $commit git commit -m $commit git tag $($Env:VERSION) - $branch = $($Env:GITHUB_REF) -Replace "refs/heads/" - Write-Output $branch - git push --set-upstream origin "$($branch)" --force + git push --set-upstream origin $($($Env:GITHUB_REF) -Replace "refs/heads/") --force git push --tags origin - name: Check Directory run: | From adc693fbab3dc6f6738f26bfd6a45f0afbedffd1 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 16:06:38 -0600 Subject: [PATCH 083/117] removed a set of $() --- .github/workflows/docker.yml | 5 ++-- aklfjdskal | 46 ------------------------------------ 2 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 aklfjdskal diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bc1bb92..61c3ce7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -124,12 +124,13 @@ jobs: - name: Unzip Build file run: | Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ - Remove-Item -Path .\ -include @("*.zip") + Remove-Item -Path .\*.zip - name: Check directory again run: Get-ChildItem ./ - name: Copy build output and push shell: powershell run: | + git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . @@ -137,7 +138,7 @@ jobs: Write-Host $commit git commit -m $commit git tag $($Env:VERSION) - git push --set-upstream origin $($($Env:GITHUB_REF) -Replace "refs/heads/") --force + git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force git push --tags origin - name: Check Directory run: | diff --git a/aklfjdskal b/aklfjdskal deleted file mode 100644 index 3e37075..0000000 --- a/aklfjdskal +++ /dev/null @@ -1,46 +0,0 @@ -0.0.0001 -0.0.10_DoNotUse_BadBuild -0.0.11 -0.0.12 -0.0.13 -0.0.14 -0.0.15 -0.0.16 -0.0.17 -0.0.19 -0.0.2 -0.0.20 -0.0.21 -0.0.25 -0.0.29 -0.0.3 -0.0.30 -0.0.5 -0.0.6 -0.0.7 -0.0.8 -0.0.9 -1.0.18 -1.0.22 -1.0.23 -1.0.24 -1.0.25 -1.0.26 -1.0.27 -1.0.28 -1.0.29 -1.0.30 -1.0.31 -1.0.32 -1.0.33 -1.0.34 -1.0.35 -1.0.36-alpha-157 -1.0.36-alpha-159 -1.0.36-alpha-160 -release -v1.0.11.x -v1.0.13 -v1.0.14.27867 -v1.0.15.26179 -v1.0.16.20061 From 3eb7b01f94e4785723abe2c4e3e96c696c91fae4 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 16:18:20 -0600 Subject: [PATCH 084/117] changed git checkout -b to git checkout -B --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 61c3ce7..c0e22fa 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,7 +130,7 @@ jobs: - name: Copy build output and push shell: powershell run: | - git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + git checkout -B $($Env:GITHUB_REF -replace "refs/heads/") git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . From c23c4554af5af1addf7501b36df7020b129133ce Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 16:30:48 -0600 Subject: [PATCH 085/117] removed branch name from push command --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c0e22fa..f6eb5d8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -138,7 +138,7 @@ jobs: Write-Host $commit git commit -m $commit git tag $($Env:VERSION) - git push --set-upstream origin $($Env:GITHUB_REF -Replace "refs/heads/") --force + git push -u origin --force git push --tags origin - name: Check Directory run: | From 630c1d5a7f351b5943e6432eec87d8e9878cecb7 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 16:53:27 -0600 Subject: [PATCH 086/117] changing up git commands --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f6eb5d8..ad981ba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -130,7 +130,7 @@ jobs: - name: Copy build output and push shell: powershell run: | - git checkout -B $($Env:GITHUB_REF -replace "refs/heads/") + git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . @@ -138,7 +138,7 @@ jobs: Write-Host $commit git commit -m $commit git tag $($Env:VERSION) - git push -u origin --force + git push -u origin $($Env:GITHUB_REF -replace "refs/heads/") --force git push --tags origin - name: Check Directory run: | From 046dff89605b503b83fd12c83b275e26d0747433 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 17:07:02 -0600 Subject: [PATCH 087/117] Adds some addtitional debug statements to track progress --- .github/workflows/docker.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ad981ba..7787873 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -135,10 +135,12 @@ jobs: git config user.name "GitHub Actions" git add . $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)" - Write-Host $commit + Write-Host "Commit: $commit" git commit -m $commit git tag $($Env:VERSION) - git push -u origin $($Env:GITHUB_REF -replace "refs/heads/") --force + $branch = $($Env:GITHUB_REF) -replace "refs/heads/" + Write-Host "Branch: $branch" + git push -u origin $branch --force git push --tags origin - name: Check Directory run: | From 4d4362c07397d2ac6816cce75ea79ed2653f2bb6 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 17:16:28 -0600 Subject: [PATCH 088/117] Moves push to separate action --- .github/workflows/docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7787873..37f0da7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -138,9 +138,13 @@ jobs: Write-Host "Commit: $commit" git commit -m $commit git tag $($Env:VERSION) + + - name: Push to Builds Repo + shell: powershell + run: | $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" - git push -u origin $branch --force + git push -u origin $($branch) --force git push --tags origin - name: Check Directory run: | From 206c388e8dd3dffbf79ef73424d41d713d43d8c8 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 17:30:39 -0600 Subject: [PATCH 089/117] Comments out git push --tags line --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 37f0da7..71b0403 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -138,14 +138,13 @@ jobs: Write-Host "Commit: $commit" git commit -m $commit git tag $($Env:VERSION) - - name: Push to Builds Repo shell: powershell run: | $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" git push -u origin $($branch) --force - git push --tags origin + #git push --tags origin - name: Check Directory run: | Get-ChildItem "./" From 82418946e1feb693d686c8bc54365fced2534655 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 18 Mar 2020 17:50:44 -0600 Subject: [PATCH 090/117] Adds git tags command back and updates ZipBuildOutput to include .dll --- .github/scripts/ZipBuildOutput.ps1 | 4 +++- .github/workflows/docker.yml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 485d0ab..a45cfc6 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,7 +2,7 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz") | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { $allowed = $true; foreach ($exclude in $exclusions) { if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { @@ -17,6 +17,8 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c } | Copy-Item -Destination ($destination) Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { $filenames = @($_ -replace "cpz|clz|cplz", "dll", $_ -replace "cpz|clz|cplz", "xml") + Write-Host "Filenames:" + Write-Host $filenames if ($filenames.length -gt 0) { Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) } diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 71b0403..8b7044e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,7 +38,6 @@ jobs: Write-Host "Setting build type to Release" Write-Output "::set-env name=BUILD_TYPE::Release" } - - name: Fetch tags run: git fetch --tags - name: Set Version Number @@ -144,7 +143,7 @@ jobs: $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" git push -u origin $($branch) --force - #git push --tags origin + git push --tags origin - name: Check Directory run: | Get-ChildItem "./" From 8fd40c2a7cd8cdc94257126aaf1f4454b0ca2243 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 18 Mar 2020 18:07:44 -0600 Subject: [PATCH 091/117] Moves pushing tags to its own step --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8b7044e..22b6281 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -143,7 +143,8 @@ jobs: $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" git push -u origin $($branch) --force - git push --tags origin + - name: Push tags + run: git push --tags origin - name: Check Directory run: | Get-ChildItem "./" From 0469afd2c54de556c1d2321ea7ee0600b61e06e4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 09:33:01 -0600 Subject: [PATCH 092/117] Adds .xml to zip script inclusions. Adds public bulid repo push job --- .github/scripts/ZipBuildOutput.ps1 | 2 +- .github/workflows/docker.yml | 153 ++++++++++++++++------------- 2 files changed, 84 insertions(+), 71 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index a45cfc6..d287787 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,7 +2,7 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", ".xml", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { $allowed = $true; foreach ($exclude in $exclusions) { if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 22b6281..98966a2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -67,26 +67,89 @@ jobs: with: name: Version path: ./output/version.txt - # - name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # with: - # tag_name: v${{ env.VERSION }} - # release_name: v${{ env.VERSION }} - # prerelease: ${{contains('debug', env.BUILD_TYPE)}} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload - # id: upload_release - # uses: actions/upload-release-asset@v1 - # with: - # upload_url: ${{ steps.create_release.outputs.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 }} - internal_push_output: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: v${{ env.VERSION }} + release_name: v${{ env.VERSION }} + prerelease: ${{contains('debug', env.BUILD_TYPE)}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload + id: upload_release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.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 }} + Internal_Push_Output: + needs: build_project + runs-on: windows-latest + if: contains(github.ref, 'master') || contains(github.ref, 'release') + steps: + - name: Checkout Public Builds Repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILDS_TOKEN }} + repository: PepperDash/PepperDashCore-Builds + ref: ${{ Env.GITHUB_REF }} + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Check Directory + run: Get-ChildItem "./" + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + - name: Create new branch + run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Check directory + run: Get-ChildItem ./ + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Check directory again + run: Get-ChildItem ./ + - name: Copy build output and push + shell: powershell + run: | + git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + git config user.email "actions@pepperdash.com" + git config user.name "GitHub Actions" + git add . + $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)" + Write-Host "Commit: $commit" + git commit -m $commit + git tag $($Env:VERSION) + - name: Push to Builds Repo + shell: powershell + run: | + $branch = $($Env:GITHUB_REF) -replace "refs/heads/" + Write-Host "Branch: $branch" + git push -u origin $($branch) --force + - name: Push tags + run: git push --tags origin + - name: Check Directory + run: | + Get-ChildItem "./" + Public_Push_Output: needs: build_project runs-on: windows-latest steps: @@ -148,53 +211,3 @@ jobs: - name: Check Directory run: | Get-ChildItem "./" - # - name: Checkout Internal Builds Repo - # uses: actions/checkout@v2 - # with: - # token: ${{ secrets.BUILDS_TOKEN }} - # repository: PepperDash-Engineering/pepperdash-core-builds - # ref: $(Env:GITHUB_REF) - # - name: Download Build output - # uses: actions/download-artifact@v1 - # with: - # name: Build - # path: ./build.zip - # - name: - # shell: powershell - # run: | - # git add . - # git commit -m "Build # ${{ env.GITHUB_RUN_NUMBER }} from commit: https://github.com/PepperDash/PepperDashCore/commit/${{ env.GITHUB_SHA }}" - # git tag ${{ env.VERSION }} --dry-run - # git push --set-upstream origin +${{ env.GITHUB_REF#*/}} --force --dry-run - # git push tags origin --dry-run - # public_push_output: - # needs: build_project - # runs-on: windows-latest - # steps: - # - name: Checkout public Builds Repo - # uses: actions/checkout@v2 - # with: - # token: ${{ secrets.BUILDS_TOKEN }} - # path: ./internal_builds_repo - # repository: PepperDash-Engineering/pepperdash-core-builds - # - name: Download Build output - # uses: actions/download-artifact@v1 - # with: - # name: Build - # path: ./build.zip - # - name: Download Version Info - # uses: actions/download-artifact@v1 - # with: - # name: Version - # - name: Check Directory - # run: Get-ChildItem "./" - # - name: Set Version Number - # shell: powershell - # run: | - # Get-ChildItem "./" - # $version = Get-Content -Path ./properties.txt - # Write-Output "::set-env name=VERSION::$version" - # Remove-Item -Path ./properties.txt - # - name: Check Directory - # run: | - # Get-ChildItem "./" From 2854b022296f959e4a7906534cb752011e0b22df Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 09:34:33 -0600 Subject: [PATCH 093/117] Fixes syntax issue --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 98966a2..fa8652c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -147,8 +147,8 @@ jobs: - name: Push tags run: git push --tags origin - name: Check Directory - run: | - Get-ChildItem "./" + run: Get-ChildItem ./ + Public_Push_Output: needs: build_project runs-on: windows-latest @@ -209,5 +209,5 @@ jobs: - name: Push tags run: git push --tags origin - name: Check Directory - run: | - Get-ChildItem "./" + run: Get-ChildItem ./ + From 945cf3182ae7f338a4df920bce90740d42d58647 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 09:35:35 -0600 Subject: [PATCH 094/117] Syntax issue --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fa8652c..ab7f6fc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -148,8 +148,7 @@ jobs: run: git push --tags origin - name: Check Directory run: Get-ChildItem ./ - - Public_Push_Output: + Public_Push_Output: needs: build_project runs-on: windows-latest steps: From 741e6070c89032057136f105eead444f7b1c818b Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 09:52:19 -0600 Subject: [PATCH 095/117] Moves conditional to correct public push job --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ab7f6fc..0e14300 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,7 +18,7 @@ env: BUILD_TYPE: Debug RELEASE_BRANCH: master jobs: - build_project: + Build_Project: runs-on: windows-latest steps: - name: Checkout repo @@ -87,9 +87,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Internal_Push_Output: - needs: build_project + needs: Build_Project runs-on: windows-latest - if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: - name: Checkout Public Builds Repo uses: actions/checkout@v2 @@ -149,8 +148,9 @@ jobs: - name: Check Directory run: Get-ChildItem ./ Public_Push_Output: - needs: build_project + needs: Build_Project runs-on: windows-latest + if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: - name: Checkout Internal Builds Repo uses: actions/checkout@v2 From 565772933f11163df6a3acc7c12138f33748aca4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 09:53:24 -0600 Subject: [PATCH 096/117] adds wildcard for .xml --- .github/scripts/ZipBuildOutput.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index d287787..ca10a8f 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,7 +2,7 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", ".xml", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "*.xml", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { $allowed = $true; foreach ($exclude in $exclusions) { if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { From 15fabec7b93bd5e55338815da13a83fdac16f8b9 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 10:14:57 -0600 Subject: [PATCH 097/117] Attempt to get assembly .dll in zip output --- .github/scripts/ZipBuildOutput.ps1 | 2 +- .github/workflows/docker.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index ca10a8f..06ac2ce 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -2,7 +2,7 @@ $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "*.xml", "$($Env:GITHUB_WORKSPACE).dll") | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "*.xml", "$($Env:ASSEMBLY_FILE)") | ForEach-Object { $allowed = $true; foreach ($exclude in $exclusions) { if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0e14300..e98c03b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,6 +14,7 @@ env: # solution name does not include extension. .sln is assumed SOLUTION_PATH: PepperDash Core SOLUTION_FILE: PepperDash Core + ASSEMBLY_FILE: PepperDash_Core.dll VERSION: 0.0.0-buildtype-buildnumber BUILD_TYPE: Debug RELEASE_BRANCH: master @@ -53,8 +54,10 @@ jobs: - 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" - ./.github/scripts/ZipBuildOutput.ps1 + 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + - name: Zip Build Output + shell: powershell + run: ./.github/scripts/ZipBuildOutput.ps1 - name: Write Version run: Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" - name: Upload Build Output From 138954cbb22312470f980c834817a334aaa75b2c Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 16:15:03 -0600 Subject: [PATCH 098/117] Updates ZipBuildOutput to collect all files. Adds comments to scripts --- .github/.vscode/settings.json | 7 ------- .github/scripts/ZipBuildOutput.ps1 | 26 ++++++++++++++++++++------ .github/workflows/docker.yml | 12 ++++++++++++ 3 files changed, 32 insertions(+), 13 deletions(-) delete mode 100644 .github/.vscode/settings.json diff --git a/.github/.vscode/settings.json b/.github/.vscode/settings.json deleted file mode 100644 index c4ce7a4..0000000 --- a/.github/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "workbench.colorCustomizations": { - "activityBar.background": "#19340D", - "titleBar.activeBackground": "#234912", - "titleBar.activeForeground": "#F6FCF3" - } -} \ No newline at end of file diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 06ac2ce..ee227e6 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -1,9 +1,18 @@ +# Uncomment these for local testing +# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\pepperdash-core" +# $Env:SOLUTION_FILE = "PepperDash Core" +# $Env:VERSION = "0.0.0-buildType-test" + +# Sets the root directory for the operation $destination = "$($Env:GITHUB_WORKSPACE)\output" New-Item -ItemType Directory -Force -Path ($destination) Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.cpz", "*.cplz", "*.xml", "$($Env:ASSEMBLY_FILE)") | ForEach-Object { +# 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", "*.json" | ForEach-Object { $allowed = $true; + # Exclude any files in submodules foreach ($exclude in $exclusions) { if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) { $allowed = $false; @@ -15,14 +24,19 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c $_; } } | Copy-Item -Destination ($destination) -Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object { - $filenames = @($_ -replace "cpz|clz|cplz", "dll", $_ -replace "cpz|clz|cplz", "xml") +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 or 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) } } -$version = $Env -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Get-ChildItem "$($Env:GITHUB_WORKSPACE)\" +Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force +Write-Host "Output Contents post Zip" +Get-ChildItem -Path $destination +Remove-Item $destination -Recurse \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e98c03b..67825a4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,6 +14,7 @@ env: # solution name does not include extension. .sln is assumed SOLUTION_PATH: PepperDash Core SOLUTION_FILE: PepperDash Core + # ASSEMBLY_FILE ASSEMBLY_FILE: PepperDash_Core.dll VERSION: 0.0.0-buildtype-buildnumber BUILD_TYPE: Debug @@ -22,10 +23,12 @@ jobs: Build_Project: runs-on: windows-latest steps: + # First we checkout the source repo - name: Checkout repo uses: actions/checkout@v2 with: fetch-depth: 0 + # And any submodules - name: Checkout submodules shell: bash run: | @@ -33,38 +36,47 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + # Set the BUILD_TYPE environment variable - name: Set Build to Release if triggered from Master run: | if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { Write-Host "Setting build type to Release" Write-Output "::set-env name=BUILD_TYPE::Release" } + # Fetch all tags - name: Fetch tags run: git fetch --tags + # Generate the appropriate version number - name: Set Version Number shell: powershell run: | $version = ./.github/scripts/GenerateVersionNumber.ps1 Write-Output "::set-env name=VERSION::$version" + # Use the version number to set the version of the assemblies - name: Update AssemblyInfo.cs shell: powershell run: | Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + # 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + # Zip up the output files as needed - name: Zip Build Output shell: powershell run: ./.github/scripts/ZipBuildOutput.ps1 + # Write the version to a file to be consumed by the push jobs - name: Write Version run: Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" + # Upload the build output as an artifact - 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: From aa6305fe70b2fdf36b9e328d9de861fc474a1723 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 16:23:09 -0600 Subject: [PATCH 099/117] Removed step that deleted output folder --- .github/scripts/ZipBuildOutput.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index ee227e6..154015f 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -38,5 +38,4 @@ Get-ChildItem -Path $destination | Where-Object {($_.Extension -eq ".clz") -or ( } Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force Write-Host "Output Contents post Zip" -Get-ChildItem -Path $destination -Remove-Item $destination -Recurse \ No newline at end of file +Get-ChildItem -Path $destination \ No newline at end of file From e04c8182ecce703c8ba562cfb9ef34595a7ad463 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 16:34:40 -0600 Subject: [PATCH 100/117] Fixes repo for internal builds --- .github/workflows/docker.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 67825a4..6ac8b04 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,10 +14,11 @@ env: # solution name does not include extension. .sln is assumed SOLUTION_PATH: PepperDash Core SOLUTION_FILE: PepperDash Core - # ASSEMBLY_FILE - ASSEMBLY_FILE: PepperDash_Core.dll + # 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: master jobs: Build_Project: @@ -109,7 +110,7 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash/PepperDashCore-Builds + repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ Env.GITHUB_REF }} - name: Download Build Version Info uses: actions/download-artifact@v1 From ade1238171b54272df4048d263b94760b3c74188 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 16:43:27 -0600 Subject: [PATCH 101/117] Fixes public build repo path and adds comments. --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6ac8b04..d5c88f2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -83,6 +83,7 @@ jobs: with: name: Version path: ./output/version.txt + # Create the release on the source repo - name: Create Release id: create_release uses: actions/create-release@v1 @@ -92,7 +93,8 @@ jobs: prerelease: ${{contains('debug', env.BUILD_TYPE)}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload + # Upload the build package to the release + - name: Upload Release Package id: upload_release uses: actions/upload-release-asset@v1 with: @@ -102,22 +104,26 @@ jobs: asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # This step always runs and pushes the build to the internal build rep Internal_Push_Output: needs: Build_Project runs-on: windows-latest steps: + # Checkout the repo - name: Checkout Public Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ Env.GITHUB_REF }} + # Download the version artifact from the build job - name: Download Build Version Info uses: actions/download-artifact@v1 with: name: Version - name: Check Directory run: Get-ChildItem "./" + # Set the version number environment variable from the file we just downloaded - name: Set Version Number shell: powershell run: | @@ -127,8 +133,10 @@ jobs: Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./Version/version.txt Remove-Item -Path ./Version + # Checkout/Create the branch - name: Create new branch run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + # Download the build output into the repo - name: Download Build output uses: actions/download-artifact@v1 with: @@ -136,16 +144,17 @@ jobs: path: ./ - name: Check directory run: Get-ChildItem ./ + # Unzip the build package file - name: Unzip Build file run: | Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ Remove-Item -Path .\*.zip - name: Check directory again run: Get-ChildItem ./ - - name: Copy build output and push + # Commits the build output to the branch and tags it with the version + - name: Commit build output and tag the commit shell: powershell run: | - git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . @@ -153,33 +162,39 @@ jobs: Write-Host "Commit: $commit" git commit -m $commit git tag $($Env:VERSION) + # Push the commit - name: Push to Builds Repo shell: powershell run: | $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" git push -u origin $($branch) --force + # Push the tags - name: Push tags run: git push --tags origin - name: Check Directory run: Get-ChildItem ./ + # This step only runs if the branch is master or release/ runs and pushes the build to the public build repo Public_Push_Output: needs: Build_Project runs-on: windows-latest if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: + # Checkout the repo - name: Checkout Internal Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/pepperdash-core-builds + repository: PepperDash/PepperDashCore-Builds ref: ${{ Env.GITHUB_REF }} + # Download the version artifact from the build job - name: Download Build Version Info uses: actions/download-artifact@v1 with: name: Version - name: Check Directory run: Get-ChildItem "./" + # Set the version number environment variable from the file we just downloaded - name: Set Version Number shell: powershell run: | @@ -189,8 +204,10 @@ jobs: Write-Output "::set-env name=VERSION::$version" Remove-Item -Path ./Version/version.txt Remove-Item -Path ./Version + # Checkout/Create the branch - name: Create new branch run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + # Download the build output into the repo - name: Download Build output uses: actions/download-artifact@v1 with: @@ -198,16 +215,17 @@ jobs: path: ./ - name: Check directory run: Get-ChildItem ./ + # Unzip the build package file - name: Unzip Build file run: | Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ Remove-Item -Path .\*.zip - name: Check directory again run: Get-ChildItem ./ - - name: Copy build output and push + # Commits the build output to the branch and tags it with the version + - name: Commit build output and tag the commit shell: powershell run: | - git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") git config user.email "actions@pepperdash.com" git config user.name "GitHub Actions" git add . @@ -215,12 +233,14 @@ jobs: Write-Host "Commit: $commit" git commit -m $commit git tag $($Env:VERSION) + # Push the commit - name: Push to Builds Repo shell: powershell run: | $branch = $($Env:GITHUB_REF) -replace "refs/heads/" Write-Host "Branch: $branch" git push -u origin $($branch) --force + # Push the tags - name: Push tags run: git push --tags origin - name: Check Directory From 3969eee043455ddfea0e0a194ae3eef867613dcc Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 19 Mar 2020 16:54:30 -0600 Subject: [PATCH 102/117] Updates step names --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d5c88f2..dbc1d9d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -110,7 +110,7 @@ jobs: runs-on: windows-latest steps: # Checkout the repo - - name: Checkout Public Builds Repo + - name: Checkout Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} @@ -181,7 +181,7 @@ jobs: if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: # Checkout the repo - - name: Checkout Internal Builds Repo + - name: Checkout Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} From 541e9af9e9f25bb1409c0b634a84b7acd78e9bd0 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 23 Mar 2020 13:04:01 -0600 Subject: [PATCH 103/117] removes v from tag for repo release --- .github/workflows/docker.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d5c88f2..ceb5800 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -47,7 +47,7 @@ jobs: # Fetch all tags - name: Fetch tags run: git fetch --tags - # Generate the appropriate version number + # Generate the appropriate version number - name: Set Version Number shell: powershell run: | @@ -63,7 +63,7 @@ jobs: - 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" # Zip up the output files as needed - name: Zip Build Output shell: powershell @@ -88,8 +88,8 @@ jobs: id: create_release uses: actions/create-release@v1 with: - tag_name: v${{ env.VERSION }} - release_name: v${{ env.VERSION }} + tag_name: ${{ env.VERSION }} + release_name: ${{ env.VERSION }} prerelease: ${{contains('debug', env.BUILD_TYPE)}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -245,4 +245,3 @@ jobs: run: git push --tags origin - name: Check Directory run: Get-ChildItem ./ - From 3c25263ac7347ca142be8933997e32b19a3ea020 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 24 Mar 2020 15:06:42 -0600 Subject: [PATCH 104/117] updates multiple things --- .github/scripts/GenerateVersionNumber.ps1 | 13 +++- .github/scripts/ZipBuildOutput.ps1 | 16 ++--- .github/workflows/docker.yml | 24 +++----- .github/workflows/master.yml | 74 +++++++++++++++++++++++ 4 files changed, 100 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/master.yml diff --git a/.github/scripts/GenerateVersionNumber.ps1 b/.github/scripts/GenerateVersionNumber.ps1 index d05aecd..467ce88 100644 --- a/.github/scripts/GenerateVersionNumber.ps1 +++ b/.github/scripts/GenerateVersionNumber.ps1 @@ -7,7 +7,8 @@ Foreach ($version in $latestVersions) { $latestVersion = $version Write-Host "Setting latest version to: $latestVersion" } - } catch { + } + catch { Write-Host "Unable to convert $($version). Skipping" continue; } @@ -18,21 +19,27 @@ $phase = "" $newVersionString = "" switch -regex ($Env:GITHUB_REF) { '^refs\/heads\/master*.' { - $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1) + $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\/development*.' { $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 } } -$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/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 154015f..14cd92b 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -1,16 +1,16 @@ # Uncomment these for local testing -# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\pepperdash-core" -# $Env:SOLUTION_FILE = "PepperDash Core" +# $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_WORKSPACE)\output" +$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", "*.json" | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.json" | ForEach-Object { $allowed = $true; # Exclude any files in submodules foreach ($exclude in $exclusions) { @@ -23,19 +23,19 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)\*" -include "*.clz", "*.c Write-Host "allowing $($_)" $_; } -} | Copy-Item -Destination ($destination) +} | 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 { +Get-ChildItem -Path $destination | Where-Object { (($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz") -or ($_.Extension -eq ".cplz")) } | ForEach-Object { # Replace the extensions with dll or 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) + Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force } } -Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force +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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ceb5800..6054ede 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,13 +6,12 @@ on: - feature/* - hotfix/* - release/* - - master - development env: # solution path doesn't need slashes unless there it is multiple folders deep # solution name does not include extension. .sln is assumed - SOLUTION_PATH: PepperDash Core + SOLUTION_PATH: Pepperdash Core SOLUTION_FILE: PepperDash Core # Do not edit this, we're just creating it here VERSION: 0.0.0-buildtype-buildnumber @@ -37,14 +36,7 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - # Set the BUILD_TYPE environment variable - - name: Set Build to Release if triggered from Master - run: | - if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) { - Write-Host "Setting build type to Release" - Write-Output "::set-env name=BUILD_TYPE::Release" - } - # Fetch all tags + # Fetch all tags - name: Fetch tags run: git fetch --tags # Generate the appropriate version number @@ -70,7 +62,7 @@ jobs: run: ./.github/scripts/ZipBuildOutput.ps1 # Write the version to a file to be consumed by the push jobs - name: Write Version - run: Write-Output "$($Env:VERSION)" | Out-File -FilePath ".\output\version.txt" + run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt" # Upload the build output as an artifact - name: Upload Build Output uses: actions/upload-artifact@v1 @@ -82,7 +74,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: Version - path: ./output/version.txt + path: ${{env.GITHUB_HOME}}\output\version.txt # Create the release on the source repo - name: Create Release id: create_release @@ -110,11 +102,11 @@ jobs: runs-on: windows-latest steps: # Checkout the repo - - name: Checkout Public Builds Repo + - name: Checkout Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/pepperdash-core-builds + repository: PepperDash-Engineering/essentials-builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info @@ -181,11 +173,11 @@ jobs: if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: # Checkout the repo - - name: Checkout Internal Builds Repo + - name: Checkout Builds Repo uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash/PepperDashCore-Builds + repository: PepperDash/Essentials-Builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..72eb611 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,74 @@ +name: Master Build using Docker + +on: + release: + types: + - created + branches: + - master +env: + # solution path doesn't need slashes unless there it is multiple folders deep + # solution name does not include extension. .sln is assumed + SOLUTION_PATH: Pepperdash Core + SOLUTION_FILE: Pepperdash Core + # Do not edit this, we're just creating it here + VERSION: 0.0.0-buildtype-buildnumber + # Defaults to debug for build type + BUILD_TYPE: Release + # Defaults to master as the release branch. Change as necessary + RELEASE_BRANCH: master +jobs: + Build_Project: + runs-on: windows-latest + steps: + # First we checkout the source repo + - name: Checkout repo + uses: actions/checkout@v2 + # And any submodules + - name: Checkout submodules + shell: bash + run: | + git config --global url."https://github.com/".insteadOf "git@github.com:" + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + # 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: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)" + # Use the version number to set the version of the assemblies + - name: Update AssemblyInfo.cs + shell: powershell + run: | + Write-Output ${{ env.VERSION }} + ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + # 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)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + # Zip up the output files as needed + - name: Zip Build Output + shell: powershell + run: ./.github/scripts/ZipBuildOutput.ps1 + - name: Upload Build Output + uses: actions/upload-artifact@v1 + with: + name: Build + path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip + # 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 }} From 9b2730d26f488ac568b87e3c962a33b618ce50c8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 26 Mar 2020 11:30:30 -0600 Subject: [PATCH 105/117] Adds delete step to docker.yml and adds builds repo jobs back to master.yml --- .github/workflows/docker.yml | 12 +++ .github/workflows/master.yml | 152 +++++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6054ede..fa58c79 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -143,6 +143,12 @@ jobs: Remove-Item -Path .\*.zip - name: Check directory again run: Get-ChildItem ./ + # Copy Contents of output folder to root directory + - 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 # Commits the build output to the branch and tags it with the version - name: Commit build output and tag the commit shell: powershell @@ -214,6 +220,12 @@ jobs: Remove-Item -Path .\*.zip - name: Check directory again run: Get-ChildItem ./ + # Copy Contents of output folder to root directory + - 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 # Commits the build output to the branch and tags it with the version - name: Commit build output and tag the commit shell: powershell diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 72eb611..8c80af4 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -72,3 +72,155 @@ jobs: asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Internal_Push_Output: + needs: Build_Project + runs-on: windows-latest + steps: + # Checkout the repo + - name: Checkout Builds Repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILDS_TOKEN }} + repository: PepperDash-Engineering/essentials-builds + ref: ${{ Env.GITHUB_REF }} + # Download the version artifact from the build job + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Check Directory + run: Get-ChildItem "./" + # Set the version number environment variable from the file we just downloaded + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + # Checkout/Create the branch + - name: Create new branch + run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + # Download the build output into the repo + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Check directory + run: Get-ChildItem ./ + # Unzip the build package file + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Check directory again + run: Get-ChildItem ./ + # Copy Contents of output folder to root directory + - 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 + # Commits the build output to the branch and tags it with the version + - name: Commit build output and tag the commit + shell: powershell + run: | + git config user.email "actions@pepperdash.com" + git config user.name "GitHub Actions" + git add . + $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)" + Write-Host "Commit: $commit" + git commit -m $commit + git tag $($Env:VERSION) + # Push the commit + - name: Push to Builds Repo + shell: powershell + run: | + $branch = $($Env:GITHUB_REF) -replace "refs/heads/" + Write-Host "Branch: $branch" + git push -u origin $($branch) --force + # Push the tags + - name: Push tags + run: git push --tags origin + - name: Check Directory + run: Get-ChildItem ./ + # This step only runs if the branch is master or release/ runs and pushes the build to the public build repo + Public_Push_Output: + needs: Build_Project + runs-on: windows-latest + if: contains(github.ref, 'master') || contains(github.ref, 'release') + steps: + # Checkout the repo + - name: Checkout Builds Repo + uses: actions/checkout@v2 + with: + token: ${{ secrets.BUILDS_TOKEN }} + repository: PepperDash/Essentials-Builds + ref: ${{ Env.GITHUB_REF }} + # Download the version artifact from the build job + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Check Directory + run: Get-ChildItem "./" + # Set the version number environment variable from the file we just downloaded + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + # Checkout/Create the branch + - name: Create new branch + run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/") + # Download the build output into the repo + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Check directory + run: Get-ChildItem ./ + # Unzip the build package file + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Check directory again + run: Get-ChildItem ./ + # Copy Contents of output folder to root directory + - 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 + # Commits the build output to the branch and tags it with the version + - name: Commit build output and tag the commit + shell: powershell + run: | + git config user.email "actions@pepperdash.com" + git config user.name "GitHub Actions" + git add . + $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)" + Write-Host "Commit: $commit" + git commit -m $commit + git tag $($Env:VERSION) + # Push the commit + - name: Push to Builds Repo + shell: powershell + run: | + $branch = $($Env:GITHUB_REF) -replace "refs/heads/" + Write-Host "Branch: $branch" + git push -u origin $($branch) --force + # Push the tags + - name: Push tags + run: git push --tags origin + - name: Check Directory + run: Get-ChildItem ./ From 301f26ef0b5735e947235a2362b719a45de47d1e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 26 Mar 2020 11:49:11 -0600 Subject: [PATCH 106/117] fixes repos for pushing builds --- .github/workflows/docker.yml | 4 ++-- .github/workflows/master.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fa58c79..b29d3cb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/essentials-builds + repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info @@ -183,7 +183,7 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash/Essentials-Builds + repository: PepperDash/PepperDashCore-Builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 8c80af4..22a1deb 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -81,7 +81,7 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash-Engineering/essentials-builds + repository: PepperDash-Engineering/pepperdash-core-builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info @@ -158,7 +158,7 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.BUILDS_TOKEN }} - repository: PepperDash/Essentials-Builds + repository: PepperDash/PepperDashCore-Builds ref: ${{ Env.GITHUB_REF }} # Download the version artifact from the build job - name: Download Build Version Info From 348668f273550a1a657b74ade0f3e1390fd33b59 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 18 May 2020 17:22:47 -0600 Subject: [PATCH 107/117] update action to login to docker hub --- .github/workflows/docker.yml | 6 ++++++ .github/workflows/master.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b29d3cb..945ecfa 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -51,6 +51,12 @@ jobs: run: | Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + # Login to Docker + - name: Login to Docker + uses: azure/docker-login@v1 + with: + username: ${{ secrets.dockerhub_password }} + password: ${{ secrets.dockerhub_user }} # Build the solutions in the docker image - name: Build Solution shell: powershell diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 22a1deb..110e18a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -47,6 +47,12 @@ jobs: run: | Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} + # Login to Docker + - name: Login to Docker + uses: azure/docker-login@v1 + with: + username: ${{ secrets.dockerhub_password }} + password: ${{ secrets.dockerhub_user }} # Build the solutions in the docker image - name: Build Solution shell: powershell From 34951eb8d0bb8ae01969315380c21a9ea8cd8c06 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 18 May 2020 17:27:52 -0600 Subject: [PATCH 108/117] moves fields to the correct places --- .github/workflows/master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 110e18a..13db798 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -51,8 +51,8 @@ jobs: - name: Login to Docker uses: azure/docker-login@v1 with: - username: ${{ secrets.dockerhub_password }} - password: ${{ secrets.dockerhub_user }} + username: ${{ secrets.dockerhub_user }} + password: ${{ secrets.dockerhub_password }} # Build the solutions in the docker image - name: Build Solution shell: powershell From 9b56d55c9097cacc055cf76537a295880074ab98 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 18 May 2020 17:29:24 -0600 Subject: [PATCH 109/117] fixes in docker.yml for fields in the wrong spot --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 945ecfa..e7b19e6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,8 +55,8 @@ jobs: - name: Login to Docker uses: azure/docker-login@v1 with: - username: ${{ secrets.dockerhub_password }} - password: ${{ secrets.dockerhub_user }} + username: ${{ secrets.dockerhub_user }} + password: ${{ secrets.dockerhub_password }} # Build the solutions in the docker image - name: Build Solution shell: powershell From 48b564fb864401f31406faeb219dd58b30a01d9c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 18 May 2020 17:34:15 -0600 Subject: [PATCH 110/117] remove get tags in Master.yml --- .github/workflows/master.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 13db798..7a6135c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -32,9 +32,6 @@ jobs: auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - # Fetch all tags - - name: Fetch tags - run: git fetch --tags # Generate the appropriate version number - name: Set Version Number shell: powershell From 3ad222527ef460f7a61790a99130f40a86c9acb3 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 18 May 2020 17:43:03 -0600 Subject: [PATCH 111/117] updates docker.yml to only create a release for RC and hotfix builds --- .github/workflows/docker.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e7b19e6..33c0c2d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -82,9 +82,16 @@ jobs: name: Version path: ${{env.GITHUB_HOME}}\output\version.txt # Create the release on the source repo + - name: Create tag for non-rc builds + if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') + run: | + git tag $($Env:VERSION) + git push --tags origin - name: Create Release id: create_release - uses: actions/create-release@v1 + # using contributor's version to allow for pointing at the right commit + if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-') + uses: fleskesvor/create-release@feature/support-target-commitish with: tag_name: ${{ env.VERSION }} release_name: ${{ env.VERSION }} @@ -93,6 +100,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Upload the build package to the release - name: Upload Release Package + if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-') id: upload_release uses: actions/upload-release-asset@v1 with: From 8f075fbed73b66b83bf5804b10cd02d3ed732117 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 9 Jun 2020 14:05:27 -0600 Subject: [PATCH 112/117] Adds IStreamDebugging and associated logic to implment on TCP, SSH and UDP methods --- .../Comm/CommunicationStreamDebugging.cs | 127 ++++++++++++++++++ .../Pepperdash Core/Comm/GenericSshClient.cs | 18 ++- .../Comm/GenericTcpIpClient.cs | 24 +++- .../Pepperdash Core/Comm/GenericUdpServer.cs | 18 ++- .../Pepperdash Core/CommunicationExtras.cs | 23 ++++ .../Pepperdash Core/Logging/Debug.cs | 22 +++ .../Pepperdash Core/Logging/DebugMemory.cs | 45 ++++++- .../Pepperdash Core/PepperDash_Core.csproj | 1 + 8 files changed, 263 insertions(+), 15 deletions(-) create mode 100644 Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs diff --git a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs new file mode 100644 index 0000000..3050e6f --- /dev/null +++ b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using PepperDash.Core; + +namespace PepperDash.Core +{ + /// + /// Controls the ability to disable/enable debugging of TX/RX data sent to/from a device with a built in timer to disable + /// + public class CommunicationStreamDebugging + { + public string ParentDeviceKey { get; private set; } + + /// + /// Timer to disable automatically if not manually disabled + /// + private CTimer DebugExpiryPeriod; + + public eStreamDebuggingSetting DebugSetting { get; private set; } + + private uint _DebugTimeoutMin; + private const uint _DefaultDebugTimeoutMin = 30; + + /// + /// Timeout in Minutes + /// + public uint DebugTimeoutMinutes + { + get + { + return _DebugTimeoutMin; + } + } + + + private long _DebugTimeoutInMs + { + get + { + return DebugTimeoutMinutes * 60000; + } + } + + public bool RxStreamDebuggingIsEnabled{ get; private set; } + + public bool TxStreamDebuggingIsEnabled { get; private set; } + + + public CommunicationStreamDebugging(string parentDeviceKey) + { + ParentDeviceKey = parentDeviceKey; + } + + + /// + /// Sets the debugging setting and if not setting to off, assumes the default of 30 mintues + /// + /// + public void SetDebuggingWithDefaultTimeout(eStreamDebuggingSetting setting) + { + if (setting == eStreamDebuggingSetting.Off) + { + DisableDebugging(); + } + else + { + SetDebuggingWithSpecificTimeout(setting, _DefaultDebugTimeoutMin); + } + } + + /// + /// Sets the debugging setting for the specified number of minutes + /// + /// + /// + public void SetDebuggingWithSpecificTimeout(eStreamDebuggingSetting setting, uint minutes) + { + _DebugTimeoutMin = minutes; + + if (DebugExpiryPeriod != null) + { + DisableDebugging(); + } + + DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs); + + if ((setting & eStreamDebuggingSetting.Rx) == eStreamDebuggingSetting.Rx) + RxStreamDebuggingIsEnabled = true; + + if ((setting & eStreamDebuggingSetting.Tx) == eStreamDebuggingSetting.Tx) + TxStreamDebuggingIsEnabled = true; + + Debug.SetDeviceDebugSettings(ParentDeviceKey, setting); + + } + + /// + /// Disabled debugging + /// + public void DisableDebugging() + { + DebugExpiryPeriod.Stop(); + DebugExpiryPeriod.Dispose(); + DebugExpiryPeriod = null; + + RxStreamDebuggingIsEnabled = false; + TxStreamDebuggingIsEnabled = false; + + Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off); + } + } + + /// + /// The available settings for stream debugging + /// + [Flags] + public enum eStreamDebuggingSetting + { + Off = 0, + Rx = 1, + Tx = 2, + Both = Rx | Tx + } +} \ No newline at end of file diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs index ef57ae0..69fa3be 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs @@ -11,8 +11,10 @@ namespace PepperDash.Core /// /// /// - public class GenericSshClient : Device, ISocketStatus, IAutoReconnect + public class GenericSshClient : Device, ISocketStatusWithStreamDebugging, IAutoReconnect { + public CommunicationStreamDebugging StreamDebugging { get; private set; } + /// /// Event that fires when data is received. Delivers args with byte array /// @@ -139,6 +141,7 @@ namespace PepperDash.Core public GenericSshClient(string key, string hostname, int port, string username, string password) : base(key) { + StreamDebugging = new CommunicationStreamDebugging(key); CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler); Key = key; Hostname = hostname; @@ -240,7 +243,7 @@ namespace PepperDash.Core try { Client.Connect(); - TheStream = Client.CreateShellStream("PDTShell", 100, 80, 100, 200, 65534); + TheStream = Client.CreateShellStream("PDTShell", 100, 80, 100, 200, 100000); TheStream.DataReceived += Stream_DataReceived; //TheStream.ErrorOccurred += TheStream_ErrorOccurred; Debug.Console(1, this, "Connected"); @@ -381,6 +384,10 @@ namespace PepperDash.Core { var str = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length); textHandler(this, new GenericCommMethodReceiveTextArgs(str)); + + if (StreamDebugging.RxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Recevied: '{0}'", str); + } } } @@ -422,8 +429,12 @@ namespace PepperDash.Core { if (Client != null) { + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} characters of text: '{1}'", text.Length, text); + TheStream.Write(text); TheStream.Flush(); + } } catch @@ -444,6 +455,9 @@ namespace PepperDash.Core { if (Client != null) { + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + TheStream.Write(bytes, 0, bytes.Length); TheStream.Flush(); } diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs index c1384f9..233926c 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs @@ -14,8 +14,10 @@ namespace PepperDash.Core /// /// A class to handle basic TCP/IP communications with a server /// - public class GenericTcpIpClient : Device, ISocketStatus, IAutoReconnect + public class GenericTcpIpClient : Device, ISocketStatusWithStreamDebugging, IAutoReconnect { + public CommunicationStreamDebugging StreamDebugging { get; private set; } + /// /// Fires when data is received from the server and returns it as a Byte array /// @@ -176,7 +178,7 @@ namespace PepperDash.Core public GenericTcpIpClient(string key, string address, int port, int bufferSize) : base(key) { - + StreamDebugging = new CommunicationStreamDebugging(key); Hostname = address; Port = port; BufferSize = bufferSize; @@ -192,6 +194,7 @@ namespace PepperDash.Core public GenericTcpIpClient(string key) : base(key) { + StreamDebugging = new CommunicationStreamDebugging(key); CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler); AutoReconnectIntervalMs = 5000; BufferSize = 2000; @@ -348,8 +351,15 @@ namespace PepperDash.Core if (textHandler != null) { var str = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length); + + if (StreamDebugging.RxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Recevied: '{0}'", str); + textHandler(this, new GenericCommMethodReceiveTextArgs(str)); + } + + } client.ReceiveDataAsync(Receive); @@ -363,10 +373,12 @@ namespace PepperDash.Core { var bytes = Encoding.GetEncoding(28591).GetBytes(text); // Check debug level before processing byte array - //if (Debug.Level == 2) - // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); + + } /// @@ -388,8 +400,8 @@ namespace PepperDash.Core /// public void SendBytes(byte[] bytes) { - //if (Debug.Level == 2) - // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); } diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericUdpServer.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericUdpServer.cs index d675646..1e9dddd 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericUdpServer.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericUdpServer.cs @@ -15,8 +15,9 @@ using Newtonsoft.Json.Linq; namespace PepperDash.Core { - public class GenericUdpServer : Device, IBasicCommunication, ISocketStatus + public class GenericUdpServer : Device, ISocketStatusWithStreamDebugging { + public CommunicationStreamDebugging StreamDebugging { get; private set; } /// /// /// @@ -138,6 +139,7 @@ namespace PepperDash.Core public GenericUdpServer(string key, string address, int port, int buffefSize) : base(key) { + StreamDebugging = new CommunicationStreamDebugging(key); Hostname = address; Port = port; BufferSize = buffefSize; @@ -268,8 +270,9 @@ namespace PepperDash.Core var textHandler = TextReceived; if (textHandler != null) { - - Debug.Console(2, this, "RX: {0}", str); + if (StreamDebugging.RxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Recevied: '{0}'", str); + textHandler(this, new GenericCommMethodReceiveTextArgs(str)); } else @@ -323,7 +326,9 @@ namespace PepperDash.Core if (IsConnected && Server != null) { - Debug.Console(2, this, "TX: {0}", text); + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} characters of text: '{1}'", text.Length, text); + Server.SendData(bytes, bytes.Length); } } @@ -334,8 +339,9 @@ namespace PepperDash.Core /// public void SendBytes(byte[] bytes) { - //if (Debug.Level == 2) - // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + if (IsConnected && Server != null) Server.SendData(bytes, bytes.Length); } diff --git a/Pepperdash Core/Pepperdash Core/CommunicationExtras.cs b/Pepperdash Core/Pepperdash Core/CommunicationExtras.cs index 2c8c0bc..c5892a4 100644 --- a/Pepperdash Core/Pepperdash Core/CommunicationExtras.cs +++ b/Pepperdash Core/Pepperdash Core/CommunicationExtras.cs @@ -32,6 +32,22 @@ namespace PepperDash.Core void SendBytes(byte[] bytes); } + /// + /// Represents a device that implements IBasicCommunication and IStreamDebugging + /// + public interface IBasicCommunicationWithStreamDebugging : IBasicCommunication, IStreamDebugging + { + + } + + /// + /// Represents a device with stream debugging capablities + /// + public interface IStreamDebugging + { + CommunicationStreamDebugging StreamDebugging { get; } + } + /// /// For IBasicCommunication classes that have SocketStatus. GenericSshClient, /// GenericTcpIpClient @@ -42,6 +58,13 @@ namespace PepperDash.Core SocketStatus ClientStatus { get; } } + /// + /// Represents a device that implements ISocketStatus and IStreamDebugging + /// + public interface ISocketStatusWithStreamDebugging : ISocketStatus, IStreamDebugging + { + + } public interface IAutoReconnect { diff --git a/Pepperdash Core/Pepperdash Core/Logging/Debug.cs b/Pepperdash Core/Pepperdash Core/Logging/Debug.cs index cf4d8df..5d245d2 100644 --- a/Pepperdash Core/Pepperdash Core/Logging/Debug.cs +++ b/Pepperdash Core/Pepperdash Core/Logging/Debug.cs @@ -274,6 +274,28 @@ namespace PepperDash.Core } } + /// + /// sets the settings for a device or creates a new entry + /// + /// + /// + /// + public static void SetDeviceDebugSettings(string deviceKey, object settings) + { + Contexts.SetDebugSettingsForKey(deviceKey, settings); + SaveMemoryOnTimeout(); + } + + /// + /// Gets the device settings for a device by key or returns null + /// + /// + /// + public static object GetDeviceDebugSettingsForKey(string deviceKey) + { + return Contexts.GetDebugSettingsForKey(deviceKey); + } + /// /// Sets the flag to prevent application starting on next boot /// diff --git a/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs b/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs index 6dcb65f..1b0fea1 100644 --- a/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs +++ b/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs @@ -5,16 +5,31 @@ using System.Text; using Crestron.SimplSharp; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace PepperDash.Core.DebugThings { public class DebugContextCollection { + /// + /// To prevent threading issues with the DeviceDebugSettings collection + /// + private CCriticalSection DeviceDebugSettingsLock; + [JsonProperty("items")] Dictionary Items; + /// + /// Collection of the debug settings for each device where the dictionary key is the device key + /// + [JsonProperty("deviceDebugSettings")] + private Dictionary DeviceDebugSettings { get; set; } + + public DebugContextCollection() { + DeviceDebugSettingsLock = new CCriticalSection(); + DeviceDebugSettings = new Dictionary(); Items = new Dictionary(); } @@ -43,6 +58,35 @@ namespace PepperDash.Core.DebugThings Items[contextKey] = new DebugContextItem(this) { Level = 0 }; return Items[contextKey]; } + + + /// + /// sets the settings for a device or creates a new entry + /// + /// + /// + /// + public void SetDebugSettingsForKey(string deviceKey, object settings) + { + var existingSettings = DeviceDebugSettings[deviceKey]; + + if (existingSettings != null) + { + existingSettings = settings; + } + else + DeviceDebugSettings.Add(deviceKey, settings); + } + + /// + /// Gets the device settings for a device by key or returns null + /// + /// + /// + public object GetDebugSettingsForKey(string deviceKey) + { + return DeviceDebugSettings[deviceKey]; + } } public class DebugContextItem @@ -59,7 +103,6 @@ namespace PepperDash.Core.DebugThings [JsonProperty("doNotLoadOnNextBoot")] public bool DoNotLoadOnNextBoot { get; set; } - public DebugContextItem(DebugContextCollection parent) { diff --git a/Pepperdash Core/Pepperdash Core/PepperDash_Core.csproj b/Pepperdash Core/Pepperdash Core/PepperDash_Core.csproj index 92ce8c8..d4fbf18 100644 --- a/Pepperdash Core/Pepperdash Core/PepperDash_Core.csproj +++ b/Pepperdash Core/Pepperdash Core/PepperDash_Core.csproj @@ -69,6 +69,7 @@ + From a7bacd26dd1eeecb6f3b498bd09304ae4dcdd5d1 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 9 Jun 2020 15:16:08 -0600 Subject: [PATCH 113/117] change private field to store ms instead of minutes --- .../Comm/CommunicationStreamDebugging.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs index 3050e6f..3f1624a 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs @@ -12,6 +12,9 @@ namespace PepperDash.Core /// public class CommunicationStreamDebugging { + /// + /// Device Key that this instance configures + /// public string ParentDeviceKey { get; private set; } /// @@ -21,7 +24,7 @@ namespace PepperDash.Core public eStreamDebuggingSetting DebugSetting { get; private set; } - private uint _DebugTimeoutMin; + private uint _DebugTimeoutInMs; private const uint _DefaultDebugTimeoutMin = 30; /// @@ -31,16 +34,7 @@ namespace PepperDash.Core { get { - return _DebugTimeoutMin; - } - } - - - private long _DebugTimeoutInMs - { - get - { - return DebugTimeoutMinutes * 60000; + return _DebugTimeoutInMs/60000; } } @@ -78,7 +72,7 @@ namespace PepperDash.Core /// public void SetDebuggingWithSpecificTimeout(eStreamDebuggingSetting setting, uint minutes) { - _DebugTimeoutMin = minutes; + _DebugTimeoutInMs = minutes * 60000; if (DebugExpiryPeriod != null) { From 91abd2dd1073e17d3511f98e85413822ac44bc17 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 9 Jun 2020 15:53:43 -0600 Subject: [PATCH 114/117] fixes issues with various methods --- .../Comm/CommunicationStreamDebugging.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs index 3f1624a..9fd0f71 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs @@ -58,11 +58,10 @@ namespace PepperDash.Core if (setting == eStreamDebuggingSetting.Off) { DisableDebugging(); + return; } - else - { - SetDebuggingWithSpecificTimeout(setting, _DefaultDebugTimeoutMin); - } + + SetDebuggingWithSpecificTimeout(setting, _DefaultDebugTimeoutMin); } /// @@ -72,6 +71,12 @@ namespace PepperDash.Core /// public void SetDebuggingWithSpecificTimeout(eStreamDebuggingSetting setting, uint minutes) { + if ((setting & eStreamDebuggingSetting.Off) == eStreamDebuggingSetting.Off) + { + DisableDebugging(); + return; + } + _DebugTimeoutInMs = minutes * 60000; if (DebugExpiryPeriod != null) @@ -94,7 +99,7 @@ namespace PepperDash.Core /// /// Disabled debugging /// - public void DisableDebugging() + private void DisableDebugging() { DebugExpiryPeriod.Stop(); DebugExpiryPeriod.Dispose(); From e3c5f101bc9e69c8360e5532bb7032ae99793368 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 9 Jun 2020 15:57:32 -0600 Subject: [PATCH 115/117] fixes conditional for turning debugging off --- .../Pepperdash Core/Comm/CommunicationStreamDebugging.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs index 9fd0f71..f3b5613 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/CommunicationStreamDebugging.cs @@ -71,7 +71,7 @@ namespace PepperDash.Core /// public void SetDebuggingWithSpecificTimeout(eStreamDebuggingSetting setting, uint minutes) { - if ((setting & eStreamDebuggingSetting.Off) == eStreamDebuggingSetting.Off) + if (setting == eStreamDebuggingSetting.Off) { DisableDebugging(); return; From f89c75debc96e2490f079f7d89a40dea3a2ef69d Mon Sep 17 00:00:00 2001 From: Jason Alborough Date: Tue, 9 Jun 2020 20:44:52 -0400 Subject: [PATCH 116/117] #28 Fixes issue where GenericTxpIpClient would attempt to reconnect when it was disconnected on a shutdown or program stop. --- .../Pepperdash Core/Comm/GenericTcpIpClient.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs index c1384f9..36ce488 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs @@ -224,7 +224,7 @@ namespace PepperDash.Core if (programEventType == eProgramStatusEventType.Stopping) { Debug.Console(1, this, "Program stopping. Closing connection"); - DisconnectClient(); + Disconnect(); } } @@ -363,8 +363,8 @@ namespace PepperDash.Core { var bytes = Encoding.GetEncoding(28591).GetBytes(text); // Check debug level before processing byte array - //if (Debug.Level == 2) - // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + + Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); } @@ -388,8 +388,8 @@ namespace PepperDash.Core /// public void SendBytes(byte[] bytes) { - //if (Debug.Level == 2) - // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + + Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); } From 69587021cb5ebae2dcf89b23ffe916c400337ae2 Mon Sep 17 00:00:00 2001 From: Jason Alborough Date: Wed, 10 Jun 2020 09:07:37 -0400 Subject: [PATCH 117/117] Revere the uncommenting of debug statements --- .../Pepperdash Core/Comm/GenericTcpIpClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs index 36ce488..8cfb600 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs @@ -363,8 +363,8 @@ namespace PepperDash.Core { var bytes = Encoding.GetEncoding(28591).GetBytes(text); // Check debug level before processing byte array - - Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + //if (Debug.Level == 2) + // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); } @@ -388,8 +388,8 @@ namespace PepperDash.Core /// public void SendBytes(byte[] bytes) { - - Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + //if (Debug.Level == 2) + // Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); if(Client != null) Client.SendData(bytes, bytes.Length); }