Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/build-linux-macos-matrix.yaml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/build-linux-macos-windows-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build Linux/macOS/Windows Binaries

on:
push:
branches: [ dev ]
workflow_dispatch:

jobs:
build-all:
name: Build for ${{ matrix.runtime }}
runs-on: ubuntu-latest

strategy:
matrix:
runtime:
- linux-x64
- linux-musl-x64
- linux-musl-arm64
- linux-arm
- linux-arm64
- osx-x64
- osx-arm64
- win-x64
- win-x86
- win-arm64

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Publish ${{ matrix.runtime }} Binary
run: >
dotnet publish ssh-c.csproj
-c Release
-r ${{ matrix.runtime }}
--self-contained true
-p:PublishSingleFile=true
-p:PublishTrimmed=true
-p:EnableCompressionInSingleFile=true
-p:IncludeNativeLibrariesForSelfExtract=true
-o publish/${{ matrix.runtime }}

- name: Rename published binary to ssh-c or ssh-c.exe
run: |
path=publish/${{ matrix.runtime }}
if [ -f "$path/com.repasscloud.ssh-c" ]; then
mv "$path/com.repasscloud.ssh-c" "$path/ssh-c"
elif [ -f "$path/com.repasscloud.ssh-c.exe" ]; then
mv "$path/com.repasscloud.ssh-c.exe" "$path/ssh-c.exe"
else
echo "❌ No output binary found to rename."
exit 1
fi

- name: Make binary executable (non-Windows only)
run: |
path=publish/${{ matrix.runtime }}
if [ -f "$path/ssh-c" ]; then
chmod +x "$path/ssh-c"
fi

- name: Verify binary format
run: |
path=publish/${{ matrix.runtime }}
if [ -f "$path/ssh-c" ]; then
file "$path/ssh-c"
elif [ -f "$path/ssh-c.exe" ]; then
file "$path/ssh-c.exe"
fi

- name: Generate SHA256 checksum
run: |
path=publish/${{ matrix.runtime }}
if [ -f "$path/ssh-c" ]; then
sha256sum "$path/ssh-c" > "$path/ssh-c_${{ matrix.runtime }}.sha256"
elif [ -f "$path/ssh-c.exe" ]; then
sha256sum "$path/ssh-c.exe" > "$path/ssh-c_${{ matrix.runtime }}.sha256"
fi

- name: Zip binary and checksum
run: |
cd publish/${{ matrix.runtime }}
if [ -f ssh-c ]; then
zip ssh-c_${{ matrix.runtime }}.zip ssh-c ssh-c_${{ matrix.runtime }}.sha256
elif [ -f ssh-c.exe ]; then
zip ssh-c_${{ matrix.runtime }}.zip ssh-c.exe ssh-c_${{ matrix.runtime }}.sha256
fi

- name: Upload Zipped Artifacts
uses: actions/upload-artifact@v4
with:
name: ssh-c-${{ matrix.runtime }}-unsigned
path: publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.zip
63 changes: 59 additions & 4 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ permissions:
contents: write

jobs:
release-linux-windows:
name: Build Release Assets (Linux + Windows)
release-linux:
name: Build Release Assets (Linux)
runs-on: ubuntu-latest

strategy:
matrix:
runtime: [win-x64, linux-x64]
runtime:
- linux-x64
- linux-musl-x64
- linux-musl-arm64
- linux-arm
- linux-arm64

steps:
- name: Checkout
Expand Down Expand Up @@ -54,13 +59,63 @@ jobs:
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.zip
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.sha256

release-windows:
name: Build Release Assets (Windows)
runs-on: windows-latest

strategy:
matrix:
runtime:
- win-x64
- win-x86
- win-arm64

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Publish (${{ matrix.runtime }})
run: |
dotnet publish ssh-c.csproj \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:EnableCompressionInSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-o publish/${{ matrix.runtime }}

- name: Rename binary
run: Rename-Item -Path publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe -NewName ssh-c.exe

- name: Archive binary
run: |
cd publish/${{ matrix.runtime }}
Compress-Archive -Path ssh-c.exe -DestinationPath ssh-c-${{ matrix.runtime }}.zip
Get-FileHash -Algorithm SHA256 ssh-c-${{ matrix.runtime }}.zip | ForEach-Object { $_.Hash } > ssh-c-${{ matrix.runtime }}.sha256

- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: |
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.zip
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.sha256

release-macos:
name: Build Release Assets (macOS)
runs-on: macos-latest

strategy:
matrix:
runtime: [osx-x64, osx-arm64]
runtime:
- osx-x64
- osx-arm64

steps:
- name: Checkout
Expand Down
34 changes: 15 additions & 19 deletions .github/workflows/signpath-windows-release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: SignPath Windows Release

on:
push:
branches: [ dev ]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -31,18 +29,21 @@ jobs:

- name: Publish Windows ${{ matrix.runtime }} EXE
run: >
dotnet publish ssh-c.csproj \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:EnableCompressionInSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-o publish/${{ matrix.runtime }}
dotnet publish ssh-c.csproj
-c Release
-r ${{ matrix.runtime }}
--self-contained true
-p:PublishSingleFile=true
-p:PublishTrimmed=true
-p:EnableCompressionInSingleFile=true
-p:IncludeNativeLibrariesForSelfExtract=true
-o publish/${{ matrix.runtime }}

- name: Rename binary before signing
run: mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe publish/${{ matrix.runtime }}/ssh-c.exe
- name: Rename binary
run: >
if [ -f publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe ]; then
mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe publish/${{ matrix.runtime }}/ssh-c.exe
fi

- name: Install SignPath PowerShell module
shell: pwsh
Expand All @@ -59,14 +60,9 @@ jobs:
-OrganizationId "7986306f-df77-4bb0-b011-dc2e6289232e" `
-ProjectSlug "SSH-C" `
-SigningPolicySlug "ssh-c_DEV_Release" `
-OutputArtifactPath "publish/${{ matrix.runtime }}/ssh-c.signed.exe" `
-OutputArtifactPath "publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe" `
-WaitForCompletion

- name: Replace original EXE with signed version
run: >
rm publish/${{ matrix.runtime }}/ssh-c.exe && \
mv publish/${{ matrix.runtime }}/ssh-c.signed.exe publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe

- name: Generate SHA256 checksum
run: >
sha256sum publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe > publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe.sha256
Expand Down