diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c447af77..023e78938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ defaults: jobs: test: - name: Build and Test + name: Compile and Test runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: @@ -75,7 +75,7 @@ jobs: - name: Archive buildkit-${{ matrix.profile }}.tar.gz run: | cp LICENSE.txt target - cp dist/${{ matrix.launcher }} target + cp dist/buildkit/${{ matrix.launcher }} target cp target/cryptomator-*.jar target/mods - name: Upload buildkit-${{ matrix.profile }} uses: actions/upload-artifact@v2 @@ -129,8 +129,6 @@ jobs: path: runtime if-no-files-found: error - - # # Linux AppImage # @@ -167,10 +165,10 @@ jobs: working-directory: Cryptomator.AppDir - name: Patch Cryptomator.AppDir run: | - cp -r dist/appimage/resources/appimage/AppDir/* Cryptomator.AppDir/ + cp -r dist/appimage/resources/AppDir/* Cryptomator.AppDir/ chmod +x Cryptomator.AppDir/runtime/bin/java export REVISION_NO=`git rev-list --count HEAD` - envsubst '${REVISION_NO}' < dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh + envsubst '${REVISION_NO}' < dist/appimage/resources/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 diff --git a/dist/appimage/build.sh b/dist/appimage/build.sh new file mode 100755 index 000000000..a5f73a48b --- /dev/null +++ b/dist/appimage/build.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +BASEDIR=$(dirname $0)/../.. +REVISION_NO=`git rev-list --count HEAD` + +# check preconditions +if [ -z "${JAVA_HOME}" ]; then echo "JAVA_HOME not set. Run using JAVA_HOME=/path/to/jdk ./build.sh"; exit 1; fi +command -v mvn >/dev/null 2>&1 || { echo >&2 "mvn not found."; exit 1; } +command -v curl >/dev/null 2>&1 || { echo >&2 "curl not found."; exit 1; } + +# compile +mvn -B -f${BASEDIR}/pom.xml clean package -DskipTests -Plinux + +# prepare AppDir +mkdir ${BASEDIR}/target/Cryptomator.AppDir +mv ${BASEDIR}/target/libs ${BASEDIR}/target/Cryptomator.AppDir +mv ${BASEDIR}/target/mods ${BASEDIR}/target/Cryptomator.AppDir +mv ${BASEDIR}/LICENSE.txt ${BASEDIR}/target/Cryptomator.AppDir +cd ${BASEDIR}/target/Cryptomator.AppDir + +# add runtime +${JAVA_HOME}/bin/jlink + --output runtime + --module-path "${JAVA_HOME}/jmods" + --add-modules java.base,java.desktop,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.crypto.ec,jdk.accessibility + --no-header-files + --no-man-pages + --strip-debug + --compress=1 + +# extract jffi +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 +rm -r jni/x86_64-Linux + +# finalize AppDir +envsubst '${REVISION_NO}' < ${BASEDIR}/dist/appimage/resources/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 + +# load AppImageTool +curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o /tmp/appimagetool.AppImage +chmod +x /tmp/appimagetool.AppImage + +# create AppImage +/tmp/appimagetool.AppImage \ + ${BASEDIR}/target/Cryptomator.AppDir \ + cryptomator-SNAPSHOT-x86_64.AppImage \ + -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync' \ No newline at end of file diff --git a/dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh b/dist/appimage/resources/AppDir/bin/cryptomator.sh similarity index 100% rename from dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh rename to dist/appimage/resources/AppDir/bin/cryptomator.sh diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop b/dist/appimage/resources/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop similarity index 100% rename from dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop rename to dist/appimage/resources/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png b/dist/appimage/resources/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png similarity index 100% rename from dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png rename to dist/appimage/resources/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png b/dist/appimage/resources/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png similarity index 100% rename from dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png rename to dist/appimage/resources/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg b/dist/appimage/resources/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg similarity index 100% rename from dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg rename to dist/appimage/resources/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg diff --git a/dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml b/dist/appimage/resources/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml similarity index 100% rename from dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml rename to dist/appimage/resources/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml diff --git a/dist/launcher-linux.sh b/dist/buildkit/launcher-linux.sh old mode 100644 new mode 100755 similarity index 100% rename from dist/launcher-linux.sh rename to dist/buildkit/launcher-linux.sh diff --git a/dist/launcher-mac.sh b/dist/buildkit/launcher-mac.sh old mode 100644 new mode 100755 similarity index 100% rename from dist/launcher-mac.sh rename to dist/buildkit/launcher-mac.sh diff --git a/dist/launcher-win.bat b/dist/buildkit/launcher-win.bat similarity index 100% rename from dist/launcher-win.bat rename to dist/buildkit/launcher-win.bat