Skip to content

Commit f888af4

Browse files
Merge pull request #7 from totalretribution/release-build
2 parents 9c59a51 + c0e8f33 commit f888af4

6 files changed

Lines changed: 80 additions & 63 deletions

File tree

.github/workflows/release.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,61 @@ jobs:
5959
if: matrix.platform == 'windows'
6060
run: dotnet publish -c Release -o publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj
6161

62-
- name: Package Linux binaries
62+
- name: Compress Linux binaries
6363
if: matrix.platform == 'linux'
6464
run: |
6565
tar -czf ssh-agent-echo-linux-x64.tar.gz -C ./publish ssh-agent-echo-gui ssh-agent-echo
6666
67+
- name: Install nFPM
68+
if: matrix.platform == 'linux'
69+
run: |
70+
NFPM_VERSION="2.35.3" # Replace with your preferred version
71+
curl -L https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz | tar xz
72+
sudo mv nfpm /usr/local/bin/
73+
74+
- name: Extract Version
75+
if: matrix.platform == 'linux'
76+
id: get_version
77+
run: |
78+
APP_VERSION=$(grep -oPm1 '(?<=<Version>)[^<]+' Directory.Build.props)
79+
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
80+
echo "Detected version: $APP_VERSION"
81+
82+
- name: Generate Linux packages
83+
if: matrix.platform == 'linux'
84+
run: |
85+
nfpm pkg --packager deb --target publish/
86+
nfpm pkg --packager rpm --target publish/
87+
env:
88+
APP_VERSION: ${{ env.APP_VERSION }}
89+
6790
- name: Package Windows Binaries
6891
if: matrix.platform == 'windows'
6992
shell: pwsh
7093
run: |
7194
$files = @(
7295
"$PWD/publish/ssh-agent-echo-gui.exe",
7396
"$PWD/publish/ssh-agent-echo.exe"
74-
)
75-
Compress-Archive -Path $files -DestinationPath "$PWD/ssh-agent-echo-win-x64.zip" -Force
97+
)
98+
Compress-Archive -Path $files -DestinationPath "$PWD/ssh-agent-echo-win-x64.zip" -Force
7699
77100
- name: Upload artifact
78-
uses: actions/upload-artifact@v4
101+
if: matrix.platform == 'windows'
102+
uses: actions/upload-artifact@v6
79103
with:
80104
name: ${{ matrix.platform }}-binaries
81105
path: ${{ matrix.artifact }}
82106

