appimage.yml 10 KB

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