Skip to content

Commit

Permalink
ci: add appimage packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
DropSnorz committed Jan 2, 2024
1 parent cd4461b commit 6f6fffd
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 2 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
with:
name: owlplug-installer-osx
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-installer-linux-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-installer-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)
exec "${EXEC}" "$@"
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

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

echo "OwlPlug AppImage files generated"

0 comments on commit 6f6fffd

Please sign in to comment.