107+
- name: Upload artifact
108+
if: matrix.platform == 'linux'
109+
uses: actions/upload-artifact@v6
110+
with:
111+
name: ${{ matrix.platform }}-binaries
112+
path: |
113+
${{ matrix.artifact }}
114+
publish/*.deb
115+
publish/*.rpm
116+
83117
release:
84118
if: startsWith(github.ref, 'refs/tags/')
85119
needs: build
@@ -100,5 +134,7 @@ jobs:
100134
files: |
101135
artifacts/linux-binaries/ssh-agent-echo-linux-x64.tar.gz
102136
artifacts/windows-binaries/ssh-agent-echo-win-x64.zip
137+
artifacts/linux-binaries/publish/*.deb
138+
artifacts/linux-binaries/publish/*.rpm
103139
env:
104140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Assets/ssh-agent-echo.desktop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=SSH Agent Echo
4+
Comment=SSH Agent Echo utility
5+
Exec=ssh-agent-echo-gui
6+
Icon=ssh-agent-echo
7+
Categories=Utility;System;
8+
Terminal=false

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.1.3</Version>
3+
<Version>0.1.4</Version>
44
</PropertyGroup>
55
<ItemGroup>
66
<AvaloniaResource Include="$(MSBuildThisFileDirectory)Assets\**\*.*">

build.ps1

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,14 @@ If no option is provided, builds both Linux and Windows.
4343

4444
function Build-Linux {
4545
Write-Host "🔧 Building Linux (linux-x64)..."
46-
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj') -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
47-
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj') -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
48-
49-
$destDir = Join-Path $PSScriptRoot ".publish/linux"
50-
# Use the published single-file executable from the `publish` folder
51-
$src = Join-Path $PSScriptRoot "src\SshAgentEcho.Cli\bin\Release\net10.0\linux-x64\publish\ssh-agent-echo"
52-
if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir | Out-Null }
53-
Copy-Item -Path $src -Destination $destDir -Force
54-
$src = Join-Path $PSScriptRoot "src\SshAgentEcho.Gui\bin\Release\net10.0\linux-x64\publish\ssh-agent-echo-gui"
55-
if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir | Out-Null }
56-
Copy-Item -Path $src -Destination $destDir -Force
46+
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj') -c Release -o publish -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
47+
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj') -c Release -o publish -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
5748
}
5849

5950
function Build-Windows {
6051
Write-Host "🔧 Building Windows (win-x64)..."
61-
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj') -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
62-
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj') -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
63-
64-
$destDir = Join-Path $PSScriptRoot ".publish/windows"
65-
# Use the published single-file executable from the `publish` folder
66-
$src = Join-Path $PSScriptRoot "src\SshAgentEcho.Cli\bin\Release\net10.0\win-x64\publish\ssh-agent-echo.exe"
67-
if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir | Out-Null }
68-
Copy-Item -Path $src -Destination $destDir -Force
69-
$src = Join-Path $PSScriptRoot "src\SshAgentEcho.Gui\bin\Release\net10.0\win-x64\publish\ssh-agent-echo-gui.exe"
70-
if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir | Out-Null }
71-
Copy-Item -Path $src -Destination $destDir -Force
52+
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj') -c Release -o publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
53+
& dotnet publish (Join-Path $PSScriptRoot 'src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj') -c Release -o publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
7254
}
7355

7456
if ($Help) {

build.sh

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,14 @@ EOF
2020

2121
build_linux() {
2222
echo "🔧 Building Linux (linux-x64)..."
23-
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj
24-
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj
25-
26-
dest="./.publish/linux"
27-
mkdir -p "$dest"
28-
src="src/SshAgentEcho.Cli/bin/Release/net10.0/linux-x64/publish/ssh-agent-echo"
29-
if [ ! -f "$src" ]; then
30-
echo "❌ Expected single-file executable not found: $src"
31-
exit 1
32-
fi
33-
cp "$src" "$dest/"
34-
35-
src="src/SshAgentEcho.Gui/bin/Release/net10.0/linux-x64/publish/ssh-agent-echo-gui"
36-
if [ ! -f "$src" ]; then
37-
echo "❌ Expected single-file GUI executable not found: $src"
38-
exit 1
39-
fi
40-
cp "$src" "$dest/"
23+
dotnet publish -c Release -o publish -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj
24+
dotnet publish -c Release -o publish -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj
4125
}
4226

4327
build_windows() {
4428
echo "🔧 Building Windows (win-x64)..."
45-
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj
46-
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj
47-
48-
dest="./.publish/windows"
49-
mkdir -p "$dest"
50-
src="src/SshAgentEcho.Cli/bin/Release/net10.0/win-x64/publish/ssh-agent-echo.exe"
51-
if [ ! -f "$src" ]; then
52-
echo "❌ Expected single-file executable not found: $src"
53-
exit 1
54-
fi
55-
cp "$src" "$dest/"
56-
57-
src="src/SshAgentEcho.Gui/bin/Release/net10.0/win-x64/publish/ssh-agent-echo-gui.exe"
58-
if [ ! -f "$src" ]; then
59-
echo "❌ Expected single-file GUI executable not found: $src"
60-
exit 1
61-
fi
62-
cp "$src" "$dest/"
29+
dotnet publish -c Release -o publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Cli/SshAgentEcho.Cli.csproj
30+
dotnet publish -c Release -o publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true src/SshAgentEcho.Gui/SshAgentEcho.Gui.csproj
6331
}
6432

6533
if [ "$#" -eq 0 ]; then

nfpm.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ssh-agent-echo
2+
arch: amd64
3+
platform: linux
4+
version: ${APP_VERSION}
5+
section: utils
6+
priority: optional
7+
maintainer: totalretribution
8+
description: A tool to synchronize SSH keys from a running SSH agent to your SSH config file. This is useful when you are using an SSH agent that loads keys from a remote source, such as 1Password, and you want to use those keys with tools that read the SSH config file directly.
9+
license: GPL-3.0
10+
homepage: https://github.com/totalretribution/ssh-agent-echo
11+
12+
contents:
13+
- src: ./publish/ssh-agent-echo
14+
dst: /usr/bin/ssh-agent-echo
15+
16+
- src: ./publish/ssh-agent-echo-gui
17+
dst: /usr/bin/ssh-agent-echo-gui
18+
19+
- src: ./Assets/ssh-agent-echo.desktop
20+
dst: /usr/share/applications/ssh-agent-echo.desktop
21+
22+
- src: ./Assets/icon.svg
23+
dst: /usr/share/pixmaps/ssh-agent-echo.svg

0 commit comments

Comments
 (0)