From 478328896c99eb9dce50ab04ee56387d10923158 Mon Sep 17 00:00:00 2001 From: ergosteur <1992147+ergosteur@users.noreply.github.com> Date: Mon, 16 Mar 2026 12:47:44 -0400 Subject: [PATCH] Update GitHub Actions workflow for build and release add shell script and batch file to release artifacts --- .github/workflows/build.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02a69aa..96cb0fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,18 +3,21 @@ name: Build and Release on: push: tags: - - 'v*' # Triggers only on tags starting with 'v' (e.g., v1.0.0) - workflow_dispatch: # Allows manual runs from the Actions tab + - 'v*' + workflow_dispatch: jobs: build: runs-on: windows-latest permissions: - contents: write # Essential for creating the release and uploading assets + contents: write steps: - name: Checkout repository uses: actions/checkout@v4 + with: + # Prevents git from automatically converting LF to CRLF during checkout + autocrlf: input - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -30,20 +33,25 @@ jobs: --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true + - name: Ensure Unix Line Endings for Shell Script + shell: pwsh + run: | + $path = "ssh-handler.sh" + $content = Get-Content -Raw $path + # Replace CRLF with LF just in case + $content = $content -replace "`r`n", "`n" + [System.IO.File]::WriteAllText((Get-Item $path).FullName, $content, (New-Object System.Text.UTF8Encoding($false))) + - name: Create GitHub Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') # Only runs if the trigger was a tag + if: startsWith(github.ref, 'refs/tags/') with: - files: ${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe + files: | + ${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe + ssh-handler.sh + openssh_protocol_handler.bat generate_release_notes: true draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload artifact (Manual Run fallback) - uses: actions/upload-artifact@v4 - if: always() # Still uploads the artifact even if it wasn't a tag run - with: - name: SshHandler-Windows-Executable - path: ${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe