Skip to content

Commit

Permalink
Merge pull request #225 from DropSnorz/ci/build-appimage
Browse files Browse the repository at this point in the history
Add appimage packaging
  • Loading branch information
DropSnorz authored Jan 4, 2024
2 parents cd4461b + 6adcf3f commit d2c5679
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 4 deletions.
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)
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 d2c5679

Please sign in to comment.