@@ -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 }}
0 commit comments