mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-15 20:54:46 +00:00
Updates ZipBuildOutput to collect all files. Adds comments to scripts
This commit is contained in:
7
.github/.vscode/settings.json
vendored
7
.github/.vscode/settings.json
vendored
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"workbench.colorCustomizations": {
|
|
||||||
"activityBar.background": "#19340D",
|
|
||||||
"titleBar.activeBackground": "#234912",
|
|
||||||
"titleBar.activeForeground": "#F6FCF3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
26
.github/scripts/ZipBuildOutput.ps1
vendored
26
.github/scripts/ZipBuildOutput.ps1
vendored
@@ -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"
|
$destination = "$($Env:GITHUB_WORKSPACE)\output"
|
||||||
New-Item -ItemType Directory -Force -Path ($destination)
|
New-Item -ItemType Directory -Force -Path ($destination)
|
||||||
Get-ChildItem ($destination)
|
Get-ChildItem ($destination)
|
||||||
$exclusions = @(git submodule foreach --quiet 'echo $name')
|
$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;
|
$allowed = $true;
|
||||||
|
# Exclude any files in submodules
|
||||||
foreach ($exclude in $exclusions) {
|
foreach ($exclude in $exclusions) {
|
||||||
if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) {
|
if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) {
|
||||||
$allowed = $false;
|
$allowed = $false;
|
||||||
@@ -15,14 +24,19 @@ Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include @("*.clz", "*.c
|
|||||||
$_;
|
$_;
|
||||||
}
|
}
|
||||||
} | Copy-Item -Destination ($destination)
|
} | Copy-Item -Destination ($destination)
|
||||||
Get-ChildItem "$($Env:GITHUB_WORKSPACE)\output" -include @("*.cpz", "*.clz", "*.cplz") | ForEach-Object {
|
Write-Host "Getting matching files..."
|
||||||
$filenames = @($_ -replace "cpz|clz|cplz", "dll", $_ -replace "cpz|clz|cplz", "xml")
|
# 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:"
|
||||||
Write-Host $filenames
|
Write-Host $filenames
|
||||||
if ($filenames.length -gt 0) {
|
if ($filenames.length -gt 0) {
|
||||||
|
# Attempt to get the files and return them to the output directory
|
||||||
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination)
|
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$version = $Env
|
Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force
|
||||||
Compress-Archive -Path "$($Env:GITHUB_WORKSPACE)\output\*" -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip"
|
Write-Host "Output Contents post Zip"
|
||||||
Get-ChildItem "$($Env:GITHUB_WORKSPACE)\"
|
Get-ChildItem -Path $destination
|
||||||
|
Remove-Item $destination -Recurse
|
||||||
12
.github/workflows/docker.yml
vendored
12
.github/workflows/docker.yml
vendored
@@ -14,6 +14,7 @@ env:
|
|||||||
# solution name does not include extension. .sln is assumed
|
# solution name does not include extension. .sln is assumed
|
||||||
SOLUTION_PATH: PepperDash Core
|
SOLUTION_PATH: PepperDash Core
|
||||||
SOLUTION_FILE: PepperDash Core
|
SOLUTION_FILE: PepperDash Core
|
||||||
|
# ASSEMBLY_FILE
|
||||||
ASSEMBLY_FILE: PepperDash_Core.dll
|
ASSEMBLY_FILE: PepperDash_Core.dll
|
||||||
VERSION: 0.0.0-buildtype-buildnumber
|
VERSION: 0.0.0-buildtype-buildnumber
|
||||||
BUILD_TYPE: Debug
|
BUILD_TYPE: Debug
|
||||||
@@ -22,10 +23,12 @@ jobs:
|
|||||||
Build_Project:
|
Build_Project:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
# First we checkout the source repo
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# And any submodules
|
||||||
- name: Checkout submodules
|
- name: Checkout submodules
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -33,38 +36,47 @@ jobs:
|
|||||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
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
|
- name: Set Build to Release if triggered from Master
|
||||||
run: |
|
run: |
|
||||||
if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) {
|
if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) {
|
||||||
Write-Host "Setting build type to Release"
|
Write-Host "Setting build type to Release"
|
||||||
Write-Output "::set-env name=BUILD_TYPE::Release"
|
Write-Output "::set-env name=BUILD_TYPE::Release"
|
||||||
}
|
}
|
||||||
|
# Fetch all tags
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
run: git fetch --tags
|
run: git fetch --tags
|
||||||
|
# Generate the appropriate version number
|
||||||
- name: Set Version Number
|
- name: Set Version Number
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
Write-Output "::set-env name=VERSION::$version"
|
||||||
|
# Use the version number to set the version of the assemblies
|
||||||
- name: Update AssemblyInfo.cs
|
- name: Update AssemblyInfo.cs
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
Write-Output ${{ env.VERSION }}
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
|
# Build the solutions in the docker image
|
||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_PATH)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_PATH)\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||||
|
# Zip up the output files as needed
|
||||||
- name: Zip Build Output
|
- name: Zip Build Output
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: ./.github/scripts/ZipBuildOutput.ps1
|
run: ./.github/scripts/ZipBuildOutput.ps1
|
||||||
|
# Write the version to a file to be consumed by the push jobs
|
||||||
- name: Write Version
|
- 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"
|
||||||
|
# Upload the build output as an artifact
|
||||||
- name: Upload Build Output
|
- name: Upload Build Output
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: Build
|
name: Build
|
||||||
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||||
|
# Upload the Version file as an artifact
|
||||||
- name: Upload version.txt
|
- name: Upload version.txt
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user