appimage-amd64.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. name: Build AppImage
  2. on:
  3. release:
  4. types: [published]
  5. workflow_dispatch:
  6. inputs:
  7. version:
  8. description: 'Version'
  9. required: false
  10. env:
  11. JAVA_DIST: 'temurin'
  12. JAVA_VERSION: 20
  13. OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.2/openjfx-20.0.2_linux-x64_bin-jmods.zip'
  14. OPENJFX_JMODS_AMD64_HASH: 'f522ac2ae4bdd61f0219b7b8d2058ff72a22f36a44378453bcfdcd82f8f5e08c'
  15. jobs:
  16. get-version:
  17. uses: ./.github/workflows/get-version.yml
  18. with:
  19. version: ${{ inputs.version }}
  20. build:
  21. name: Build AppImage
  22. runs-on: ubuntu-latest
  23. needs: [get-version]
  24. steps:
  25. - uses: actions/checkout@v3
  26. - name: Setup Java
  27. uses: actions/setup-java@v3
  28. with:
  29. distribution: ${{ env.JAVA_DIST }}
  30. java-version: ${{ env.JAVA_VERSION }}
  31. java-package: 'jdk+fx'
  32. check-latest: true
  33. cache: 'maven'
  34. - name: Download OpenJFX jmods
  35. id: download-jmods
  36. run: |
  37. curl -L ${{ env.OPENJFX_JMODS_AMD64 }} -o openjfx-jmods.zip
  38. echo "${{ env.OPENJFX_JMODS_AMD64_HASH }} openjfx-jmods.zip" | shasum -a256 --check
  39. mkdir -p openjfx-jmods
  40. unzip -j openjfx-jmods.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d openjfx-jmods
  41. - name: Ensure major jfx version in pom and in jmods is the same
  42. run: |
  43. JMOD_VERSION_AMD64=$(jmod describe openjfx-jmods/javafx.base.jmod | head -1)
  44. JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64#*@}
  45. JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64%%.*}
  46. POM_JFX_VERSION=$(mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout)
  47. POM_JFX_VERSION=${POM_JFX_VERSION#*@}
  48. POM_JFX_VERSION=${POM_JFX_VERSION%%.*}
  49. if [ $POM_JFX_VERSION -ne $JMOD_VERSION_AMD64 ]; then
  50. >&2 echo "Major JavaFX version in pom.xml (${POM_JFX_VERSION}) != amd64 jmod version (${JMOD_VERSION_AMD64})"
  51. exit 1
  52. fi
  53. - name: Set version
  54. run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }}
  55. - name: Run maven
  56. run: mvn -B clean package -Pdependency-check,linux -DskipTests
  57. - name: Patch target dir
  58. run: |
  59. cp LICENSE.txt target
  60. cp target/cryptomator-*.jar target/mods
  61. - name: Run jlink
  62. run: >
  63. ${JAVA_HOME}/bin/jlink
  64. --verbose
  65. --output runtime
  66. --module-path "${JAVA_HOME}/jmods:openjfx-jmods"
  67. --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.crypto.ec,jdk.security.auth,jdk.accessibility,jdk.management.jfr,jdk.net
  68. --strip-native-commands
  69. --no-header-files
  70. --no-man-pages
  71. --strip-debug
  72. --compress=1
  73. - name: Prepare additional launcher
  74. run: envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties
  75. env:
  76. SEMVER_STR: ${{ needs.get-version.outputs.semVerStr }}
  77. REVISION_NUM: ${{ needs.get-version.outputs.revNum }}
  78. - name: Run jpackage
  79. run: >
  80. ${JAVA_HOME}/bin/jpackage
  81. --verbose
  82. --type app-image
  83. --runtime-image runtime
  84. --input target/libs
  85. --module-path target/mods
  86. --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
  87. --dest appdir
  88. --name Cryptomator
  89. --vendor "Skymatic GmbH"
  90. --copyright "(C) 2016 - 2023 Skymatic GmbH"
  91. --app-version "${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum }}"
  92. --java-options "--enable-preview"
  93. --java-options "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.cryptomator.jfuse.linux.aarch64,org.purejava.appindicator"
  94. --java-options "-Xss5m"
  95. --java-options "-Xmx256m"
  96. --java-options "-Dcryptomator.appVersion=\"${{ needs.get-version.outputs.semVerStr }}\""
  97. --java-options "-Dfile.encoding=\"utf-8\""
  98. --java-options "-Djava.net.useSystemProxies=true"
  99. --java-options "-Dcryptomator.logDir=\"@{userhome}/.local/share/Cryptomator/logs\""
  100. --java-options "-Dcryptomator.pluginDir=\"@{userhome}/.local/share/Cryptomator/plugins\""
  101. --java-options "-Dcryptomator.settingsPath=\"@{userhome}/.config/Cryptomator/settings.json:@{userhome}/.Cryptomator/settings.json\""
  102. --java-options "-Dcryptomator.p12Path=\"@{userhome}/.config/Cryptomator/key.p12\""
  103. --java-options "-Dcryptomator.ipcSocketPath=\"@{userhome}/.config/Cryptomator/ipc.socket\""
  104. --java-options "-Dcryptomator.mountPointsDir=\"@{userhome}/.local/share/Cryptomator/mnt\""
  105. --java-options "-Dcryptomator.showTrayIcon=true"
  106. --java-options "-Dcryptomator.integrationsLinux.trayIconsDir=\"@{appdir}/usr/share/icons/hicolor/symbolic/apps\""
  107. --java-options "-Dcryptomator.buildNumber=\"appimage-${{ needs.get-version.outputs.revNum }}\""
  108. --add-launcher Cryptomator-gtk2=launcher-gtk2.properties
  109. --resource-dir dist/linux/resources
  110. - name: Patch Cryptomator.AppDir
  111. run: |
  112. mv appdir/Cryptomator Cryptomator.AppDir
  113. cp -r dist/linux/appimage/resources/AppDir/* Cryptomator.AppDir/
  114. cp dist/linux/common/org.cryptomator.Cryptomator256.png Cryptomator.AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png
  115. cp dist/linux/common/org.cryptomator.Cryptomator512.png Cryptomator.AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png
  116. cp dist/linux/common/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg
  117. cp dist/linux/common/org.cryptomator.Cryptomator.tray.svg Cryptomator.AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.tray.svg
  118. cp dist/linux/common/org.cryptomator.Cryptomator.tray-unlocked.svg Cryptomator.AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.tray-unlocked.svg
  119. cp dist/linux/common/org.cryptomator.Cryptomator.tray.svg Cryptomator.AppDir/usr/share/icons/hicolor/symbolic/apps/org.cryptomator.Cryptomator.tray-symbolic.svg
  120. cp dist/linux/common/org.cryptomator.Cryptomator.tray-unlocked.svg Cryptomator.AppDir/usr/share/icons/hicolor/symbolic/apps/org.cryptomator.Cryptomator.tray-unlocked-symbolic.svg
  121. cp dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.metainfo.xml
  122. cp dist/linux/common/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop
  123. cp dist/linux/common/application-vnd.cryptomator.vault.xml Cryptomator.AppDir/usr/share/mime/packages/application-vnd.cryptomator.vault.xml
  124. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
  125. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
  126. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
  127. ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
  128. ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
  129. - name: Download AppImageKit
  130. run: |
  131. curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
  132. chmod +x appimagetool.AppImage
  133. ./appimagetool.AppImage --appimage-extract
  134. - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
  135. run: |
  136. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  137. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign README.md
  138. env:
  139. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  140. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  141. - name: Build AppImage
  142. run: >
  143. ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.get-version.outputs.semVerStr }}-x86_64.AppImage
  144. -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
  145. --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
  146. - name: Create detached GPG signatures
  147. run: |
  148. gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-*.AppImage
  149. gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-*.AppImage.zsync
  150. - name: Upload artifacts
  151. uses: actions/upload-artifact@v3
  152. with:
  153. name: appimage
  154. path: |
  155. cryptomator-*.AppImage
  156. cryptomator-*.AppImage.zsync
  157. cryptomator-*.asc
  158. if-no-files-found: error
  159. - name: Publish AppImage on GitHub Releases
  160. if: startsWith(github.ref, 'refs/tags/')
  161. uses: softprops/action-gh-release@v1
  162. with:
  163. fail_on_unmatched_files: true
  164. token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
  165. files: |
  166. cryptomator-*.AppImage
  167. cryptomator-*.zsync
  168. cryptomator-*.asc