echo messages for github actions

This commit is contained in:
David Refoua 2022-10-15 13:49:02 +03:30
parent 7856b3ab57
commit f9cb2d6264
2 changed files with 20 additions and 14 deletions

View File

@ -29,7 +29,7 @@
Samuel Vasko, Jack Bennett Samuel Vasko, Jack Bennett
Part of the Cmder project. Part of the Cmder project.
.LINK .LINK
http://cmder.net/ - Project Home http://cmder.app/ - Project Home
#> #>
[CmdletBinding(SupportsShouldProcess=$true)] [CmdletBinding(SupportsShouldProcess=$true)]
Param( Param(
@ -83,15 +83,15 @@ if ($config -ne "") {
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building # Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
foreach ($ssh_agent in $(get-process ssh-agent -erroraction silentlycontinue)) { foreach ($ssh_agent in $(get-process ssh-agent -erroraction silentlycontinue)) {
if ([string]$($ssh_agent.path) -match [string]$cmder_root.replace('\','\\')) { if ([string]$($ssh_agent.path) -match [string]$cmder_root.replace('\','\\')) {
write-verbose $("Stopping " + $ssh_agent.path + "!") Write-Verbose $("Stopping " + $ssh_agent.path + "!")
stop-process $ssh_agent.id Stop-Process $ssh_agent.id
} }
} }
$vend = $pwd $vend = $pwd
foreach ($s in $sources) { foreach ($s in $sources) {
Write-Verbose "Getting $($s.name) from URL $($s.url)" Write-Verbose "Downloading $($s.name) from URL $($s.url)"
# We do not care about the extensions/type of archive # We do not care about the extensions/type of archive
$tempArchive = "tmp/$($s.name).tmp" $tempArchive = "tmp/$($s.name).tmp"
@ -122,13 +122,16 @@ if($Compile) {
# https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference # https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release /m msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release /m
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
throw "msbuild failed to build the executable." throw "MSBuild failed to build the executable."
} }
else { else {
Write-Verbose "successfully built Cmder v$version!" Write-Verbose "Successfully built Cmder v$version!"
if ( $Env:APPVEYOR -eq 'True' ) { if ( $Env:APPVEYOR -eq 'True' ) {
Add-AppveyorMessage -Message "Building Cmder v$version was successful." -Category Information Add-AppveyorMessage -Message "Building Cmder v$version was successful." -Category Information
} }
if ( $Env:GITHUB_ACTIONS -eq 'true' ) {
Write-Output "::notice title=Build Complete::Building Cmder v$version was successful."
}
} }
Pop-Location Pop-Location
} else { } else {
@ -138,15 +141,15 @@ if($Compile) {
# Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty # Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty
if ( (Test-Path $($SaveTo + "git-for-windows/etc/profile.d") ) ) { if ( (Test-Path $($SaveTo + "git-for-windows/etc/profile.d") ) ) {
write-verbose "Adding cmder.sh /etc/profile.d" Write-Verbose "Adding cmder.sh /etc/profile.d"
Copy-Item $($SaveTo + "cmder.sh") $($SaveTo + "git-for-windows/etc/profile.d/cmder.sh") Copy-Item $($SaveTo + "cmder.sh") $($SaveTo + "git-for-windows/etc/profile.d/cmder.sh")
} }
# Replace /etc/profile.d/git-prompt.sh with cmder lambda prompt so it runs when we start bash or mintty # Replace /etc/profile.d/git-prompt.sh with cmder lambda prompt so it runs when we start bash or mintty
if ( !(Test-Path $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak") ) ) { if ( !(Test-Path $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak") ) ) {
write-verbose "Replacing /etc/profile.d/git-prompt.sh with our git-prompt.sh" Write-Verbose "Replacing /etc/profile.d/git-prompt.sh with our git-prompt.sh"
Move-Item $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak") Move-Item $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak")
Copy-Item $($SaveTo + "git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh") Copy-Item $($SaveTo + "git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh")
} }
Write-Verbose "All good and done!" Write-Host -ForegroundColor green "All good and done!"

View File

@ -88,6 +88,9 @@ function Get-VersionStr() {
if ( $Env:APPVEYOR -eq 'True' ) { if ( $Env:APPVEYOR -eq 'True' ) {
$string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER $string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER
} }
elseif ( $Env:GITHUB_ACTIONS -eq 'true' ) {
$string = $string + '.' + $Env:GITHUB_RUN_NUMBER
}
# Remove starting 'v' characters # Remove starting 'v' characters
$string = $string -replace '^v+','' # normalize version string $string = $string -replace '^v+','' # normalize version string