appimage.yml 10 KB

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