mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-01-11 19:44:44 +00:00
chore: remove unneeded scripts
This commit is contained in:
23
.github/scripts/GenerateVersionNumber.ps1
vendored
23
.github/scripts/GenerateVersionNumber.ps1
vendored
@@ -1,23 +0,0 @@
|
|||||||
$latestVersion = [version]"2.0.0"
|
|
||||||
|
|
||||||
$newVersion = [version]$latestVersion
|
|
||||||
$phase = ""
|
|
||||||
$newVersionString = ""
|
|
||||||
|
|
||||||
switch -regex ($Env:GITHUB_REF) {
|
|
||||||
'^refs\/pull\/*.' {
|
|
||||||
$phase = 'beta';
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
'^refs\/heads\/feature-2\/*.' {
|
|
||||||
$phase = 'alpha'
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
'development-2' {
|
|
||||||
$phase = 'beta'
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Write-Output $newVersionString
|
|
||||||
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
@@ -1,40 +0,0 @@
|
|||||||
function Update-SourceVersion {
|
|
||||||
Param ([string]$Version)
|
|
||||||
#$fullVersion = $Version
|
|
||||||
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
|
|
||||||
$NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’
|
|
||||||
Write-Output "AssemblyVersion = $NewAssemblyVersion"
|
|
||||||
$NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’
|
|
||||||
Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
|
|
||||||
|
|
||||||
foreach ($o in $input) {
|
|
||||||
Write-output $o.FullName
|
|
||||||
$TmpFile = $o.FullName + “.tmp”
|
|
||||||
get-content $o.FullName |
|
|
||||||
ForEach-Object {
|
|
||||||
$_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion } |
|
|
||||||
ForEach-Object {
|
|
||||||
$_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion
|
|
||||||
} > $TmpFile
|
|
||||||
move-item $TmpFile $o.FullName -force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Update-AllAssemblyInfoFiles ( $version ) {
|
|
||||||
foreach ($file in “AssemblyInfo.cs”, “AssemblyInfo.vb” ) {
|
|
||||||
get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# validate arguments
|
|
||||||
$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
|
|
||||||
if ($r.Success) {
|
|
||||||
Write-Output "Updating Assembly Version to $args ...";
|
|
||||||
Update-AllAssemblyInfoFiles $args[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Output ” “;
|
|
||||||
Write-Output “Error: Input version does not match x.y.z format!”
|
|
||||||
Write-Output ” “;
|
|
||||||
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
|
||||||
}
|
|
||||||
42
.github/scripts/ZipBuildOutput.ps1
vendored
42
.github/scripts/ZipBuildOutput.ps1
vendored
@@ -1,42 +0,0 @@
|
|||||||
# Uncomment these for local testing
|
|
||||||
# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\essentials"
|
|
||||||
# $Env:SOLUTION_FILE = "PepperDashEssentials"
|
|
||||||
# $Env:VERSION = "0.0.0-buildType-test"
|
|
||||||
|
|
||||||
# Sets the root directory for the operation
|
|
||||||
$destination = "$($Env:GITHUB_HOME)\output"
|
|
||||||
New-Item -ItemType Directory -Force -Path ($destination)
|
|
||||||
Get-ChildItem ($destination)
|
|
||||||
$exclusions = @(git submodule foreach --quiet 'echo $name')
|
|
||||||
$exclusions += "Newtonsoft.Json.Compact.dll"
|
|
||||||
# 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", "*.nuspec" | ForEach-Object {
|
|
||||||
$allowed = $true;
|
|
||||||
# Exclude any files in submodules
|
|
||||||
foreach ($exclude in $exclusions) {
|
|
||||||
if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) {
|
|
||||||
$allowed = $false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($allowed) {
|
|
||||||
Write-Host "allowing $($_)"
|
|
||||||
$_;
|
|
||||||
}
|
|
||||||
} | Copy-Item -Destination ($destination) -Force
|
|
||||||
Write-Host "Getting matching files..."
|
|
||||||
# Get any files from the output folder that match the following extensions
|
|
||||||
Get-ChildItem -Path $destination | Where-Object { (($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz") -or ($_.Extension -eq ".cplz")) } | ForEach-Object {
|
|
||||||
# Replace the extensions with dll 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) -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Compress-Archive -Path $destination -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force
|
|
||||||
Write-Host "Output Contents post Zip"
|
|
||||||
Get-ChildItem -Path $destination
|
|
||||||
Reference in New Issue
Block a user