release.yml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. name: Installers and Release
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. semver:
  6. description: 'SemVer'
  7. required: true
  8. default: '0.99.99-SNAPSHOT'
  9. push:
  10. tags: # see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
  11. - '[0-9]+.[0-9]+.[0-9]+'
  12. - '[0-9]+.[0-9]+.[0-9]+-*'
  13. env:
  14. JAVA_VERSION: 17
  15. defaults:
  16. run:
  17. shell: bash
  18. jobs:
  19. #
  20. # Buildkit
  21. #
  22. buildkit:
  23. name: Build ${{ matrix.profile }}-buildkit
  24. runs-on: ${{ matrix.os }}
  25. strategy:
  26. fail-fast: true
  27. matrix:
  28. include:
  29. - os: ubuntu-latest
  30. profile: linux
  31. - os: windows-latest
  32. profile: win
  33. - os: macos-latest
  34. profile: mac
  35. steps:
  36. - uses: actions/checkout@v2
  37. - uses: actions/setup-java@v2
  38. with:
  39. distribution: 'temurin'
  40. java-version: ${{ env.JAVA_VERSION }}
  41. cache: 'maven'
  42. - name: Ensure to use tagged version
  43. run: mvn versions:set -DnewVersion=${GITHUB_REF##*/} # use shell parameter expansion to strip of 'refs/tags'
  44. if: startsWith(github.ref, 'refs/tags/')
  45. - name: Build and Test
  46. run: mvn -B clean package -Pdependency-check,${{ matrix.profile }}
  47. - name: Patch buildkit
  48. run: |
  49. cp LICENSE.txt target
  50. cp dist/${{ matrix.profile }}/launcher* target
  51. cp target/cryptomator-*.jar target/mods
  52. - name: Upload ${{ matrix.profile }}-buildkit
  53. uses: actions/upload-artifact@v2
  54. with:
  55. name: ${{ matrix.profile }}-buildkit
  56. path: |
  57. target/libs
  58. target/mods
  59. target/LICENSE.txt
  60. target/launcher*
  61. if-no-files-found: error
  62. #
  63. # Release Metadata
  64. #
  65. metadata:
  66. name: Determine Version Metadata
  67. runs-on: ubuntu-latest
  68. outputs:
  69. semVerNum: ${{ steps.versions.outputs.semVerNum }}
  70. semVerStr: ${{ steps.versions.outputs.semVerStr }}
  71. ppaVerStr: ${{ steps.versions.outputs.ppaVerStr }}
  72. revNum: ${{ steps.versions.outputs.revNum }}
  73. steps:
  74. - uses: actions/checkout@v2
  75. with:
  76. fetch-depth: 0
  77. - id: versions
  78. run: |
  79. if [[ $GITHUB_REF == refs/tags/* ]]; then
  80. SEM_VER_STR=${GITHUB_REF##*/}
  81. else
  82. SEM_VER_STR=${{ github.event.inputs.semver }}
  83. fi
  84. SEM_VER_NUM=`echo ${SEM_VER_STR} | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'`
  85. REVCOUNT=`git rev-list --count HEAD`
  86. echo "::set-output name=semVerStr::${SEM_VER_STR}"
  87. echo "::set-output name=semVerNum::${SEM_VER_NUM}"
  88. echo "::set-output name=ppaVerStr::${SEM_VER_STR/-/\~}-${REVCOUNT}"
  89. echo "::set-output name=revNum::${REVCOUNT}"
  90. - uses: skymatic/semver-validation-action@v1
  91. with:
  92. version: ${{ steps.versions.outputs.semVerStr }}
  93. #
  94. # Application Directory
  95. #
  96. appdir:
  97. name: Create ${{ matrix.profile }}-appdir
  98. needs: [buildkit, metadata]
  99. runs-on: ${{ matrix.os }}
  100. strategy:
  101. fail-fast: true
  102. matrix:
  103. include:
  104. - os: ubuntu-latest
  105. profile: linux
  106. jpackageoptions: >
  107. --app-version "${{ needs.metadata.outputs.semVerNum }}.${{ needs.metadata.outputs.revNum }}"
  108. --java-options "-Dfile.encoding=\"utf-8\""
  109. --java-options "-Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\""
  110. --java-options "-Dcryptomator.pluginDir=\"~/.local/share/Cryptomator/plugins\""
  111. --java-options "-Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\""
  112. --java-options "-Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\""
  113. --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\""
  114. --java-options "-Dcryptomator.showTrayIcon=false"
  115. --java-options "-Dcryptomator.buildNumber=\"appimage-${{ needs.metadata.outputs.revNum }}\""
  116. --resource-dir dist/linux/resources
  117. - os: windows-latest
  118. profile: win
  119. jpackageoptions: >
  120. --app-version "${{ needs.metadata.outputs.semVerNum }}.${{ needs.metadata.outputs.revNum }}"
  121. --java-options "-Dfile.encoding=\"utf-8\""
  122. --java-options "-Dcryptomator.logDir=\"~/AppData/Roaming/Cryptomator\""
  123. --java-options "-Dcryptomator.pluginDir=\"~/AppData/Roaming/Cryptomator/Plugins\""
  124. --java-options "-Dcryptomator.settingsPath=\"~/AppData/Roaming/Cryptomator/settings.json\""
  125. --java-options "-Dcryptomator.ipcSocketPath=\"~/AppData/Roaming/Cryptomator/ipc.socket\""
  126. --java-options "-Dcryptomator.keychainPath=\"~/AppData/Roaming/Cryptomator/keychain.json\""
  127. --java-options "-Dcryptomator.mountPointsDir=\"~/Cryptomator\""
  128. --java-options "-Dcryptomator.showTrayIcon=true"
  129. --java-options "-Dcryptomator.buildNumber=\"msi-${{ needs.metadata.outputs.revNum }}\""
  130. --resource-dir dist/win/resources
  131. --icon dist/win/resources/Cryptomator.ico
  132. - os: macos-latest
  133. profile: mac
  134. jpackageoptions: >
  135. --app-version "${{ needs.metadata.outputs.semVerNum }}"
  136. --java-options "-Dfile.encoding=\"utf-8\""
  137. --java-options "-Dapple.awt.enableTemplateImages=true"
  138. --java-options "-Dcryptomator.logDir=\"~/Library/Logs/Cryptomator\""
  139. --java-options "-Dcryptomator.pluginDir=\"~/Library/Application Support/Cryptomator/Plugins\""
  140. --java-options "-Dcryptomator.settingsPath=\"~/Library/Application Support/Cryptomator/settings.json\""
  141. --java-options "-Dcryptomator.ipcSocketPath=\"~/Library/Application Support/Cryptomator/ipc.socket\""
  142. --java-options "-Dcryptomator.showTrayIcon=true"
  143. --java-options "-Dcryptomator.buildNumber=\"dmg-${{ needs.metadata.outputs.revNum }}\""
  144. --mac-package-identifier org.cryptomator
  145. --resource-dir dist/mac/resources
  146. steps:
  147. - uses: actions/checkout@v2
  148. - uses: actions/setup-java@v2
  149. with:
  150. distribution: 'temurin'
  151. java-version: ${{ env.JAVA_VERSION }}
  152. - name: Download ${{ matrix.profile }}-buildkit
  153. uses: actions/download-artifact@v2
  154. with:
  155. name: ${{ matrix.profile }}-buildkit
  156. path: buildkit
  157. - name: Create Runtime Image
  158. run: >
  159. ${JAVA_HOME}/bin/jlink
  160. --verbose
  161. --output runtime
  162. --module-path "${JAVA_HOME}/jmods"
  163. --add-modules java.base,java.desktop,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.crypto.ec,jdk.accessibility,jdk.management.jfr
  164. --no-header-files
  165. --no-man-pages
  166. --strip-debug
  167. --compress=1
  168. - name: Create App Directory
  169. run: >
  170. ${JAVA_HOME}/bin/jpackage
  171. --verbose
  172. --type app-image
  173. --runtime-image runtime
  174. --input buildkit/libs
  175. --module-path buildkit/mods
  176. --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
  177. --dest appdir
  178. --name Cryptomator
  179. --vendor "Skymatic GmbH"
  180. --copyright "(C) 2016 - 2022 Skymatic GmbH"
  181. --java-options "-Xss5m"
  182. --java-options "-Xmx256m"
  183. --java-options "-Dcryptomator.appVersion=\"${{ needs.metadata.outputs.semVerStr }}\""
  184. ${{ matrix.jpackageoptions }}
  185. - name: Create appdir.tar
  186. run: tar -cvf appdir.tar appdir
  187. - name: Upload ${{ matrix.profile }}-appdir
  188. uses: actions/upload-artifact@v2
  189. with:
  190. name: ${{ matrix.profile }}-appdir
  191. path: appdir.tar
  192. if-no-files-found: error
  193. #
  194. # Linux PPA Source Package
  195. #
  196. ppa:
  197. name: Upload source package to PPA
  198. needs: [buildkit, metadata]
  199. runs-on: ubuntu-18.04
  200. steps:
  201. - uses: actions/checkout@v2
  202. - name: install build tools
  203. run: |
  204. sudo apt-get update
  205. sudo apt-get install debhelper devscripts dput
  206. - name: Download linux-buildkit
  207. uses: actions/download-artifact@v2
  208. with:
  209. name: linux-buildkit
  210. path: pkgdir
  211. - name: create orig.tar.gz
  212. run: tar -cJf cryptomator_${{ needs.metadata.outputs.ppaVerStr }}.orig.tar.xz -C pkgdir .
  213. - name: patch and rename pkgdir
  214. run: |
  215. cp -r dist/linux/debian/ pkgdir
  216. cp -r dist/linux/resources/ pkgdir
  217. export RFC2822_TIMESTAMP=`date --rfc-2822`
  218. envsubst '${VERSION_STR} ${VERSION_NUM} ${REVISION_NUM}' < dist/linux/debian/rules > pkgdir/debian/rules
  219. envsubst '${VERSION_STR}' < dist/linux/debian/org.cryptomator.Cryptomator.desktop > pkgdir/debian/org.cryptomator.Cryptomator.desktop
  220. envsubst '${PPA_VERSION} ${RFC2822_TIMESTAMP}' < dist/linux/debian/changelog > pkgdir/debian/changelog
  221. find . -name "*.jar" >> pkgdir/debian/source/include-binaries
  222. mv pkgdir cryptomator_${{ needs.metadata.outputs.ppaVerStr }}
  223. env:
  224. VERSION_STR: ${{ needs.metadata.outputs.semVerStr }}
  225. VERSION_NUM: ${{ needs.metadata.outputs.semVerNum }}
  226. REVISION_NUM: ${{ needs.metadata.outputs.revNum }}
  227. PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1
  228. - name: import gpg key 615D449FE6E6A235
  229. run: |
  230. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  231. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign dist/linux/debian/rules
  232. env:
  233. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  234. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  235. - name: debuild
  236. run: debuild -S -sa -d
  237. env:
  238. DEBSIGN_PROGRAM: gpg --batch --pinentry-mode loopback
  239. DEBSIGN_KEYID: 615D449FE6E6A235
  240. working-directory: cryptomator_${{ needs.metadata.outputs.ppaVerStr }}
  241. - name: Upload artifacts
  242. uses: actions/upload-artifact@v2
  243. with:
  244. name: linux-deb-source-package
  245. path: |
  246. cryptomator_*.dsc
  247. cryptomator_*.orig.tar.xz
  248. cryptomator_*.debian.tar.xz
  249. cryptomator_*_source.changes
  250. cryptomator_*_source.buildinfo
  251. - name: dput to beta repo
  252. run: dput ppa:sebastian-stenzel/cryptomator-beta cryptomator_${PPA_VERSION}_source.changes
  253. env:
  254. PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1
  255. #
  256. # Linux Cryptomator.AppImage
  257. #
  258. linux-appimage:
  259. name: Build Cryptomator.AppImage
  260. runs-on: ubuntu-latest
  261. needs: [appdir, metadata]
  262. steps:
  263. - uses: actions/checkout@v2
  264. - name: Download linux-appdir
  265. uses: actions/download-artifact@v2
  266. with:
  267. name: linux-appdir
  268. - name: Untar appdir.tar
  269. run: |
  270. tar -xvf appdir.tar
  271. - name: Patch Cryptomator.AppDir
  272. run: |
  273. mv appdir/Cryptomator Cryptomator.AppDir
  274. cp -r dist/linux/appimage/resources/AppDir/* Cryptomator.AppDir/
  275. envsubst '${REVISION_NO} ${SEMVER_STR}' < dist/linux/appimage/resources/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh
  276. envsubst '${SEMVER_STR}' < dist/linux/common/org.cryptomator.Cryptomator.desktop > Cryptomator.AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop
  277. cp dist/linux/common/org.cryptomator.Cryptomator256.png Cryptomator.AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png
  278. cp dist/linux/common/org.cryptomator.Cryptomator512.png Cryptomator.AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png
  279. cp dist/linux/common/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg
  280. cp dist/linux/common/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop
  281. cp dist/linux/common/org.cryptomator.Cryptomator.appdata.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml
  282. cp dist/linux/common/cryptomator-vault.xml Cryptomator.AppDir/usr/share/mime/packages/cryptomator-vault.xml
  283. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
  284. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
  285. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
  286. ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
  287. ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
  288. env:
  289. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  290. SEMVER_STR: ${{ needs.metadata.outputs.semVerStr }}
  291. - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
  292. run: |
  293. JFFI_NATIVE_JAR=`ls lib/app/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
  294. ${JAVA_HOME}/bin/jar -xf lib/app/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
  295. mv jni/x86_64-Linux/* lib/app/libjffi.so
  296. working-directory: Cryptomator.AppDir
  297. - name: Download AppImageKit
  298. run: |
  299. curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
  300. chmod +x appimagetool.AppImage
  301. ./appimagetool.AppImage --appimage-extract
  302. - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
  303. run: |
  304. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  305. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign Cryptomator.AppDir/AppRun
  306. env:
  307. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  308. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  309. - name: Build AppImage
  310. run: >
  311. ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.semVerStr }}-x86_64.AppImage
  312. -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
  313. --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
  314. - name: Upload AppImage
  315. uses: actions/upload-artifact@v2
  316. with:
  317. name: linux-appimage
  318. path: |
  319. cryptomator-*.AppImage
  320. cryptomator-*.AppImage.zsync
  321. if-no-files-found: error
  322. #
  323. # macOS Cryptomator.app
  324. #
  325. mac-app:
  326. name: Build Cryptomator.app
  327. runs-on: macos-latest
  328. needs: [appdir, metadata]
  329. steps:
  330. - uses: actions/checkout@v2
  331. - name: Download mac-appdir
  332. uses: actions/download-artifact@v2
  333. with:
  334. name: mac-appdir
  335. - name: Untar appdir.tar
  336. run: tar -xvf appdir.tar
  337. - name: Patch Cryptomator.app
  338. run: |
  339. mv appdir/Cryptomator.app Cryptomator.app
  340. mv dist/mac/resources/Cryptomator-Vault.icns Cryptomator.app/Contents/Resources/
  341. sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" Cryptomator.app/Contents/Info.plist
  342. sed -i '' "s|###BUNDLE_VERSION###|${REVISION_NO}|g" Cryptomator.app/Contents/Info.plist
  343. env:
  344. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  345. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  346. - name: Install codesign certificate
  347. env:
  348. CODESIGN_P12_BASE64: ${{ secrets.MACOS_CODESIGN_P12_BASE64 }}
  349. CODESIGN_P12_PW: ${{ secrets.MACOS_CODESIGN_P12_PW }}
  350. CODESIGN_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_TMP_KEYCHAIN_PW }}
  351. run: |
  352. # create variables
  353. CERTIFICATE_PATH=$RUNNER_TEMP/codesign.p12
  354. KEYCHAIN_PATH=$RUNNER_TEMP/codesign.keychain-db
  355. # import certificate and provisioning profile from secrets
  356. echo -n "$CODESIGN_P12_BASE64" | base64 --decode --output $CERTIFICATE_PATH
  357. # create temporary keychain
  358. security create-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  359. security set-keychain-settings -lut 900 $KEYCHAIN_PATH
  360. security unlock-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  361. # import certificate to keychain
  362. security import $CERTIFICATE_PATH -P "$CODESIGN_P12_PW" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
  363. security list-keychain -d user -s $KEYCHAIN_PATH
  364. - name: Codesign
  365. env:
  366. CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
  367. run: |
  368. find Cryptomator.app/Contents/runtime/Contents/MacOS -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  369. for JAR_PATH in `find Cryptomator.app -name "*.jar"`; do
  370. if [[ `unzip -l ${JAR_PATH} | grep '.dylib\|.jnilib'` ]]; then
  371. JAR_FILENAME=$(basename ${JAR_PATH})
  372. OUTPUT_PATH=${JAR_PATH%.*}
  373. echo "Codesigning libs in ${JAR_FILENAME}..."
  374. unzip -q ${JAR_PATH} -d ${OUTPUT_PATH}
  375. find ${OUTPUT_PATH} -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  376. find ${OUTPUT_PATH} -name '*.jnilib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  377. rm ${JAR_PATH}
  378. pushd ${OUTPUT_PATH} > /dev/null
  379. zip -qr ../${JAR_FILENAME} *
  380. popd > /dev/null
  381. rm -r ${OUTPUT_PATH}
  382. fi
  383. done
  384. echo "Codesigning Cryptomator.app..."
  385. codesign --force --deep --entitlements dist/mac/Cryptomator.entitlements -o runtime -s ${CODESIGN_IDENTITY} Cryptomator.app
  386. - name: Clean up codesign certificate
  387. if: ${{ always() }}
  388. run: security delete-keychain $RUNNER_TEMP/codesign.keychain-db
  389. - name: Create app.tar
  390. run: tar -cvf app.tar Cryptomator.app
  391. - name: Upload mac-app
  392. uses: actions/upload-artifact@v2
  393. with:
  394. name: mac-app
  395. path: app.tar
  396. if-no-files-found: error
  397. #
  398. # macOS Cryptomator.dmg
  399. #
  400. mac-dmg:
  401. name: Build Cryptomator.dmg
  402. runs-on: macos-11
  403. needs: [mac-app, metadata]
  404. steps:
  405. - uses: actions/checkout@v2
  406. - name: Download mac-appdir
  407. uses: actions/download-artifact@v2
  408. with:
  409. name: mac-app
  410. - name: Untar app.tar
  411. run: tar -xvf app.tar
  412. - name: Prepare .dmg contents
  413. run: |
  414. mkdir dmg
  415. mv Cryptomator.app dmg
  416. cp dist/mac/dmg/resources/macFUSE.webloc dmg
  417. ls -l dmg
  418. - name: Install create-dmg
  419. run: |
  420. brew install create-dmg
  421. create-dmg --help
  422. - name: Create .dmg
  423. run: >
  424. create-dmg
  425. --volname Cryptomator
  426. --volicon "dist/mac/dmg/resources/Cryptomator-Volume.icns"
  427. --background "dist/mac/dmg/resources/Cryptomator-background.tiff"
  428. --window-pos 400 100
  429. --window-size 640 694
  430. --icon-size 128
  431. --icon "Cryptomator.app" 128 245
  432. --hide-extension "Cryptomator.app"
  433. --icon "macFUSE.webloc" 320 501
  434. --hide-extension "macFUSE.webloc"
  435. --app-drop-link 512 245
  436. --eula "dist/mac/dmg/resources/license.rtf"
  437. --icon ".background" 128 758
  438. --icon ".fseventsd" 320 758
  439. --icon ".VolumeIcon.icns" 512 758
  440. Cryptomator-${VERSION_NO}.dmg dmg
  441. env:
  442. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  443. - name: Install notarization credentials
  444. env:
  445. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  446. NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
  447. NOTARIZATION_PW: ${{ secrets.MACOS_NOTARIZATION_PW }}
  448. NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
  449. NOTARIZATION_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_NOTARIZATION_TMP_KEYCHAIN_PW }}
  450. run: |
  451. # create temporary keychain
  452. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  453. security create-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  454. security set-keychain-settings -lut 900 ${KEYCHAIN_PATH}
  455. security unlock-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  456. # import credentials from secrets
  457. sudo xcode-select -s /Applications/Xcode_13.0.app
  458. xcrun notarytool store-credentials "${NOTARIZATION_KEYCHAIN_PROFILE}" --apple-id "${NOTARIZATION_APPLE_ID}" --password "${NOTARIZATION_PW}" --team-id "${NOTARIZATION_TEAM_ID}" --keychain "${KEYCHAIN_PATH}"
  459. - name: Notarize .dmg
  460. env:
  461. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  462. run: |
  463. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  464. sudo xcode-select -s /Applications/Xcode_13.0.app
  465. xcrun notarytool submit Cryptomator-*.dmg --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}" --keychain "${KEYCHAIN_PATH}" --wait
  466. xcrun stapler staple Cryptomator-*.dmg
  467. - name: Clean up notarization credentials
  468. if: ${{ always() }}
  469. run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db
  470. - name: Add possible alpha/beta tags to installer name
  471. run: mv Cryptomator-*.dmg Cryptomator-${{ needs.metadata.outputs.semVerStr }}.dmg
  472. - name: Upload mac-dmg
  473. uses: actions/upload-artifact@v2
  474. with:
  475. name: mac-dmg
  476. path: Cryptomator-*.dmg
  477. if-no-files-found: error
  478. #
  479. # MSI package
  480. #
  481. win-msi:
  482. name: Build Cryptomator.msi
  483. runs-on: windows-latest
  484. needs: [appdir, metadata]
  485. steps:
  486. - uses: actions/checkout@v2
  487. - name: Download win-appdir
  488. uses: actions/download-artifact@v2
  489. with:
  490. name: win-appdir
  491. - name: Untar appdir.tar
  492. run: tar -xvf appdir.tar
  493. - uses: actions/setup-java@v2
  494. with:
  495. distribution: 'temurin'
  496. java-version: ${{ env.JAVA_VERSION }}
  497. - name: Patch Application Directory
  498. run: |
  499. cp dist/win/contrib/* appdir/Cryptomator
  500. - name: Fix permissions
  501. run: attrib -r appdir/Cryptomator/Cryptomator.exe
  502. shell: pwsh
  503. - name: Codesign
  504. uses: skymatic/code-sign-action@v1
  505. with:
  506. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  507. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  508. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  509. description: Cryptomator
  510. timestampUrl: 'http://timestamp.digicert.com'
  511. folder: appdir/Cryptomator
  512. recursive: true
  513. - name: Create MSI
  514. run: >
  515. ${JAVA_HOME}/bin/jpackage
  516. --verbose
  517. --type msi
  518. --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775
  519. --app-image appdir/Cryptomator
  520. --dest installer
  521. --name Cryptomator
  522. --vendor "Skymatic GmbH"
  523. --copyright "(C) 2016 - 2022 Skymatic GmbH"
  524. --app-version "${{ needs.metadata.outputs.semVerNum }}"
  525. --win-menu
  526. --win-dir-chooser
  527. --win-shortcut-prompt
  528. --win-update-url "https:\\cryptomator.org"
  529. --win-menu-group Cryptomator
  530. --resource-dir dist/win/resources
  531. --license-file dist/win/resources/license.rtf
  532. --file-associations dist/win/resources/FAvaultFile.properties
  533. env:
  534. JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
  535. - name: Codesign MSI
  536. uses: skymatic/code-sign-action@v1
  537. with:
  538. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  539. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  540. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  541. description: Cryptomator Installer
  542. timestampUrl: 'http://timestamp.digicert.com'
  543. folder: installer
  544. - name: Add possible alpha/beta tags to installer name
  545. run: mv installer/Cryptomator-*.msi installer/Cryptomator-${{ needs.metadata.outputs.semVerStr }}-x64.msi
  546. - name: Upload win-msi
  547. uses: actions/upload-artifact@v2
  548. with:
  549. name: win-msi
  550. path: installer/*.msi
  551. if-no-files-found: error
  552. #
  553. # Release
  554. #
  555. release:
  556. name: Draft a release on Github
  557. runs-on: ubuntu-latest
  558. needs: [metadata,linux-appimage,mac-dmg,win-msi,ppa]
  559. if: startsWith(github.ref, 'refs/tags/') && github.repository == 'cryptomator/cryptomator'
  560. steps:
  561. - uses: actions/checkout@v2
  562. - name: Create tarball
  563. run: git archive --prefix="cryptomator-${{ needs.metadata.outputs.semVerStr }}/" -o "cryptomator-${{ needs.metadata.outputs.semVerStr }}.tar.gz" ${{ github.ref }}
  564. - name: Download linux appimage
  565. uses: actions/download-artifact@v2
  566. with:
  567. name: linux-appimage
  568. - name: Download macOS dmg
  569. uses: actions/download-artifact@v2
  570. with:
  571. name: mac-dmg
  572. - name: Download Windows msi
  573. uses: actions/download-artifact@v2
  574. with:
  575. name: win-msi
  576. - name: Create detached GPG signature for all release files with key 615D449FE6E6A235
  577. run: |
  578. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  579. for FILE in `find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do
  580. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ${FILE}
  581. done
  582. env:
  583. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  584. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  585. - name: Compute SHA256 checksums of release artifacts
  586. run: |
  587. SHA256_SUMS=`find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.tar.gz" | xargs sha256sum`
  588. echo "SHA256_SUMS<<EOF" >> $GITHUB_ENV
  589. echo "${SHA256_SUMS}" >> $GITHUB_ENV
  590. echo "EOF" >> $GITHUB_ENV
  591. continue-on-error: true
  592. - name: Create release draft
  593. uses: softprops/action-gh-release@v1
  594. with:
  595. draft: true
  596. fail_on_unmatched_files: true
  597. discussion_category_name: releases
  598. token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
  599. files: |
  600. *.AppImage
  601. *.zsync
  602. *.asc
  603. *.dmg
  604. *.msi
  605. body: |-
  606. :construction: Work in Progress
  607. ## What's New
  608. ## Bugfixes
  609. ## Misc
  610. ---
  611. :scroll: A complete list of closed issues is available [here](LINK).
  612. ---
  613. :floppy_disk: SHA-256 checksums of release artifacts:
  614. ```
  615. ${{ env.SHA256_SUMS }}
  616. ```