Sfoglia il codice sorgente

create app dir in matrix build

Sebastian Stenzel 4 anni fa
parent
commit
559f3116f9

+ 91 - 98
.github/workflows/build.yml

@@ -87,14 +87,40 @@ jobs:
             target/LICENSE.txt
             target/${{ matrix.launcher }}
           if-no-files-found: error
-
 #
-# jlink
+# Release Metadata
 #
 
-  jlink:
-    name: Create runtime-${{ matrix.profile }}
+  metadata:
+    name: Determine Version Metadata
+    runs-on: ubuntu-latest
     needs: test
+    outputs:
+      versionStr: ${{ steps.versions.outputs.versionStr }}
+      versionNum: ${{ steps.versions.outputs.versionNum }}
+      revNum: ${{ steps.versions.outputs.revNum }}
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+      - id: versions
+        run: |
+          if [[ $GITHUB_REF == refs/tags/* ]]; then
+            echo "::set-output name=versionStr::${GITHUB_REF##*/}"
+            echo "::set-output name=versionNum::${GITHUB_REF##*/}"
+          else
+            echo "::set-output name=versionStr::SNAPSHOT"
+            echo "::set-output name=versionNum::99.0.0"
+          fi
+          echo "::set-output name=revNum::`git rev-list --count HEAD`"
+
+#
+# Application Directory
+#
+
+  appdir:
+    name: Create appdir-${{ matrix.profile }}
+    needs: [buildkit, metadata]
     runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: true
@@ -102,15 +128,49 @@ jobs:
         include:
         - os: ubuntu-latest
           profile: linux
+          jpackageoptions: >
+            --java-options "-Dfile.encoding=\"utf-8\""
+            --java-options "-Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\""
+            --java-options "-Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\""
+            --java-options "-Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\""
+            --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\""
+            --java-options "-Dcryptomator.showTrayIcon=false"
+            --java-options "-Dcryptomator.buildNumber=\"appimage-${{ needs.metadata.outputs.revNum }}\""
+            --resource-dir dist/appdir/linux/resources
         - os: windows-latest
           profile: win
+          jpackageoptions: >
+            --java-options "-Dfile.encoding=\"utf-8\""
+            --java-options "-Dcryptomator.logDir=\"~/AppData/Roaming/Cryptomator\""
+            --java-options "-Dcryptomator.settingsPath=\"~/AppData/Roaming/Cryptomator/settings.json\""
+            --java-options "-Dcryptomator.ipcSocketPath=\"~/AppData/Roaming/Cryptomator/ipc.socket\""
+            --java-options "-Dcryptomator.keychainPath=\"~/AppData/Roaming/Cryptomator/keychain.json\""
+            --java-options "-Dcryptomator.mountPointsDir=\"~/Cryptomator\""
+            --java-options "-Dcryptomator.showTrayIcon=true"
+            --java-options "-Dcryptomator.buildNumber=\"msi-${{ needs.metadata.outputs.revNum }}\""
+            --resource-dir dist/appdir/win/resources
+            --icon dist/appdir/win/resources/Cryptomator.ico
         - os: macOS-latest
           profile: mac
+          jpackageoptions: >
+            --java-options "-Dfile.encoding=\"utf-8\""
+            --java-options "-Dcryptomator.logDir=\"~/Library/Logs/Cryptomator\""
+            --java-options "-Dcryptomator.settingsPath=\"~/Library/Application Support/Cryptomator/settings.json\""
+            --java-options "-Dcryptomator.ipcSocketPath=\"~/Library/Application Support/Cryptomator/ipc.socket\""
+            --java-options "-Dcryptomator.showTrayIcon=true"
+            --java-options "-Dcryptomator.buildNumber=\"dmg-${{ needs.metadata.outputs.revNum }}\""
+            --mac-package-identifier org.cryptomator
+            --resource-dir dist/appdir/mac/resources
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-java@v1
         with:
           java-version: ${{ env.JAVA_VERSION }}
+      - name: Download buildkit-${{ matrix.profile }}
+        uses: actions/download-artifact@v2
+        with:
+          name: buildkit-${{ matrix.profile }}
+          path: buildkit
       - name: Create Runtime Image
         run: >
           ${JAVA_HOME}/bin/jlink
@@ -122,40 +182,36 @@ jobs:
           --no-man-pages
           --strip-debug
           --compress=1
-      - name: Upload runtime-${{ matrix.profile }}
+      - name: Create App Directory
+        run: >
+          ${JAVA_HOME}/bin/jpackage
+          --verbose
+          --type app-image
+          --runtime-image runtime
+          --input buildkit/libs
+          --module-path buildkit/mods
+          --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
+          --dest appdir
+          --name Cryptomator
+          --vendor "Skymatic GmbH"
+          --copyright "(C) 2016 - 2021 Skymatic GmbH"
+          --app-version "${{ needs.metadata.outputs.versionNum }}.${{ needs.metadata.outputs.revNum }}"
+          --java-options "-Xss5m"
+          --java-options "-Xmx256m"
+          ${{ matrix.jpackageoptions }}
+      - name: Add Contrib Files
+        run: |
+          if [ -e dist/appdir/${{ matrix.profile }}/contrib/ ]; then
+            cp dist/appdir/${{ matrix.profile }}/contrib/* appdir/
+          fi
+      - name: Upload appdir-${{ matrix.profile }}
         uses: actions/upload-artifact@v2
         with:
-          name: runtime-${{ matrix.profile }}
-          path: runtime
+          name: appdir-${{ matrix.profile }}
+          path: appdir
           if-no-files-found: error
 
-#
-# Release Metadata
-#
 
-  metadata:
-    name: Determine Version Metadata
-    runs-on: ubuntu-latest
-    needs: test
-    outputs:
-      versionStr: ${{ steps.versions.outputs.versionStr }}
-      versionNum: ${{ steps.versions.outputs.versionNum }}
-      revNum: ${{ steps.versions.outputs.revNum }}
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0
-      - id: versions
-        run: |
-          if [[ $GITHUB_REF == refs/tags/* ]]; then
-            echo "::set-output name=versionStr::${GITHUB_REF##*/}"
-            echo "::set-output name=versionNum::${GITHUB_REF##*/}"
-          else
-            echo "::set-output name=versionStr::SNAPSHOT"
-            echo "::set-output name=versionNum::99.0.0"
-          fi
-          echo "::set-output name=revNum::`git rev-list --count HEAD`"
-          
 #
 # Linux AppImage
 # 
