Files
ssh-protocol-handler-win/.github/workflows/build.yml
T
Claude 905487ce82 Replace .NET WinForms handler with the Rust build in CI; drop SshHandler
Remove the .NET/WinForms project (SshHandler/, SshHandler.sln) now that
the Rust rewrite (SshHandlerRs/) covers the same behavior with a
~250KB binary and no CLR startup cost, and its Default-Apps-style
registration is confirmed working.

Rewire the release workflow to build ssh-handler.exe natively on
windows-latest with the MSVC toolchain instead of dotnet publish, and
package it alongside the .bat and .sh handlers as release assets
(ssh-handler-rs-*.exe, openssh_protocol_handler-*.bat,
ssh-handler-*.sh) when a v* tag is pushed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYCT2RpUjFfBfp6CD4rREw
2026-09-08 17:16:38 +00:00

64 lines
1.8 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Build ssh-handler (Rust)
working-directory: SshHandlerRs
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Ensure Unix Line Endings for Shell Script
shell: pwsh
run: |
$path = "ssh-handler.sh"
if (Test-Path $path) {
$content = [System.IO.File]::ReadAllText((Get-Item $path).FullName)
$content = $content -replace "`r`n", "`n"
[System.IO.File]::WriteAllText((Get-Item $path).FullName, $content, (New-Object System.Text.UTF8Encoding($false)))
}
- name: Prepare Assets with Versioning
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
if (-not $tag -or $tag -eq "main") { $tag = "manual" }
# Rename Rust executable
Move-Item SshHandlerRs/target/x86_64-pc-windows-msvc/release/ssh-handler.exe "./ssh-handler-rs-$tag.exe"
# Rename Scripts
Copy-Item "ssh-handler.sh" "./ssh-handler-$tag.sh"
Copy-Item "openssh_protocol_handler.bat" "./openssh_protocol_handler-$tag.bat"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
ssh-handler-rs-*.exe
ssh-handler-*.sh
openssh_protocol_handler-*.bat
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}