diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25c969d7..bb50b230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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: @@ -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 + diff --git a/build/OwlPlug.AppDir/AppRun b/build/OwlPlug.AppDir/AppRun new file mode 100755 index 00000000..c8d17ec9 --- /dev/null +++ b/build/OwlPlug.AppDir/AppRun @@ -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}" "$@" diff --git a/build/OwlPlug.AppDir/OwlPlug.desktop b/build/OwlPlug.AppDir/OwlPlug.desktop new file mode 100644 index 00000000..a7a21a94 --- /dev/null +++ b/build/OwlPlug.AppDir/OwlPlug.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=OwlPlug +Exec=OwlPlug +Icon=owlplug +Type=Application +Categories=AudioVideo;Audio \ No newline at end of file diff --git a/build/OwlPlug.AppDir/usr/bin/.gitkeep b/build/OwlPlug.AppDir/usr/bin/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/build/OwlPlug.AppDir/usr/lib/.gitkeep b/build/OwlPlug.AppDir/usr/lib/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/build/package-appimage.sh b/build/package-appimage.sh new file mode 100755 index 00000000..85ad1b7a --- /dev/null +++ b/build/package-appimage.sh @@ -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"