diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8bc7f5f2..fa34b3438 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,6 +129,84 @@ jobs: path: runtime if-no-files-found: error + + +# +# Linux AppImage +# + + linux-appimage: + name: Build AppDir + runs-on: ubuntu-latest + needs: [buildkit, jlink] + steps: + - uses: actions/checkout@v2 + - name: Set version + id: setversion + run: | + if [[ $GITHUB_REF == refs/tags/* ]]; then + echo "BUILD_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV + else + echo "BUILD_VERSION=SNAPSHOT" >> $GITHUB_ENV + fi + - name: Download buildkit-linux + uses: actions/download-artifact@v2 + with: + name: buildkit-linux + path: Cryptomator.AppDir + - name: Download buildkit-linux + uses: actions/download-artifact@v2 + with: + name: buildkit-linux + path: Cryptomator.AppDir/runtime + - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27 + run: | + JFFI_NATIVE_JAR=`ls libs/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'` + ${JAVA_HOME}/bin/jar -xf libs/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/ + mv jni/x86_64-Linux/* libs/libjffi.so + working-directory: Cryptomator.AppDir + - name: Patch Cryptomator.AppDir + run: | + cp -r dist/appimage/resources/appimage/AppDir/* Cryptomator.AppDir/ + export REVISION_NO=`git rev-list --count HEAD` + envsubst '${REVISION_NO}' < dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh + ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg + ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg + ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon + ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop + ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun + - name: Download AppImageKit + run: | + curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage + chmod +x appimagetool.AppImage + ./appimagetool.AppImage --appimage-extract + - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235 + run: | + echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import + echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign appdir.tar.gz + env: + GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} + - name: Build AppImage + run: > + ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage + -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync' + --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback" + - name: Create Detached GPG Signature + run: | + gpg --batch --quiet --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage + gpg --batch --quiet --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync + - name: Upload AppImage + uses: actions/upload-artifact@v2 + with: + name: appimage + path: | + cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage + cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.asc + cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync + cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync.asc + if-no-files-found: error + # release: # name: Draft a Release on GitHub Releases # runs-on: ubuntu-latest diff --git a/dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh b/dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh new file mode 100755 index 000000000..4a237c1b2 --- /dev/null +++ b/dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh @@ -0,0 +1,37 @@ +#!/bin/sh +cd $(dirname $0) + +# determine GTK version +GTK2_PRESENT=1 # initially false +GTK3_PRESENT=0 # initially true +if command -v dpkg &> /dev/null; then # do stuff for debian based things + GTK2_PRESENT=`dpkg -l libgtk* | grep -e '\^ii' | grep -e 'libgtk2-*' &> /dev/null; echo $?` + GTK3_PRESENT=`dpkg -l libgtk* | grep -e '\^ii' | grep -e 'libgtk-3-*' &> /dev/null; echo $?` +elif command -v rpm &> /dev/null; then # do stuff for rpm based things (including yum/dnf) + GTK2_PRESENT=`rpm -qa | grep -e '\^gtk2-[0-9][0-9]*' &> /dev/null; echo $?` + GTK3_PRESENT=`rpm -qa | grep -e '\^gtk3-[0-9][0-9]*' &> /dev/null; echo $?` +elif command -v pacman &> /dev/null; then # don't forget arch + GTK2_PRESENT=`pacman -Qi gtk2 &> /dev/null; echo $?` + GTK3_PRESENT=`pacman -Qi gtk3 &> /dev/null; echo $?` +fi + +if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then + GTK_FLAG="-Djdk.gtk.version=2" +fi + +# workaround for https://github.com/cryptomator/cryptomator-linux/issues/27 +export LD_PRELOAD=libs/libjffi.so + +# start Cryptomator +./runtime/bin/java \ + -p "mods" \ + -cp "libs/*" \ + -Dcryptomator.logDir="~/.local/share/Cryptomator/logs" \ + -Dcryptomator.mountPointsDir="~/.local/share/Cryptomator/mnt" \ + -Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json" \ + -Dcryptomator.ipcPortPath="~/.config/Cryptomator/ipcPort.bin:~/.Cryptomator/ipcPort.bin" \ + -Dcryptomator.buildNumber="appimage-${REVISION_NO}" \ + $GTK_FLAG \ + -Xss2m \ + -Xmx512m \ + -m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop b/dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop new file mode 100644 index 000000000..3e1b34830 --- /dev/null +++ b/dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Cryptomator +Comment=Cloud Storage Encryption Utility +Exec=cryptomator %F +Icon=org.cryptomator.Cryptomator +Terminal=false +Type=Application +Categories=Utility;Security;FileTools; +StartupWMClass=org.cryptomator.launcher.Cryptomator +MimeType=application/vnd.cryptomator.encrypted;application/x-vnd.cryptomator.vault-metadata; diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png new file mode 100644 index 000000000..e356c35c6 Binary files /dev/null and b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png differ diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png new file mode 100644 index 000000000..9c8635111 Binary files /dev/null and b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png differ diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg new file mode 100644 index 000000000..b2e12a3c3 --- /dev/null +++ b/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml b/dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml new file mode 100644 index 000000000..ad4af6c70 --- /dev/null +++ b/dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml @@ -0,0 +1,69 @@ + + + + org.cryptomator.Cryptomator + FSFAP + GPL-3.0-or-later + Cryptomator + Multi-platform client-side encryption tool optimized for cloud storages + +

+ Cryptomator offers multi-platform transparent client-side encryption of your files in the cloud. +

+

+ Features: +

+

+

+ Privacy: +

+

+

+ Consistency: +

+

+
+ + Office + Security + FileTools + Java + + http://cryptomator.org + https://github.com/cryptomator/cryptomator/issues + https://community.cryptomator.org/c/kb/faq + https://community.cryptomator.org/ + https://cryptomator.org/ + + none + none + none + none + mild + + Cryptomator + + cryptomator + + org.cryptomator.Cryptomator.desktop +