Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add appimage packaging #225

Merged
merged 1 commit into from
Jan 4, 2024
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
44 changes: 40 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: owlplug-installer-win
name: owlplug-win-installer-msi
path: build/output/OwlPlug-${{ env.version }}.msi
package-osx:
runs-on: macos-latest
Expand All @@ -203,9 +203,9 @@ jobs:
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: owlplug-installer-osx
name: owlplug-osx-installer-dmg
path: build/output/OwlPlug-${{ env.version }}.dmg
package-linux:
package-linux-deb:
runs-on: ubuntu-latest
needs: [build-jar]
steps:
Expand All @@ -228,5 +228,41 @@ jobs:
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: owlplug-installer-linux
name: owlplug-linux-installer-deb
path: build/output/OwlPlug-${{ env.version }}.deb
package-linux-appimage:
runs-on: ubuntu-latest
needs: [build-jar]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Get version
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
id: get-version
- name: Install Jar artifact
uses: actions/download-artifact@v4
with:
name: owlplug-client-jar
path: owlplug-client/target
- name: Package installer
run: cd build && ./package-appimage.sh ${{ env.version }}
- name: Download FUSE dependency
run: sudo add-apt-repository universe && sudo apt install libfuse2
- name: Download AppImage Tool
run: wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
- name: Allow AppImage Execution
run: chmod a+x appimagetool-x86_64.AppImage
- name: Run AppImage Tool
run: ./appimagetool-x86_64.AppImage build/OwlPlug.AppDir --verbose
- name: Rename OwlPlug AppImage
run: mv OwlPlug-x86_64.AppImage OwlPlug-${{ env.version }}-x86_64.AppImage
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: owlplug-linux-appimage
path: OwlPlug-${{ env.version }}-x86_64.AppImage

6 changes: 6 additions & 0 deletions build/OwlPlug.AppDir/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
export PATH="${HERE}/usr/bin/:${HERE}/usr/sbin/:${HERE}/usr/games/:${HERE}/bin/:${HERE}/sbin/${PATH:+:$PATH}"
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
DropSnorz marked this conversation as resolved.
Show resolved Hide resolved
exec "${EXEC}" "$@"
DropSnorz marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions build/OwlPlug.AppDir/OwlPlug.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=OwlPlug
Exec=OwlPlug
Icon=owlplug
Type=Application
Categories=AudioVideo;Audio
Empty file.
Empty file.
26 changes: 26 additions & 0 deletions build/package-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
echo "Preparing package"

owlplugversion=$1
DropSnorz marked this conversation as resolved.
Show resolved Hide resolved

echo "Exporting LICENSE File"

cp ../LICENSE ./input/LICENSE

echo "Copying owlplug-client-$owlplugversion.jar to owlplug.jar"

cp ../owlplug-client/target/owlplug-client-$owlplugversion.jar ./input/owlplug.jar

echo "Generating OwlPlug AppImage Install package"

jpackage --input ./input/ --type app-image --name OwlPlug --main-class org.springframework.boot.loader.JarLauncher \
--main-jar owlplug.jar --dest ./output \
--app-version $owlplugversion --vendor OwlPlug

# Copy OwlPlug logo to AppDir
cp ./resources/owlplug.png ./OwlPlug.AppDir/owlplug.png

# Copy OwlPlug binaries to AppDir
cp -a ./output/OwlPlug/bin/. ./OwlPlug.AppDir/usr/bin
cp -a ./output/OwlPlug/lib/. ./OwlPlug.AppDir/usr/lib
DropSnorz marked this conversation as resolved.
Show resolved Hide resolved

echo "OwlPlug AppImage files generated"
DropSnorz marked this conversation as resolved.
Show resolved Hide resolved