55 tags :
66 - ' v*'
77
8+ permissions :
9+ contents : write
10+
811jobs :
912 apk :
1013 name : Generate APK
2427 - name : Install Android Build Tools
2528 run : sdkmanager "build-tools;29.0.3"
2629 - name : Run common unit tests
27- run : bash ./gradlew :common:cleanTestDebugUnitTest :common:testDebugUnitTest
30+ run : bash ./gradlew :common:cleanTestDebugUnitTest :common:testDebugUnitTest --stacktrace
2831 - name : Build APK
2932 run : bash ./gradlew assembleRelease --stacktrace
3033 - name : Sign APK
4144 name : signed-apk
4245 path : android/build/outputs/apk/release/android-release-unsigned-signed.apk
4346 - name : Build cli JAR
44- run : bash ./gradlew :cli:createJar
47+ run : bash ./gradlew :cli:createJar --stacktrace
4548 - name : Upload cli JAR Artifact
4649 uses : actions/upload-artifact@v4
4750 with :
@@ -62,11 +65,11 @@ jobs:
6265 - name : Set execution flag for gradlew
6366 run : chmod +x gradlew
6467 - name : Build DMG
65- run : ./gradlew :desktopApp:packageDmg
68+ run : bash ./gradlew :desktopApp:packageDmg --stacktrace
6669 - name : Upload DMG Artifact
6770 uses : actions/upload-artifact@v4
6871 with :
69- name : dmg
72+ name : dmg-package
7073 path : desktopApp/build/compose/binaries/main/dmg/*.dmg
7174
7275 msi :
@@ -81,11 +84,11 @@ jobs:
8184 distribution : temurin
8285 java-version : " 17"
8386 - name : Build MSI
84- run : ./gradlew :desktopApp:packageMsi
87+ run : ./gradlew :desktopApp:packageMsi --stacktrace
8588 - name : Upload MSI Artifact
8689 uses : actions/upload-artifact@v4
8790 with :
88- name : msi
91+ name : msi-package
8992 path : desktopApp/build/compose/binaries/main/msi/*.msi
9093
9194 deb :
@@ -102,13 +105,36 @@ jobs:
102105 - name : Set execution flag for gradlew
103106 run : chmod +x gradlew
104107 - name : Build DEB
105- run : ./gradlew :desktopApp:packageDeb
108+ run : ./gradlew :desktopApp:packageDeb --stacktrace
106109 - name : Upload DEB Artifact
107110 uses : actions/upload-artifact@v4
108111 with :
109- name : deb
112+ name : deb-package
110113 path : desktopApp/build/compose/binaries/main/deb/*.deb
111114
115+ rpm :
116+ name : Generate RPM
117+ runs-on : ubuntu-latest
118+ steps :
119+ - name : Checkout
120+ uses : actions/checkout@v4
121+ - name : Setup JDK
122+ uses : actions/setup-java@v4
123+ with :
124+ distribution : temurin
125+ java-version : " 17"
126+ - name : Set execution flag for gradlew
127+ run : chmod +x gradlew
128+ - name : Install RPM build tools
129+ run : sudo apt-get update && sudo apt-get install -y rpm
130+ - name : Build RPM
131+ run : ./gradlew :desktopApp:packageRpm --stacktrace
132+ - name : Upload RPM Artifact
133+ uses : actions/upload-artifact@v4
134+ with :
135+ name : rpm-package
136+ path : desktopApp/build/compose/binaries/main/rpm/*.rpm
137+
112138 appimage :
113139 name : Generate AppImage
114140 runs-on : ubuntu-latest
@@ -122,77 +148,130 @@ jobs:
122148 java-version : " 17"
123149 - name : Set execution flag for gradlew
124150 run : chmod +x gradlew
151+ - name : Install AppImage tools
152+ run : |
153+ sudo apt-get update
154+ sudo apt-get install -y libfuse2 file
155+ wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
156+ chmod +x appimagetool-x86_64.AppImage
157+ - name : Build application distribution
158+ run : ./gradlew :desktopApp:createDistributable --stacktrace
159+ - name : Create AppDir structure
160+ run : |
161+ mkdir -p AppDir/usr/bin
162+ mkdir -p AppDir/usr/lib
163+ mkdir -p AppDir/usr/share/applications
164+ mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
165+
166+ # Copy distributable contents
167+ cp -r desktopApp/build/compose/binaries/main/app/LinuxCommandLibrary/* AppDir/usr/lib/
168+
169+ # Copy icon
170+ cp desktopApp/icon.png AppDir/usr/share/icons/hicolor/256x256/apps/linuxcommandlibrary.png
171+ cp desktopApp/icon.png AppDir/linuxcommandlibrary.png
172+
173+ # Create desktop file
174+ cat > AppDir/linuxcommandlibrary.desktop << 'EOF'
175+ [Desktop Entry]
176+ Name=Linux Command Library
177+ Comment=Linux Command Reference
178+ Exec=linuxcommandlibrary
179+ Icon=linuxcommandlibrary
180+ Type=Application
181+ Categories=Utility;
182+ Terminal=false
183+ EOF
184+ cp AppDir/linuxcommandlibrary.desktop AppDir/usr/share/applications/
185+
186+ # Create AppRun
187+ cat > AppDir/AppRun << 'EOF'
188+ #!/bin/bash
189+ SELF=$(readlink -f "$0")
190+ HERE=${SELF%/*}
191+ export PATH="${HERE}/usr/lib/bin:${PATH}"
192+ export LD_LIBRARY_PATH="${HERE}/usr/lib/lib/runtime/lib:${LD_LIBRARY_PATH}"
193+ exec "${HERE}/usr/lib/bin/LinuxCommandLibrary" "$@"
194+ EOF
195+ chmod +x AppDir/AppRun
125196 - name : Build AppImage
126- run : ./gradlew :desktopApp:packageAppImage
197+ run : |
198+ ARCH=x86_64 ./appimagetool-x86_64.AppImage --appimage-extract-and-run AppDir LinuxCommandLibrary-x86_64.AppImage
127199 - name : Upload AppImage Artifact
128200 uses : actions/upload-artifact@v4
129201 with :
130- name : appimage
131- path : desktopApp/build/compose/binaries/main/app-image/ *.AppImage
202+ name : appimage-package
203+ path : LinuxCommandLibrary- *.AppImage
132204
133205 release :
134206 name : Release All Platforms
135- needs : [apk, dmg, msi, deb, appimage]
207+ needs : [apk, dmg, msi, deb, rpm, appimage]
136208 runs-on : ubuntu-latest
137209 steps :
138210 - name : Checkout
139211 uses : actions/checkout@v4
212+
140213 - name : Download APK Artifact
141- uses : actions/download-artifact@v4
214+ uses : actions/download-artifact@v4.1.7
142215 with :
143216 name : signed-apk
144- path : artifacts/apk
217+
145218 - name : Download JAR Artifact
146- uses : actions/download-artifact@v4
219+ uses : actions/download-artifact@v4.1.7
147220 with :
148221 name : cli-jar
149- path : artifacts/jar
222+
150223 - name : Download DMG Artifact
151- uses : actions/download-artifact@v4
224+ uses : actions/download-artifact@v4.1.7
152225 with :
153- name : dmg
154- path : artifacts/dmg
226+ name : dmg-package
227+
155228 - name : Download MSI Artifact
156- uses : actions/download-artifact@v4
229+ uses : actions/download-artifact@v4.1.7
157230 with :
158- name : msi
159- path : artifacts/msi
231+ name : msi-package
232+
160233 - name : Download DEB Artifact
161- uses : actions/download-artifact@v4
234+ uses : actions/download-artifact@v4.1.7
235+ with :
236+ name : deb-package
237+
238+ - name : Download RPM Artifact
239+ uses : actions/download-artifact@v4.1.7
162240 with :
163- name : deb
164- path : artifacts/deb
241+ name : rpm-package
242+
165243 - name : Download AppImage Artifact
166- uses : actions/download-artifact@v4
244+ uses : actions/download-artifact@v4.1.7
167245 with :
168- name : appimage
169- path : artifacts/appimage
170- - name : Extract version and rename assets
171- run : |
172- VERSION=${GITHUB_REF_NAME#v}
173- echo "VERSION=$VERSION" >> $GITHUB_ENV
246+ name : appimage-package
247+
248+ - name : List downloaded files (for debugging)
249+ run : ls -la
174250
175- # Rename APK
176- mv artifacts/apk/android-release-unsigned-signed.apk artifacts/LinuxCommandLibrary-${VERSION}-android.apk
251+ - name : Get DMG filename
252+ id : dmg
253+ run : echo "file=$(ls *.dmg | head -n1)" >> $GITHUB_OUTPUT
177254
178- # Rename JAR
179- mv artifacts/jar/linuxcommandlibrary.jar artifacts/linuxcommandlibrary-${VERSION}-cli.jar
255+ - name : Get MSI filename
256+ id : msi
257+ run : echo "file=$(ls *.msi | head -n1)" >> $GITHUB_OUTPUT
180258
181- # Rename DMG (find the actual file)
182- DMG_FILE=$(find artifacts/dmg -name "*.dmg" | head -1)
183- mv "$DMG_FILE" artifacts/LinuxCommandLibrary-${VERSION}-macos.dmg
259+ - name : Get DEB filename
260+ id : deb
261+ run : echo "file=$(ls *.deb | head -n1)" >> $GITHUB_OUTPUT
184262
185- # Rename MSI (find the actual file)
186- MSI_FILE=$(find artifacts/msi -name "*.msi" | head -1)
187- mv "$MSI_FILE" artifacts/LinuxCommandLibrary-${VERSION}-windows.msi
263+ - name : Get RPM filename
264+ id : rpm
265+ run : echo "file=$(ls *.rpm | head -n1)" >> $GITHUB_OUTPUT
188266
189- # Rename DEB (find the actual file)
190- DEB_FILE=$(find artifacts/deb -name "*.deb" | head -1)
191- mv "$DEB_FILE" artifacts/LinuxCommandLibrary-${VERSION}-linux.deb
267+ - name : Get AppImage filename
268+ id : appimage
269+ run : echo "file=$(ls *.AppImage | head -n1)" >> $GITHUB_OUTPUT
270+
271+ - name : Get version
272+ id : get_version
273+ run : echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
192274
193- # Rename AppImage (find the actual file)
194- APPIMAGE_FILE=$(find artifacts/appimage -name "*.AppImage" | head -1)
195- mv "$APPIMAGE_FILE" artifacts/LinuxCommandLibrary-${VERSION}-linux.AppImage
196275 - name : Create Github Release
197276 id : create_release
198277 uses : actions/create-release@v1
@@ -201,57 +280,73 @@ jobs:
201280 with :
202281 tag_name : ${{ github.ref }}
203282 release_name : Release ${{ github.ref }}
283+
204284 - name : Upload APK to Github Release
205285 uses : actions/upload-release-asset@v1.0.1
206286 env :
207287 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
208288 with :
209289 upload_url : ${{ steps.create_release.outputs.upload_url }}
210- asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-android.apk
211- asset_name : LinuxCommandLibrary-${{ env.VERSION }}-android.apk
212- asset_content_type : application/vnd.android.package-archive
290+ asset_path : android-release-unsigned-signed.apk
291+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-android.apk
292+ asset_content_type : application/zip
293+
213294 - name : Upload JAR to Github Release
214295 uses : actions/upload-release-asset@v1.0.1
215296 env :
216297 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
217298 with :
218299 upload_url : ${{ steps.create_release.outputs.upload_url }}
219- asset_path : artifacts/ linuxcommandlibrary-${{ env.VERSION }}-cli .jar
220- asset_name : linuxcommandlibrary-${{ env.VERSION }}-cli.jar
300+ asset_path : linuxcommandlibrary.jar
301+ asset_name : linuxcommandlibrary-${{ steps.get_version.outputs.version }}-cli.jar
221302 asset_content_type : application/java-archive
303+
222304 - name : Upload DMG to Github Release
223305 uses : actions/upload-release-asset@v1.0.1
224306 env :
225307 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
226308 with :
227309 upload_url : ${{ steps.create_release.outputs.upload_url }}
228- asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-macos.dmg
229- asset_name : LinuxCommandLibrary-${{ env.VERSION }}-macos.dmg
230- asset_content_type : application/x-apple-diskimage
310+ asset_path : ${{ steps.dmg.outputs.file }}
311+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-macos.dmg
312+ asset_content_type : application/octet-stream
313+
231314 - name : Upload MSI to Github Release
232315 uses : actions/upload-release-asset@v1.0.1
233316 env :
234317 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
235318 with :
236319 upload_url : ${{ steps.create_release.outputs.upload_url }}
237- asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-windows.msi
238- asset_name : LinuxCommandLibrary-${{ env.VERSION }}-windows.msi
239- asset_content_type : application/x-msi
320+ asset_path : ${{ steps.msi.outputs.file }}
321+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-windows.msi
322+ asset_content_type : application/octet-stream
323+
240324 - name : Upload DEB to Github Release
241325 uses : actions/upload-release-asset@v1.0.1
242326 env :
243327 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
244328 with :
245329 upload_url : ${{ steps.create_release.outputs.upload_url }}
246- asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-linux.deb
247- asset_name : LinuxCommandLibrary-${{ env.VERSION }}-linux.deb
248- asset_content_type : application/vnd.debian.binary-package
330+ asset_path : ${{ steps.deb.outputs.file }}
331+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-linux.deb
332+ asset_content_type : application/octet-stream
333+
334+ - name : Upload RPM to Github Release
335+ uses : actions/upload-release-asset@v1.0.1
336+ env :
337+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
338+ with :
339+ upload_url : ${{ steps.create_release.outputs.upload_url }}
340+ asset_path : ${{ steps.rpm.outputs.file }}
341+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-linux.rpm
342+ asset_content_type : application/octet-stream
343+
249344 - name : Upload AppImage to Github Release
250345 uses : actions/upload-release-asset@v1.0.1
251346 env :
252347 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
253348 with :
254349 upload_url : ${{ steps.create_release.outputs.upload_url }}
255- asset_path : artifacts/LinuxCommandLibrary- ${{ env.VERSION }}-linux.AppImage
256- asset_name : LinuxCommandLibrary-${{ env.VERSION }}-linux.AppImage
257- asset_content_type : application/x-executable
350+ asset_path : ${{ steps.appimage.outputs.file }}
351+ asset_name : LinuxCommandLibrary-${{ steps.get_version.outputs.version }}-linux.AppImage
352+ asset_content_type : application/octet-stream
0 commit comments