mirror of
https://github.com/ergosteur/ssh-protocol-handler-win.git
synced 2026-04-19 13:39:33 -04:00
Configure Git line endings and enhance script checks
Added a step to configure Git line endings and improved the shell script to check for file existence before processing.
This commit is contained in:
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -15,8 +15,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
autocrlf: input
|
# This replaces the invalid 'autocrlf' input
|
||||||
|
- name: Configure Git Line Endings
|
||||||
|
run: git config --global core.autocrlf input
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
@@ -42,15 +44,18 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$path = "ssh-handler.sh"
|
$path = "ssh-handler.sh"
|
||||||
|
if (Test-Path $path) {
|
||||||
$content = [System.IO.File]::ReadAllText((Get-Item $path).FullName)
|
$content = [System.IO.File]::ReadAllText((Get-Item $path).FullName)
|
||||||
$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)))
|
||||||
|
Write-Host "Successfully converted $path to LF"
|
||||||
|
}
|
||||||
|
|
||||||
- name: Prepare Assets with Versioning
|
- name: Prepare Assets with Versioning
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ github.ref_name }}"
|
$tag = "${{ github.ref_name }}"
|
||||||
if (-not $tag) { $tag = "manual" }
|
if (-not $tag -or $tag -eq "main") { $tag = "manual" }
|
||||||
|
|
||||||
# Rename Executables
|
# Rename Executables
|
||||||
Move-Item ./publish-standalone/SshHandler.exe "./SshHandler-$tag-Standalone.exe"
|
Move-Item ./publish-standalone/SshHandler.exe "./SshHandler-$tag-Standalone.exe"
|
||||||
|
|||||||
Reference in New Issue
Block a user