Skip to content

Commit 865b1cd

Browse files
committed
Added CI and command line building
1 parent 8f6b71a commit 865b1cd

13 files changed

Lines changed: 984 additions & 222 deletions

.github/debug_ssh_start.ps1

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Set-StrictMode -version latest;
2+
$ErrorActionPreference = "Stop";
3+
$VerbosePreference="Continue";
4+
5+
6+
$publicKey=(curl https://github.com/$($env:GITHUB_REPOSITORY_OWNER).keys) + " gh"
7+
Function InstallSshServer(){
8+
[CmdletBinding()]
9+
param(
10+
[Parameter(Mandatory=$true)]
11+
[String] $publicKey
12+
)
13+
Add-WindowsCapability -Online -Name OpenSSH.Server
14+
echo "PubkeyAuthentication yes`nPasswordAuthentication no`nSubsystem sftp sftp-server.exe`nMatch Group administrators`n`tAuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys`n" | out-file -Encoding ASCII $env:programData/ssh/sshd_config
15+
ssh-keygen -A
16+
echo "$publicKey`n" | out-file -Encoding ASCII $env:programData/ssh/administrators_authorized_keys
17+
icacls.exe "$env:programData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
18+
cat $env:programData/ssh/administrators_authorized_keys
19+
}
20+
Function DownloadStartCloudflareServer(){
21+
[CmdletBinding()]
22+
param(
23+
[Parameter(Mandatory=$true)]
24+
[String] $LocalHostnameAndPort, #ie 127.0.0.1:22
25+
[Parameter(Mandatory=$false)]
26+
[String] $SaveToFilename="cloudflared.exe" #can include path
27+
)
28+
if (([System.IO.File]::Exists($SaveToFilename)) -eq $false) {
29+
Invoke-WebRequest -URI https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile $SaveToFilename
30+
}
31+
$myargs = "tunnel --no-autoupdate --url tcp://$LocalHostnameAndPort --logfile cfd.log"
32+
#$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"$SaveToFilename`" $myargs ")
33+
$myjob = Start-Process -PassThru -NoNewWindow `"$SaveToFilename`" -ArgumentList $myargs
34+
35+
#Start-Job -Name CFD -ScriptBlock $scriptBlock
36+
#$myjob= Receive-Job -Name CFD
37+
return $myjob
38+
}
39+
Function InstallSSHStartCF(){
40+
[CmdletBinding()]
41+
param(
42+
[Parameter(Mandatory=$true)]
43+
[String] $publicKey,
44+
[Parameter(Mandatory=$false)]
45+
[String] $SaveToFilename="cloudflared.exe" #can include path
46+
)
47+
InstallSshServer $publicKey
48+
$server = DownloadStartCloudflareServer("127.0.0.1:22")
49+
$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"sshd.exe`" ")
50+
51+
Start-Job -Name SSHD -ScriptBlock $scriptBlock
52+
return $server
53+
}
54+
InstallSSHStartCF $publicKey
55+
while ($true) {
56+
Start-Sleep -Seconds 30
57+
cat cfd.log
58+
}
59+
#Wait-Job SSHD

.github/workflows/build.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- trash
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
strategy:
12+
matrix:
13+
configuration: [Debug, Release]
14+
defaults:
15+
run:
16+
shell: pwsh
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
23+
- name: Setup dotnet
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: |
27+
6
28+
8
29+
- name: Get .NET information
30+
run: dotnet --info
31+
32+
- name: Build
33+
run: ./build.ps1 -Configuration ${{ matrix.configuration }}
34+
35+
- name: Debug Session
36+
if: ${{ failure() && vars.DEBUG_FAIL == '1' && env.WLB_BUILD_TRACE == '1' }}
37+
run: .github/debug_ssh_start.ps1
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: NugetPackages-${{ matrix.configuration }}
42+
path: publish/*.nupkg

Directory.Build.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
<!-- This Directory.Build.props file applies to all projects in the solution -->
3+
<PropertyGroup>
4+
<!-- Skip WinUI projects during regular command line builds, but include them for NuGet packaging -->
5+
<BuildWinUIProjects Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildWinUIForNuGet)' != 'true'">false</BuildWinUIProjects>
6+
<BuildWinUIProjects Condition="'$(BuildWinUIProjects)' == ''">true</BuildWinUIProjects>
7+
8+
<!-- Common NuGet package properties -->
9+
<Authors Condition="'$(Authors)' == ''">MitchCapper</Authors>
10+
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">https://github.com/MitchCapper/EasyWindowsTerminalControl</PackageProjectUrl>
11+
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/MitchCapper/EasyWindowsTerminalControl</RepositoryUrl>
12+
<PackageLicenseExpression Condition="'$(PackageLicenseExpression)' == ''">MIT</PackageLicenseExpression>
13+
<Copyright Condition="'$(Copyright)' == ''">Copyright © MitchCapper $([System.DateTime]::Now.Year)</Copyright>
14+
<PackageTags Condition="'$(PackageTags)' == ''">terminal,console,windows,winui,wpf</PackageTags>
15+
</PropertyGroup>
16+
</Project>

Directory.Build.targets

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project>
2+
<!-- This file applies to all projects in the solution -->
3+
<PropertyGroup>
4+
<!-- Only apply these settings when building from command line (not in Visual Studio) -->
5+
<GeneratePriEnabled Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">false</GeneratePriEnabled>
6+
<GenerateProjectSpecificOutputFolder Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">false</GenerateProjectSpecificOutputFolder>
7+
<WindowsAppSDKSelfContained Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">true</WindowsAppSDKSelfContained>
8+
<SelfContained Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">true</SelfContained>
9+
10+
<!-- Completely disable MRT and PRI tasks -->
11+
<MrtCoreEnabled Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">false</MrtCoreEnabled>
12+
<DisableMsixProjectCapabilityAddedByProject>true</DisableMsixProjectCapabilityAddedByProject>
13+
<EnableMsixTooling Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'">false</EnableMsixTooling>
14+
</PropertyGroup>
15+
16+
<!-- Direct MSBuild to skip the problematic targets -->
17+
<Target Name="ExpandPriContent"
18+
Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'" />
19+
<Target Name="MrtProcessResourcePriFiles"
20+
Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'" />
21+
<Target Name="GenerateProjectPriFile"
22+
Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true'" />
23+
</Project>
Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4-
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
5-
<RootNamespace>EasyWindowsTerminalControl.WinUI</RootNamespace>
6-
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
7-
<UseWinUI>true</UseWinUI>
8-
<Platforms>AnyCPU;x64</Platforms>
9-
<Version>1.0.1-beta.1</Version>
10-
<Description>High performance WinUI3 native terminal/shell control. For WPF version see EasyWindowsTerminalControl alt package. It features full 24-bit color support with ANSI/VT escape sequences (and colors), hardware / GPU accelerated rendering, mouse support, and true console interaction. Support for command shells and key sequences, user interaction and programatic control. See GH for more details.</Description>
11-
</PropertyGroup>
12-
<ItemGroup>
13-
<AdditionalFiles Include="NativeMethods.txt" />
14-
</ItemGroup>
15-
<ItemGroup>
16-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
17-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" />
18-
</ItemGroup>
19-
<ItemGroup>
20-
<Compile Include="..\EasyWindowsTerminalControl\EasyTerminalControl.cs" Link="EasyTerminalControl.cs" />
21-
<Compile Include="..\EasyWindowsTerminalControl\Internals\Process.cs" Link="Internals\Process.cs" />
22-
<Compile Include="..\EasyWindowsTerminalControl\Internals\ProcessFactory.cs" Link="Internals\ProcessFactory.cs" />
23-
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsole.cs" Link="Internals\PseudoConsole.cs" />
24-
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsoleApi.cs" Link="Internals\PseudoConsoleApi.cs" />
25-
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsolePipe.cs" Link="Internals\PseudoConsolePipe.cs" />
26-
<Compile Include="..\EasyWindowsTerminalControl\ReadDelimitedTermPTY.cs" Link="ReadDelimitedTermPTY.cs" />
27-
<Compile Include="..\EasyWindowsTerminalControl\TermPTY.cs" Link="TermPTY.cs" />
28-
</ItemGroup>
29-
<!--<ItemGroup>
30-
<None Include="..\TermExample\Microsoft.Terminal.Control.dll" Link="Microsoft.Terminal.Control.dll">
31-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32-
</None>
33-
</ItemGroup>-->
34-
<ItemGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
5+
<RootNamespace>EasyWindowsTerminalControl.WinUI</RootNamespace>
6+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
7+
<UseWinUI>true</UseWinUI>
8+
<Platforms>AnyCPU;x64</Platforms>
9+
<Version>1.0.15-beta.1</Version>
10+
<Description>High performance WinUI3 native terminal/shell control. For WPF version see EasyWindowsTerminalControl alt package. It features full 24-bit color support with ANSI/VT escape sequences (and colors), hardware / GPU accelerated rendering, mouse support, and true console interaction. Support for command shells and key sequences, user interaction and programatic control. See GH for more details.</Description>
11+
<PackageReadmeFile>README.md</PackageReadmeFile>
12+
<Authors>MitchCapper</Authors>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
<PackageOutputPath>../Publish</PackageOutputPath>
15+
<PackageProjectUrl>https://github.com/MitchCapper/EasyWindowsTerminalControl</PackageProjectUrl>
16+
17+
<!-- Include NuGet packaging settings -->
18+
<IncludeBuildOutput>true</IncludeBuildOutput>
19+
<NoWarn>$(NoWarn);NU5128</NoWarn>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<AdditionalFiles Include="NativeMethods.txt" />
24+
<None Include="../README.md" Pack="true" PackagePath="\"/>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<Compile Include="..\EasyWindowsTerminalControl\EasyTerminalControl.cs" Link="EasyTerminalControl.cs" />
32+
<Compile Include="..\EasyWindowsTerminalControl\Internals\Process.cs" Link="Internals\Process.cs" />
33+
<Compile Include="..\EasyWindowsTerminalControl\Internals\ProcessFactory.cs" Link="Internals\ProcessFactory.cs" />
34+
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsole.cs" Link="Internals\PseudoConsole.cs" />
35+
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsoleApi.cs" Link="Internals\PseudoConsoleApi.cs" />
36+
<Compile Include="..\EasyWindowsTerminalControl\Internals\PseudoConsolePipe.cs" Link="Internals\PseudoConsolePipe.cs" />
37+
<Compile Include="..\EasyWindowsTerminalControl\ReadDelimitedTermPTY.cs" Link="ReadDelimitedTermPTY.cs" />
38+
<Compile Include="..\EasyWindowsTerminalControl\TermPTY.cs" Link="TermPTY.cs" />
39+
</ItemGroup>
40+
<ItemGroup>
3541
<PackageReference Include="CI.Microsoft.Windows.Console.ConPTY" Version="1.22.250314001" />
36-
<PackageReference Include="CI.Microsoft.Terminal.WinUI3.Unofficial" Version="1.0.1-beta.1" PrivateAssets="None" />
37-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
38-
<PrivateAssets>all</PrivateAssets>
39-
</PackageReference>
40-
</ItemGroup>
41-
<!--<ItemGroup>
42-
<ProjectReference Include="..\Microsoft.Terminal.WinUI3\Microsoft.Terminal.WinUI3.csproj" />
43-
</ItemGroup>-->
42+
<PackageReference Include="CI.Microsoft.Terminal.WinUI3.Unofficial" Version="1.0.15-beta.1" />
43+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
44+
<PrivateAssets>all</PrivateAssets>
45+
</PackageReference>
46+
</ItemGroup>
4447
</Project>

EasyWindowsTerminalControl.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Terminal.WinUI3", "Microsoft.Terminal.WinUI3\Microsoft.Terminal.WinUI3.csproj", "{EAE4A2C3-203E-43DD-BADE-63611B1489DF}"
1111
EndProject
1212
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyWindowsTerminalControl.WinUI", "EasyWindowsTerminalControl.WinUI\EasyWindowsTerminalControl.WinUI.csproj", "{0DC813BE-F9B4-43BC-9F5B-E4A50FD86CB6}"
13+
ProjectSection(ProjectDependencies) = postProject
14+
{EAE4A2C3-203E-43DD-BADE-63611B1489DF} = {EAE4A2C3-203E-43DD-BADE-63611B1489DF}
15+
EndProjectSection
1316
EndProject
1417
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TermExample.WinUI", "TermExample.WinUI\TermExample.WinUI.csproj", "{63F66283-5142-4B8E-BF28-FF434AF08B0B}"
18+
ProjectSection(ProjectDependencies) = postProject
19+
{0DC813BE-F9B4-43BC-9F5B-E4A50FD86CB6} = {0DC813BE-F9B4-43BC-9F5B-E4A50FD86CB6}
20+
EndProjectSection
1521
EndProject
1622
Global
1723
GlobalSection(SolutionConfigurationPlatforms) = preSolution

EasyWindowsTerminalControl/EasyWindowsTerminalControl.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
<PlatformTarget>x64</PlatformTarget>
66
<Platforms>x64</Platforms>
77
<UseWpf>true</UseWpf>
8-
<Version>1.0.18</Version>
8+
<Version>1.0.33</Version>
9+
<PackageReadmeFile>README.md</PackageReadmeFile>
10+
<PackageOutputPath>../Publish</PackageOutputPath>
11+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
912
</PropertyGroup>
1013

1114
<PropertyGroup>
1215
<DefineConstants>$(DefineConstants);WPF</DefineConstants>
1316
</PropertyGroup>
1417

1518
<ItemGroup>
16-
<None Remove="NativeMethods.txt" />
19+
<None Remove="NativeMethods.txt" />
20+
<None Include="../README.md" Pack="true" PackagePath="\"/>
21+
1722
</ItemGroup>
1823

1924
<ItemGroup>

0 commit comments

Comments
 (0)