appimage.yml 9.7 KB

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