From 6cf5fe5ec4f2e0c50856e2a5fae5afd4ecb2898c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 16 Mar 2020 12:30:31 -0600 Subject: [PATCH 001/100] 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 002/100] 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 003/100] 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 004/100] 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 005/100] 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 006/100] 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 007/100] 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 008/100] 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 009/100] 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 010/100] 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 011/100] 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 012/100] 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 013/100] 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 014/100] 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 015/100] 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 016/100] 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 017/100] 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 018/100] 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 019/100] 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 020/100] 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 021/100] 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 022/100] 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 023/100] 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 024/100] 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 025/100] 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 026/100] 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 027/100] 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 028/100] 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 029/100] 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 030/100] 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 031/100] 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 032/100] 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 033/100] 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 034/100] 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 035/100] 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 036/100] 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 037/100] 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 038/100] 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 039/100] 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 040/100] 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 041/100] 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 042/100] 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 043/100] 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 044/100] 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 045/100] 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 046/100] 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 047/100] 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 048/100] 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 049/100] 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 050/100] 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 051/100] 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 052/100] 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 053/100] 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 054/100] 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 055/100] 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 056/100] 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 057/100] 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 058/100] 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 059/100] 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 060/100] 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 061/100] 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 062/100] 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 063/100] 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 064/100] 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 065/100] 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 066/100] 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 067/100] 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 068/100] 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 069/100] 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 070/100] 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 071/100] 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 072/100] 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 073/100] 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 074/100] 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 075/100] 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 076/100] 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 077/100] 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 078/100] 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 079/100] 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 080/100] 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 081/100] 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 082/100] 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 083/100] 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 084/100] 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 085/100] 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 086/100] 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 087/100] 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 088/100] 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 089/100] 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 090/100] 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 091/100] 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 092/100] 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 093/100] 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 094/100] 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 095/100] 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 096/100] 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 097/100] 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 098/100] 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 099/100] 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 100/100] 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