From ad219159191292eb6e805768cb029af1711c8fae Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 25 Sep 2023 15:59:10 -0400 Subject: [PATCH] Add pack code for windows terminal --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++-- packignore | 1 + scripts/build.ps1 | 20 ++++++++++++-------- scripts/pack.ps1 | 14 ++++++++------ 4 files changed, 50 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 148ad619..bc3075ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,10 +47,34 @@ jobs: working-directory: scripts run: .\build.ps1 -Compile -verbose - - name: Pack the built files + - name: Pack the built files with Windows Terminal shell: pwsh working-directory: scripts - run: .\pack.ps1 -verbose + run: .\pack.ps1 -verbose -emulator windows-terminal + + - name: Pack the built files with ConEmu + shell: pwsh + working-directory: scripts + run: .\pack.ps1 -verbose -emulator conemu + + - name: Upload artifact (cmder_wt.zip) + uses: actions/upload-artifact@v3 + with: + path: build/cmder_wt.zip + name: cmder_wt.zip + if-no-files-found: error + + - name: Upload artifact (cmder_wt.7z) + uses: actions/upload-artifact@v3 + with: + path: build/cmder_wt.7z + name: cmder_wt.7z + + - name: Upload artifact (cmder_wt_mini.zip) + uses: actions/upload-artifact@v3 + with: + path: build/cmder_wt_mini.zip + name: cmder_wt_mini.zip - name: Upload artifact (cmder.zip) uses: actions/upload-artifact@v3 @@ -82,8 +106,11 @@ jobs: with: files: | build/cmder.zip + build/cmder_wt.zip build/cmder.7z + build/cmder_wt.7z build/cmder_mini.zip + build/cmder_wt_mini.zip build/hashes.txt draft: true generate_release_notes: true diff --git a/packignore b/packignore index 1fd4315d..7059f3cc 100644 --- a/packignore +++ b/packignore @@ -23,5 +23,6 @@ appveyor.yml vendor\cmder.sh vendor\git-prompt.sh config\user-* +config\user_* clink_history* *.log diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 739bc4f2..e82193ec 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -56,8 +56,8 @@ Param( # Using this option will skip all downloads, if you only need to build launcher [switch]$noVendor, - # Using this option will specify the emulator to use [conemu-maximus5, or windows-terminal] - [string]$emulator = 'conemu-maximus5', + # Using this option will specify the emulator to use [all, conemu-maximus5, or windows-terminal] + [string]$emulator = 'all', # Build launcher if you have MSBuild tools installed [switch]$Compile @@ -153,6 +153,16 @@ if (-not $noVendor) { Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop Extract-Archive $tempArchive $s.name + # Make Embedded Windows Terminal Portable + if ($s.name -eq "windows-terminal") { + $windowTerminalFiles = resolve-path ($saveTo + "\" + $s.name + "\terminal*") + move-item -ErrorAction SilentlyContinue $windowTerminalFiles\* $s.name >$null + remove-item -ErrorAction SilentlyContinue $windowTerminalFiles >$null + write-verbose "Making Windows Terminal Portable..." + New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null + New-Item -Type File -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null + } + if ((Get-ChildItem $s.name).Count -eq 1) { Flatten-Directory($s.name) } @@ -173,12 +183,6 @@ if (-not $noVendor) { Copy-Item $WinTermSettingsJsonSave $WinTermSettingsJson } - # Make Embedded Windows Terminal Portable - if ($emulator -eq "windows-terminal") { - New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null - New-Item -Type leaf -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null - } - # 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") ) ) { Write-Verbose "Adding cmder.sh /etc/profile.d" diff --git a/scripts/pack.ps1 b/scripts/pack.ps1 index 3a2236d6..9cd2cb76 100644 --- a/scripts/pack.ps1 +++ b/scripts/pack.ps1 @@ -46,14 +46,16 @@ Ensure-Executable "7z" if ($emulator -eq "windows-terminal") { $targets = @{ - "cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on"; - "cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3"; - "cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`""; + "cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`""; + "cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`""; + "cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`""; + } } else { $targets = @{ - "cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on"; - "cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3"; - "cmder_mini.zip" = "-xr!`"vendor\git-for-windows`""; + "cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`""; + "cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`""; + "cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`""; + } } Push-Location -Path $cmderRoot