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 1, 2024
1 parent cd4461b commit 39fc1db
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .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 @@ -230,3 +230,35 @@ jobs:
with:
name: owlplug-installer-linux
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 AppImage Tool
run: curl -o appimagetool.appimage https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
- name: Allow AppImage Execution
run: chmod u+x appimagetool.appimage
- name: Run AppImage Tool
run: ./appimagetool.appimage build/OwlPlug.AppDir
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: owlplug-installer-linux
path: build/output/OwlPlug-${{ env.version }}.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=myapp
Type=Application
Categories=AudioVideo;Audio
Empty file.
29 changes: 29 additions & 0 deletions build/package-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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

ls ./output

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

# Copy OwlPlug binaries to AppDir
cp -a ./output/. ./OwlPlug.AppDir/usr/bin

ls -a ./OwlPlug.AppDir/usr/bin

echo "OwlPlug AppImage files generated"

0 comments on commit 39fc1db

Please sign in to comment.