@@ -163,19 +219,14 @@ jobs:
   linux-appimage:
     name: Build AppImage
     runs-on: ubuntu-latest
-    needs: [buildkit, jlink, metadata]
+    needs: [appdir]
     steps:
       - uses: actions/checkout@v2
       - name: Download buildkit-linux
         uses: actions/download-artifact@v2
         with:
-          name: buildkit-linux
+          name: appdir-linux
           path: Cryptomator.AppDir
-      - name: Download runtime-linux
-        uses: actions/download-artifact@v2
-        with:
-          name: runtime-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'`
@@ -226,64 +277,6 @@ jobs:
             cryptomator-${{ needs.metadata.outputs.versionStr }}-x86_64.AppImage.zsync.asc
           if-no-files-found: error
 
-#
-# Windows App Dir
-#
-
-  windows-appdir:
-    name: Build Windows App Directory
-    runs-on: windows-latest
-    needs: [buildkit, jlink, metadata]
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions/setup-java@v1
-        with:
-          java-version: ${{ env.JAVA_VERSION }}
-      - name: Download buildkit-win
-        uses: actions/download-artifact@v2
-        with:
-          name: buildkit-win
-          path: buildkit
-      - name: Download runtime-win
-        uses: actions/download-artifact@v2
-        with:
-          name: runtime-win
-          path: runtime
-      - name: Create app directory
-        run: >
-          ${JAVA_HOME}/bin/jpackage
-          --verbose
-          --type app-image
-          --runtime-image runtime
-          --input buildkit/libs
-          --module-path buildkit/mods
-          --dest app
-          --name Cryptomator
-          --vendor "Skymatic GmbH"
-          --copyright "(C) 2016 - 2021 Skymatic GmbH"
-          --app-version "${{ needs.metadata.outputs.versionNum }}.${{ needs.metadata.outputs.revNum }}"
-          --icon dist/msi/resources/app/Cryptomator.ico
-          --java-options "-Dfile.encoding=\"utf-8\""
-          --java-options "-Dcryptomator.logDir=\"~/AppData/Roaming/Cryptomator\""
-          --java-options "-Dcryptomator.settingsPath=\"~/AppData/Roaming/Cryptomator/settings.json\""
-          --java-options "-Dcryptomator.ipcPortPath=\"~/AppData/Roaming/Cryptomator/ipcPort.bin\""
-          --java-options "-Dcryptomator.keychainPath=\"~/AppData/Roaming/Cryptomator/keychain.json\""
-          --java-options "-Dcryptomator.mountPointsDir=\"~/Cryptomator\""
-          --java-options "-Dcryptomator.showTrayIcon=true"
-          --java-options "-Dcryptomator.buildNumber=\"msi-${{ needs.metadata.outputs.revNum }}\""
-          --java-options "-Xss2m"
-          --java-options "-Xmx256m"
-          --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
-      - name: Patch app directory
-        run: |
-          cp dist/msi/resources/app/dlls/* app/Cryptomator/
-      - name: Upload app directory
-        uses: actions/upload-artifact@v2
-        with:
-          name: win-appdir
-          path: app/Cryptomator
-          if-no-files-found: error
-
   # release:
   #   name: Draft a Release on GitHub Releases
   #   runs-on: ubuntu-latest

+ 0 - 0
dist/appdir/linux/resources/.gitkeep


BIN
dist/appdir/mac/resources/Cryptomator-Vault.icns


+ 16 - 0
dist/appdir/mac/resources/Cryptomator.entitlements

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.security.cs.allow-dyld-environment-variables</key>
+	<true/>
+	<key>com.apple.security.cs.allow-jit</key>
+	<true/>
+	<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
+	<true/>
+	<key>com.apple.security.cs.disable-executable-page-protection</key>
+	<true/>
+	<key>com.apple.security.cs.disable-library-validation</key>
+	<true/>
+</dict>
+</plist>

BIN
dist/appdir/mac/resources/Cryptomator.icns


+ 120 - 0
dist/appdir/mac/resources/Info.plist

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+  <key>LSMinimumSystemVersion</key>
+  <string>10.13.0</string>
+  <key>CFBundleDevelopmentRegion</key>
+  <string>English</string>
+  <key>CFBundleAllowMixedLocalizations</key>
+  <true/>
+  <key>CFBundleExecutable</key>
+  <string>Cryptomator</string>
+  <key>CFBundleIconFile</key>
+  <string>Cryptomator.icns</string>
+  <key>CFBundleIdentifier</key>
+  <string>org.cryptomator</string>
+  <key>CFBundleInfoDictionaryVersion</key>
+  <string>6.0</string>
+  <key>CFBundleName</key>
+  <string>Cryptomator</string>
+  <key>CFBundlePackageType</key>
+  <string>APPL</string>
+  <key>CFBundleShortVersionString</key>
+  <string>###BUNDLE_SHORT_VERSION_STRING###</string>
+  <key>CFBundleSignature</key>
+  <string>????</string>
+  <key>LSApplicationCategoryType</key>
+  <string>public.app-category.utilities</string>
+  <key>CFBundleVersion</key>
+  <string>###BUNDLE_VERSION###</string>
+  <key>NSHumanReadableCopyright</key>
+  <string>cryptomator.org</string>
+  <key>NSHighResolutionCapable</key>
+  <string>true</string>
+  <key>NSUbiquitousContainers</key>
+  <dict>
+    <key>iCloud.com.setolabs.Cryptomator</key>
+    <dict>
+      <key>NSUbiquitousContainerIsDocumentScopePublic</key>
+      <true/>
+      <key>NSUbiquitousContainerName</key>
+      <string>Cryptomator</string>
+      <key>NSUbiquitousContainerSupportedFolderLevels</key>
+      <string>Any</string>
+    </dict>
+  </dict>
+  <!-- register .cryptomator extension -->
+  <key>CFBundleDocumentTypes</key>
+  <array>
+    <dict>
+      <key>LSItemContentTypes</key>
+      <array>
+        <string>org.cryptomator.vault-metadata</string>
+      </array>
+      <key>CFBundleTypeIconFile</key>
+      <string>Cryptomator-Vault.icns</string>
+      <key>CFBundleTypeName</key>
+      <string>Cryptomator Vault Metadata</string>
+      <key>LSHandlerRank</key>
+      <string>Owner</string>
+      <key>CFBundleTypeRole</key>
+      <string>Editor</string>
+    </dict>
+  </array>
+  <key>UTExportedTypeDeclarations</key>
+  <array>
+    <dict>
+      <key>UTTypeIdentifier</key>
+      <string>org.cryptomator.vault-metadata</string>
+      <key>UTTypeConformsTo</key>
+      <array>
+        <string>public.utf8-plain-text</string>
+        <string>public.json</string>
+      </array>
+      <key>UTTypeDescription</key>
+      <string>Cryptomator Vault Metadata</string>
+      <key>UTTypeIconFile</key>
+      <string>Cryptomator-Vault.icns</string>
+      <key>UTTypeTagSpecification</key>
+      <dict>
+        <key>public.filename-extension</key>
+        <array>
+          <string>cryptomator</string>
+        </array>
+        <key>public.mime-type</key>
+        <array>
+          <string>application/x-vnd.cryptomator.vault-metadata</string>
+        </array>
+      </dict>
+    </dict>
+    <dict>
+      <key>UTTypeIdentifier</key>
+      <string>org.cryptomator.encrypted-data</string>
+      <key>UTTypeConformsTo</key>
+      <array>
+        <string>public.data</string>
+      </array>
+      <key>UTTypeDescription</key>
+      <string>Cryptomator Encrypted Data</string>
+      <key>UTTypeIconFile</key>
+      <string>Cryptomator-Vault.icns</string>
+      <key>UTTypeTagSpecification</key>
+      <dict>
+        <key>public.filename-extension</key>
+        <array>
+          <string>c9r</string>
+          <string>c9s</string>
+        </array>
+        <key>public.mime-type</key>
+        <array>
+          <string>application/vnd.cryptomator.encrypted</string>
+        </array>
+      </dict>
+    </dict>
+  </array>
+  <!-- allow utilization of integrated GPU, see https://developer.apple.com/library/mac/qa/qa1734/_index.html -->
+  <key>NSSupportsAutomaticGraphicsSwitching</key>
+  <true/>
+</dict>
+</plist>

dist/msi/resources/app/dlls/dokan1.dll → dist/appdir/win/contrib/dokan1.dll


dist/msi/resources/app/dlls/jnidispatch.dll → dist/appdir/win/contrib/jnidispatch.dll


dist/msi/resources/app/Cryptomator.ico → dist/appdir/win/resources/Cryptomator.ico