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
24 changes: 13 additions & 11 deletions .github/workflows/build-linux-macos-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,32 @@ jobs:
-c Release
-r ${{ matrix.runtime }}
--self-contained true
/p:PublishSingleFile=true
/p:PublishTrimmed=true
/p:EnableCompressionInSingleFile=true
/p:IncludeNativeLibrariesForSelfExtract=true
-p:PublishSingleFile=true
-p:PublishTrimmed=true
-p:EnableCompressionInSingleFile=true
-p:IncludeNativeLibrariesForSelfExtract=true
-o publish/${{ matrix.runtime }}

- name: Make binary executable and rename
- name: Rename published binary to ssh-c
run: |
chmod +x publish/${{ matrix.runtime }}/ssh-c
mv publish/${{ matrix.runtime }}/ssh-c publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}
mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c publish/${{ matrix.runtime }}/ssh-c

- name: Make binary executable
run: chmod +x publish/${{ matrix.runtime }}/ssh-c

- name: Verify binary format
run: file publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}
run: file publish/${{ matrix.runtime }}/ssh-c

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

- name: Zip binary and checksum
run: |
cd publish/${{ matrix.runtime }}
zip ssh-c_${{ matrix.runtime }}.zip ssh-c_${{ matrix.runtime }} ssh-c_${{ matrix.runtime }}.sha256
zip ssh-c_${{ matrix.runtime }}.zip ssh-c ssh-c_${{ matrix.runtime }}.sha256

- 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
path: publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.zip
24 changes: 15 additions & 9 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ jobs:
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishTrimmed=true \
/p:EnableCompressionInSingleFile=true \
/p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:EnableCompressionInSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-o publish/${{ matrix.runtime }}

- name: Rename binary
run: mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c publish/${{ matrix.runtime }}/ssh-c

- name: Archive binary
run: |
cd publish/${{ matrix.runtime }}
zip ssh-c-${{ matrix.runtime }}.zip ssh-c*
zip ssh-c-${{ matrix.runtime }}.zip ssh-c
sha256sum ssh-c-${{ matrix.runtime }}.zip > ssh-c-${{ matrix.runtime }}.sha256

- name: Upload Release Assets
Expand Down Expand Up @@ -74,12 +77,15 @@ jobs:
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishTrimmed=true \
/p:EnableCompressionInSingleFile=true \
/p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:EnableCompressionInSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-o publish/${{ matrix.runtime }}

- name: Rename binary
run: mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c publish/${{ matrix.runtime }}/ssh-c

- name: Archive binary
run: |
cd publish/${{ matrix.runtime }}
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/signpath-windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ 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: Install SignPath PowerShell module
shell: pwsh
Expand All @@ -61,7 +64,7 @@ jobs:

- name: Replace original EXE with signed version
run: >
rm publish/${{ matrix.runtime }}/ssh-c.exe &&
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
Expand All @@ -74,4 +77,4 @@ jobs:
name: ssh-c-${{ matrix.runtime }}-signed
path: |
publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe
publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe.sha256
publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe.sha256
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,4 @@ $RECYCLE.BIN/
*.swp
ssh-c-test.sh
x.txt
*.zip
4 changes: 4 additions & 0 deletions Helpers/AppJsonContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace ssh_c.Helpers;

[JsonSourceGenerationOptions(
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
WriteIndented = true,
GenerationMode = JsonSourceGenerationMode.Default)]
[JsonSerializable(typeof(ConfigRoot))]
[JsonSerializable(typeof(SshHostConfig))]
[JsonSerializable(typeof(List<SshHostConfig>))]
Expand Down
6 changes: 0 additions & 6 deletions Helpers/ConfigLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,4 @@ string Require(string key) =>
SaveHostConfig(newHost);
Console.WriteLine($"βœ… Added config for '{name}'");
}

private class ConfigRoot
{
public List<SshHostConfig>? Hosts { get; set; }
}
}

8 changes: 7 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ public static async Task Main(string[] args)
if (args.Contains("--version") || args.Contains("-v"))
{
var version = VersionReader.GetVersion();
WriteLine($"ssh-c version {version}");
WriteLine($@"
πŸ›‘οΈ ssh-c CLI
Version: v{version}
Copyright: Β© {DateTime.UtcNow.Year} Repass Cloud
License: MIT
Website: https://github.com/repasscloud/ssh-c
");
return;
}

Expand Down
10 changes: 10 additions & 0 deletions bump-version.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ echo "πŸ”§ Bumping version: $currentVersion β†’ $newVersion"
gsed -i'' -E "s|<Version>[0-9]+\.[0-9]+\.[0-9]+</Version>|<Version>$newVersion</Version>|" "$CSProjFile"

echo "βœ… Updated version in $CSProjFile β†’ $newVersion"

# Set script root dir
SCRIPT_DIR=$(cd -- "$(dirname -- "${(%):-%x}")" &> /dev/null && pwd)

# Update git repo
git add "$SCRIPT_DIR"
git commit -m "πŸ”§ Bumping version: $currentVersion β†’ $newVersion"
git push -u origin main
git tag -s "v$newVersion" -m "Release v$newVersion" && git push origin "v$newVersion" && \
echo "πŸ”– Tagged and pushed release: https://github.com/repasscloud/ssh-c/releases/tag/v$newVersion"
7 changes: 5 additions & 2 deletions ssh-c.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
</PropertyGroup>

<PropertyGroup>
<Version>0.0.6</Version>
<Version>0.0.8</Version>
<AssemblyName>com.repasscloud.ssh-c</AssemblyName>
<ApplicationId>com.repasscloud.ssh-c</ApplicationId>
<MacOSBundleIdentifier>com.repasscloud.ssh-c</MacOSBundleIdentifier>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>

<!-- Self-contained trimmed single binary settings -->
Expand All @@ -30,7 +33,7 @@

<ItemGroup>
<!-- Tell the trimmer to preserve reflection metadata for the main assembly -->
<TrimmerRootAssembly Include="ssh-c" />
<TrimmerRootAssembly Include="com.repasscloud.ssh-c" />
</ItemGroup>

<!-- Exclude non-project files from publish output -->
Expand Down
Loading