Un revert the CICD option

This commit is contained in:
Twangboy 2023-01-09 22:25:22 -07:00 committed by Megan Wilhite
parent 0cc27f911c
commit 457789e744
11 changed files with 150 additions and 29 deletions

View file

@ -31,7 +31,7 @@ jobs:
- name: Build Package
shell: powershell
run: |
powershell -file pkg/windows/build.ps1 -Architecture ${{ matrix.arch }} -Version $env:SALT_VERSION
& pkg/windows/build.cmd -Architecture ${{ matrix.arch }} -Version $env:SALT_VERSION -CICD
- name: Upload ${{ matrix.arch }} NSIS Package
uses: actions/upload-artifact@v3

View file

@ -66,7 +66,12 @@ param(
[Alias("b")]
# Build python from source instead of fetching a tarball
# Requires VC Build Tools
[Switch] $Build
[Switch] $Build,
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
@ -117,7 +122,11 @@ Write-Host $("v" * 80)
# Install NSIS
#-------------------------------------------------------------------------------
& "$SCRIPT_DIR\install_nsis.ps1"
$KeywordArguments = @{}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\install_nsis.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to install NSIS"
exit 1
@ -127,7 +136,11 @@ if ( ! $? ) {
# Install WIX
#-------------------------------------------------------------------------------
& "$SCRIPT_DIR\install_wix.ps1"
$KeywordArguments = @{}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\install_wix.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to install WIX"
exit 1
@ -137,7 +150,11 @@ if ( ! $? ) {
# Install Visual Studio Build Tools
#-------------------------------------------------------------------------------
& "$SCRIPT_DIR\install_vs_buildtools.ps1"
$KeywordArguments = @{}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\install_vs_buildtools.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to install Visual Studio Build Tools"
exit 1
@ -154,6 +171,10 @@ $KeywordArguments = @{
if ( $Build ) {
$KeywordArguments["Build"] = $true
}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\build_python.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to build Python"
@ -164,7 +185,11 @@ if ( ! $? ) {
# Install Salt
#-------------------------------------------------------------------------------
& "$SCRIPT_DIR\install_salt.ps1"
$KeywordArguments = @{}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\install_salt.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to install Salt"
exit 1
@ -174,7 +199,11 @@ if ( ! $? ) {
# Prep Salt for Packaging
#-------------------------------------------------------------------------------
& "$SCRIPT_DIR\prep_salt.ps1"
$KeywordArguments = @{}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
& "$SCRIPT_DIR\prep_salt.ps1" @KeywordArguments
if ( ! $? ) {
Write-Host "Failed to Prepare Salt for packaging"
exit 1
@ -188,6 +217,10 @@ $KeywordArguments = @{}
if ( ! [String]::IsNullOrEmpty($Version) ) {
$KeywordArguments.Add("Version", $Version)
}
if ( $CICD ) {
$KeywordArguments["CICD"] = $true
}
powershell -file "$SCRIPT_DIR\nsis\build_pkg.ps1" @KeywordArguments
if ( ! $? ) {

View file

@ -51,7 +51,12 @@ param(
[Alias("b")]
# Build python from source instead of fetching a tarball
# Requires VC Build Tools
[Switch] $Build
[Switch] $Build,
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
@ -68,9 +73,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}}
#-------------------------------------------------------------------------------
# Start the Script

View file

@ -20,6 +20,12 @@ build.ps1
build.ps1 -Version 3005 -PythonVersion 3.8.13
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -40,8 +46,12 @@ $RELENV_DIR = "${env:LOCALAPPDATA}\relenv"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -10,6 +10,12 @@ required to build the Salt installer
install_nsis.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -24,8 +30,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -13,6 +13,12 @@ ready to be packaged.
install_salt.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -27,8 +33,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -11,6 +11,12 @@ needed to build Python from source.
install_vc_buildtools.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -25,8 +31,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -9,6 +9,12 @@ This script installs the Wix Toolset and it's dependency .Net Framework 3.5
install_wix.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -28,8 +34,12 @@ function ProductcodeExists($productCode) {
}
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -18,7 +18,13 @@ param(
# The version of Salt to be built. If this is not passed, the script will
# attempt to get it from the git describe command on the Salt source
# repo
[String] $Version
[String] $Version,
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
@ -32,8 +38,12 @@ param(
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
function VerifyOrDownload ($local_file, $URL, $SHA256) {

View file

@ -17,7 +17,13 @@ param(
# The version of Salt to be built. If this is not passed, the script will
# attempt to get it from the git describe command on the Salt source
# repo
[String] $Version
[String] $Version,
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
@ -33,8 +39,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------

View file

@ -14,6 +14,12 @@ builds
prep_salt.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences
@ -28,8 +34,12 @@ $ErrorActionPreference = "Stop"
#-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
if ( $CICD ) {
Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
}
#-------------------------------------------------------------------------------