Package Khoj as Debian app in Github Release Workflow

This commit is contained in:
Debanjum Singh Solanky 2022-08-14 05:07:58 +03:00
parent d815e0d115
commit fed0b591af
3 changed files with 32 additions and 2 deletions

View file

@ -53,6 +53,29 @@ jobs:
"dist/Khoj.dmg" \
"dist/dmg/"
- name: Create Debian Package
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
# Install Debian Packager
sudo apt install ruby
get install fpm --user-install
# Copy app files into expected output directory structure
mkdir -p package/opt package/usr/share/applications package/usr/share/icons/hicolor/128x128/apps
cp -r dist/Khoj package/opt/Khoj
cp src/interface/web/assets/icons/favicon-128x128.png package/usr/share/icons/hicolor/128x128/apps/Khoj.png
cp Khoj.desktop package/usr/share/applications
# Fix permissions to be usable by non-root users
find package/opt/Khoj -type f -exec chmod 644 -- {} +
find package/opt/Khoj -type d -exec chmod 755 -- {} +
find package/usr/share -type f -exec chmod 644 -- {} +
chmod +x package/opt/Khoj/Khoj
# Package the app
fpm -s dir -t deb -n Khoj --version "$GITHUB_REF_NAME" -p dist/Khoj.deb
- uses: actions/upload-artifact@v3
if : matrix.os == 'macos-latest'
with:
@ -68,5 +91,5 @@ jobs:
- uses: actions/upload-artifact@v3
if : matrix.os == 'ubuntu-latest'
with:
name: khoj
path: dist/Khoj
name: khoj.deb
path: dist/Khoj.deb

7
Khoj.desktop Normal file
View file

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=Khoj
Comment=A natural language search engine for your personal notes, transactions and images.
Path=/opt/Khoj
Exec=/opt/Khoj/Khoj
Icon=Khoj

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB