@@ -28,23 +28,95 @@ jobs:
2828 - name : Build
2929 run : dotnet build "ThreadPilot_1.sln" --configuration Release --no-restore
3030
31- - name : Publish self-contained app
32- run : dotnet publish "ThreadPilot.csproj " --configuration Release --runtime win-x64 --self-contained true -o artifacts/release/win-x64
31+ - name : Test
32+ run : dotnet test "ThreadPilot_1.sln " --configuration Release --no-build
3333
34- - name : Create release package
34+ - name : Publish self-contained single-file
35+ run : dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-SingleFile
36+
37+ - name : Publish ReadyToRun
38+ run : dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-ReadyToRun
39+
40+ - name : Publish MSIX
41+ run : dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-MSIX
42+
43+ - name : Validate MSIX output
44+ shell : pwsh
45+ run : |
46+ $ErrorActionPreference = "Stop"
47+ $msixFiles = Get-ChildItem "artifacts/release/msix" -Recurse -File -Include *.msix,*.appx,*.msixbundle,*.appxbundle -ErrorAction SilentlyContinue
48+ if (-not $msixFiles)
49+ {
50+ throw "MSIX package generation failed: no package artifacts found in artifacts/release/msix."
51+ }
52+
53+ Write-Host "MSIX artifacts found: $($msixFiles.Count)"
54+
55+ - name : Prepare signing certificate (optional)
56+ shell : pwsh
57+ run : |
58+ $ErrorActionPreference = "Stop"
59+ if ([string]::IsNullOrWhiteSpace($env:WINDOWS_SIGNING_CERT_BASE64) -or [string]::IsNullOrWhiteSpace($env:WINDOWS_SIGNING_CERT_PASSWORD))
60+ {
61+ Write-Host "Signing secrets not provided via environment variables. Skipping certificate preparation."
62+ exit 0
63+ }
64+
65+ $certPath = Join-Path $env:RUNNER_TEMP "threadpilot-signing.pfx"
66+ [System.IO.File]::WriteAllBytes($certPath, [System.Convert]::FromBase64String($env:WINDOWS_SIGNING_CERT_BASE64))
67+ "THREADPILOT_SIGN_CERT_PATH=$certPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
68+
69+ - name : Sign binaries and packages (optional)
70+ shell : pwsh
71+ run : |
72+ $ErrorActionPreference = "Stop"
73+ if ([string]::IsNullOrWhiteSpace($env:THREADPILOT_SIGN_CERT_PATH) -or -not (Test-Path $env:THREADPILOT_SIGN_CERT_PATH))
74+ {
75+ Write-Host "No signing certificate prepared. Skipping signing step."
76+ exit 0
77+ }
78+
79+ if (-not (Get-Command signtool.exe -ErrorAction SilentlyContinue))
80+ {
81+ throw "signtool.exe not found on runner; install Windows SDK or disable signing."
82+ }
83+
84+ $timestampUrl = "http://timestamp.digicert.com"
85+ $password = $env:WINDOWS_SIGNING_CERT_PASSWORD
86+ $targets = @()
87+ $targets += Get-ChildItem "artifacts/release/singlefile" -Recurse -File -Include *.exe -ErrorAction SilentlyContinue
88+ $targets += Get-ChildItem "artifacts/release/readytorun" -Recurse -File -Include *.exe -ErrorAction SilentlyContinue
89+ $targets += Get-ChildItem "artifacts/release/msix" -Recurse -File -Include *.msix,*.appx,*.msixbundle,*.appxbundle -ErrorAction SilentlyContinue
90+
91+ foreach ($target in $targets)
92+ {
93+ signtool.exe sign /fd SHA256 /tr $timestampUrl /td SHA256 /f "$env:THREADPILOT_SIGN_CERT_PATH" /p $password "$($target.FullName)"
94+ }
95+
96+ - name : Create release packages
3597 shell : pwsh
3698 run : |
3799 $ErrorActionPreference = "Stop"
38100 $version = "${{ github.ref_name }}"
39- $zipName = "ThreadPilot_$version`_win-x64.zip"
40- Compress-Archive -Path "artifacts/release/win-x64/*" -DestinationPath "artifacts/release/$zipName" -Force
101+ New-Item -ItemType Directory -Force -Path "artifacts/release/packages" | Out-Null
102+
103+ $singleFileZip = "artifacts/release/packages/ThreadPilot_$version`_singlefile_win-x64.zip"
104+ $readyToRunZip = "artifacts/release/packages/ThreadPilot_$version`_readytorun_win-x64.zip"
105+
106+ Compress-Archive -Path "artifacts/release/singlefile/*" -DestinationPath $singleFileZip -Force
107+ Compress-Archive -Path "artifacts/release/readytorun/*" -DestinationPath $readyToRunZip -Force
41108
42109 - name : Generate checksums
43110 shell : pwsh
44111 run : |
45112 $ErrorActionPreference = "Stop"
46113 $hashFile = "artifacts/release/SHA256SUMS.txt"
47- Get-ChildItem "artifacts/release" -File | ForEach-Object {
114+
115+ $releaseFiles = @()
116+ $releaseFiles += Get-ChildItem "artifacts/release/packages" -File -ErrorAction SilentlyContinue
117+ $releaseFiles += Get-ChildItem "artifacts/release/msix" -Recurse -File -Include *.msix,*.appx,*.msixbundle,*.appxbundle -ErrorAction SilentlyContinue
118+
119+ $releaseFiles | ForEach-Object {
48120 $hash = Get-FileHash $_.FullName -Algorithm SHA256
49121 "$($hash.Hash) $($_.Name)" | Out-File -FilePath $hashFile -Append -Encoding utf8
50122 }
@@ -53,6 +125,10 @@ jobs:
53125 uses : softprops/action-gh-release@v2
54126 with :
55127 files : |
56- artifacts/release/*.zip
128+ artifacts/release/packages/*.zip
129+ artifacts/release/msix/**/*.msix
130+ artifacts/release/msix/**/*.appx
131+ artifacts/release/msix/**/*.msixbundle
132+ artifacts/release/msix/**/*.appxbundle
57133 artifacts/release/SHA256SUMS.txt
58134 generate_release_notes : true
0 commit comments