mirror of
https://github.com/ergosteur/ssh-protocol-handler-win.git
synced 2026-04-19 13:39:33 -04:00
Update GitHub Actions workflow for .NET builds
add both stanadalone and .net builds, versioned filenames
This commit is contained in:
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@@ -16,7 +16,6 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Prevents git from automatically converting LF to CRLF during checkout
|
|
||||||
autocrlf: input
|
autocrlf: input
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -27,29 +26,49 @@ jobs:
|
|||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
|
|
||||||
- name: Build and publish self-contained executable
|
- name: Build Standalone (Includes Runtime)
|
||||||
run: >
|
run: >
|
||||||
dotnet publish --configuration Release --runtime win-x64
|
dotnet publish SshHandler/SshHandler.csproj --configuration Release --runtime win-x64
|
||||||
--self-contained true /p:PublishSingleFile=true
|
--self-contained true /p:PublishSingleFile=true
|
||||||
/p:IncludeNativeLibrariesForSelfExtract=true
|
-o ./publish-standalone
|
||||||
|
|
||||||
|
- name: Build Framework-Dependent (Requires .NET 8)
|
||||||
|
run: >
|
||||||
|
dotnet publish SshHandler/SshHandler.csproj --configuration Release
|
||||||
|
--self-contained false /p:PublishSingleFile=true
|
||||||
|
-o ./publish-dotnet8
|
||||||
|
|
||||||
- name: Ensure Unix Line Endings for Shell Script
|
- name: Ensure Unix Line Endings for Shell Script
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$path = "ssh-handler.sh"
|
$path = "ssh-handler.sh"
|
||||||
$content = Get-Content -Raw $path
|
$content = [System.IO.File]::ReadAllText((Get-Item $path).FullName)
|
||||||
# Replace CRLF with LF just in case
|
|
||||||
$content = $content -replace "`r`n", "`n"
|
$content = $content -replace "`r`n", "`n"
|
||||||
[System.IO.File]::WriteAllText((Get-Item $path).FullName, $content, (New-Object System.Text.UTF8Encoding($false)))
|
[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) { $tag = "manual" }
|
||||||
|
|
||||||
|
# Rename Executables
|
||||||
|
Move-Item ./publish-standalone/SshHandler.exe "./SshHandler-$tag-Standalone.exe"
|
||||||
|
Move-Item ./publish-dotnet8/SshHandler.exe "./SshHandler-$tag-dotnet8.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
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe
|
SshHandler-*-Standalone.exe
|
||||||
ssh-handler.sh
|
SshHandler-*-dotnet8.exe
|
||||||
openssh_protocol_handler.bat
|
ssh-handler-*.sh
|
||||||
|
openssh_protocol_handler-*.bat
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|||||||
Reference in New Issue
Block a user