release.yml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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. # Debian Package
  195. #
  196. deb:
  197. name: Create Debian Package
  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 with common/ libs/ mods/
  212. run: |
  213. cp -r dist/linux/common/ pkgdir
  214. tar -cJf cryptomator_${{ needs.metadata.outputs.ppaVerStr }}.orig.tar.xz -C pkgdir .
  215. - name: patch and rename pkgdir
  216. run: |
  217. cp -r dist/linux/debian/ pkgdir
  218. export RFC2822_TIMESTAMP=`date --rfc-2822`
  219. envsubst '${SEMVER_STR} ${VERSION_NUM} ${REVISION_NUM}' < dist/linux/debian/rules > pkgdir/debian/rules
  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. SEMVER_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: |
  237. debuild -S -sa -d
  238. debuild -b -sa -d
  239. env:
  240. DEBSIGN_PROGRAM: gpg --batch --pinentry-mode loopback
  241. DEBSIGN_KEYID: 615D449FE6E6A235
  242. working-directory: cryptomator_${{ needs.metadata.outputs.ppaVerStr }}
  243. - name: Upload artifacts
  244. uses: actions/upload-artifact@v2
  245. with:
  246. name: linux-deb-package
  247. path: |
  248. cryptomator_*.dsc
  249. cryptomator_*.orig.tar.xz
  250. cryptomator_*.debian.tar.xz
  251. cryptomator_*_source.changes
  252. cryptomator_*_amd64.deb
  253. #
  254. # Upload Source Package to PPA
  255. #
  256. ppa:
  257. name: Upload Source Package to PPA
  258. needs: [deb]
  259. runs-on: ubuntu-18.04
  260. steps:
  261. - name: Download linux-deb-package
  262. uses: actions/download-artifact@v2
  263. with:
  264. name: linux-deb-package
  265. path: .
  266. - name: dput to beta repo
  267. run: dput ppa:sebastian-stenzel/cryptomator-beta cryptomator_${PPA_VERSION}_source.changes
  268. env:
  269. PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1
  270. #
  271. # Linux Cryptomator.AppImage
  272. #
  273. linux-appimage:
  274. name: Build Cryptomator.AppImage
  275. runs-on: ubuntu-latest
  276. needs: [appdir, metadata]
  277. steps:
  278. - uses: actions/checkout@v2
  279. - name: Download linux-appdir
  280. uses: actions/download-artifact@v2
  281. with:
  282. name: linux-appdir
  283. - name: Untar appdir.tar
  284. run: |
  285. tar -xvf appdir.tar
  286. - name: Patch Cryptomator.AppDir
  287. run: |
  288. mv appdir/Cryptomator Cryptomator.AppDir
  289. cp -r dist/linux/appimage/resources/AppDir/* Cryptomator.AppDir/
  290. envsubst '${REVISION_NO} ${SEMVER_STR}' < dist/linux/appimage/resources/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh
  291. cp dist/linux/common/org.cryptomator.Cryptomator256.png Cryptomator.AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png
  292. cp dist/linux/common/org.cryptomator.Cryptomator512.png Cryptomator.AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png
  293. cp dist/linux/common/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg
  294. cp dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.metainfo.xml
  295. cp dist/linux/common/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop
  296. cp dist/linux/common/application-vnd.cryptomator.vault.xml Cryptomator.AppDir/usr/share/mime/packages/application-vnd.cryptomator.vault.xml
  297. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
  298. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
  299. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
  300. ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
  301. ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
  302. env:
  303. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  304. SEMVER_STR: ${{ needs.metadata.outputs.semVerStr }}
  305. - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
  306. run: |
  307. JFFI_NATIVE_JAR=`ls lib/app/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
  308. ${JAVA_HOME}/bin/jar -xf lib/app/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
  309. mv jni/x86_64-Linux/* lib/app/libjffi.so
  310. working-directory: Cryptomator.AppDir
  311. - name: Download AppImageKit
  312. run: |
  313. curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
  314. chmod +x appimagetool.AppImage
  315. ./appimagetool.AppImage --appimage-extract
  316. - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
  317. run: |
  318. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  319. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign Cryptomator.AppDir/AppRun
  320. env:
  321. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  322. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  323. - name: Build AppImage
  324. run: >
  325. ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.semVerStr }}-x86_64.AppImage
  326. -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
  327. --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
  328. - name: Upload AppImage
  329. uses: actions/upload-artifact@v2
  330. with:
  331. name: linux-appimage
  332. path: |
  333. cryptomator-*.AppImage
  334. cryptomator-*.AppImage.zsync
  335. if-no-files-found: error
  336. #
  337. # macOS Cryptomator.app
  338. #
  339. mac-app:
  340. name: Build Cryptomator.app
  341. runs-on: macos-latest
  342. needs: [appdir, metadata]
  343. steps:
  344. - uses: actions/checkout@v2
  345. - name: Download mac-appdir
  346. uses: actions/download-artifact@v2
  347. with:
  348. name: mac-appdir
  349. - name: Untar appdir.tar
  350. run: tar -xvf appdir.tar
  351. - name: Patch Cryptomator.app
  352. run: |
  353. mv appdir/Cryptomator.app Cryptomator.app
  354. mv dist/mac/resources/Cryptomator-Vault.icns Cryptomator.app/Contents/Resources/
  355. sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" Cryptomator.app/Contents/Info.plist
  356. sed -i '' "s|###BUNDLE_VERSION###|${REVISION_NO}|g" Cryptomator.app/Contents/Info.plist
  357. env:
  358. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  359. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  360. - name: Install codesign certificate
  361. env:
  362. CODESIGN_P12_BASE64: ${{ secrets.MACOS_CODESIGN_P12_BASE64 }}
  363. CODESIGN_P12_PW: ${{ secrets.MACOS_CODESIGN_P12_PW }}
  364. CODESIGN_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_TMP_KEYCHAIN_PW }}
  365. run: |
  366. # create variables
  367. CERTIFICATE_PATH=$RUNNER_TEMP/codesign.p12
  368. KEYCHAIN_PATH=$RUNNER_TEMP/codesign.keychain-db
  369. # import certificate and provisioning profile from secrets
  370. echo -n "$CODESIGN_P12_BASE64" | base64 --decode --output $CERTIFICATE_PATH
  371. # create temporary keychain
  372. security create-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  373. security set-keychain-settings -lut 900 $KEYCHAIN_PATH
  374. security unlock-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  375. # import certificate to keychain
  376. security import $CERTIFICATE_PATH -P "$CODESIGN_P12_PW" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
  377. security list-keychain -d user -s $KEYCHAIN_PATH
  378. - name: Codesign
  379. env:
  380. CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
  381. run: |
  382. find Cryptomator.app/Contents/runtime/Contents/MacOS -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  383. for JAR_PATH in `find Cryptomator.app -name "*.jar"`; do
  384. if [[ `unzip -l ${JAR_PATH} | grep '.dylib\|.jnilib'` ]]; then
  385. JAR_FILENAME=$(basename ${JAR_PATH})
  386. OUTPUT_PATH=${JAR_PATH%.*}
  387. echo "Codesigning libs in ${JAR_FILENAME}..."
  388. unzip -q ${JAR_PATH} -d ${OUTPUT_PATH}
  389. find ${OUTPUT_PATH} -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  390. find ${OUTPUT_PATH} -name '*.jnilib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  391. rm ${JAR_PATH}
  392. pushd ${OUTPUT_PATH} > /dev/null
  393. zip -qr ../${JAR_FILENAME} *
  394. popd > /dev/null
  395. rm -r ${OUTPUT_PATH}
  396. fi
  397. done
  398. echo "Codesigning Cryptomator.app..."
  399. codesign --force --deep --entitlements dist/mac/Cryptomator.entitlements -o runtime -s ${CODESIGN_IDENTITY} Cryptomator.app
  400. - name: Clean up codesign certificate
  401. if: ${{ always() }}
  402. run: security delete-keychain $RUNNER_TEMP/codesign.keychain-db
  403. - name: Create app.tar
  404. run: tar -cvf app.tar Cryptomator.app
  405. - name: Upload mac-app
  406. uses: actions/upload-artifact@v2
  407. with:
  408. name: mac-app
  409. path: app.tar
  410. if-no-files-found: error
  411. #
  412. # macOS Cryptomator.dmg
  413. #
  414. mac-dmg:
  415. name: Build Cryptomator.dmg
  416. runs-on: macos-11
  417. needs: [mac-app, metadata]
  418. steps:
  419. - uses: actions/checkout@v2
  420. - name: Download mac-appdir
  421. uses: actions/download-artifact@v2
  422. with:
  423. name: mac-app
  424. - name: Untar app.tar
  425. run: tar -xvf app.tar
  426. - name: Prepare .dmg contents
  427. run: |
  428. mkdir dmg
  429. mv Cryptomator.app dmg
  430. cp dist/mac/dmg/resources/macFUSE.webloc dmg
  431. ls -l dmg
  432. - name: Install create-dmg
  433. run: |
  434. brew install create-dmg
  435. create-dmg --help
  436. - name: Create .dmg
  437. run: >
  438. create-dmg
  439. --volname Cryptomator
  440. --volicon "dist/mac/dmg/resources/Cryptomator-Volume.icns"
  441. --background "dist/mac/dmg/resources/Cryptomator-background.tiff"
  442. --window-pos 400 100
  443. --window-size 640 694
  444. --icon-size 128
  445. --icon "Cryptomator.app" 128 245
  446. --hide-extension "Cryptomator.app"
  447. --icon "macFUSE.webloc" 320 501
  448. --hide-extension "macFUSE.webloc"
  449. --app-drop-link 512 245
  450. --eula "dist/mac/dmg/resources/license.rtf"
  451. --icon ".background" 128 758
  452. --icon ".fseventsd" 320 758
  453. --icon ".VolumeIcon.icns" 512 758
  454. Cryptomator-${VERSION_NO}.dmg dmg
  455. env:
  456. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  457. - name: Install notarization credentials
  458. env:
  459. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  460. NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
  461. NOTARIZATION_PW: ${{ secrets.MACOS_NOTARIZATION_PW }}
  462. NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
  463. NOTARIZATION_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_NOTARIZATION_TMP_KEYCHAIN_PW }}
  464. run: |
  465. # create temporary keychain
  466. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  467. security create-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  468. security set-keychain-settings -lut 900 ${KEYCHAIN_PATH}
  469. security unlock-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  470. # import credentials from secrets
  471. sudo xcode-select -s /Applications/Xcode_13.0.app
  472. xcrun notarytool store-credentials "${NOTARIZATION_KEYCHAIN_PROFILE}" --apple-id "${NOTARIZATION_APPLE_ID}" --password "${NOTARIZATION_PW}" --team-id "${NOTARIZATION_TEAM_ID}" --keychain "${KEYCHAIN_PATH}"
  473. - name: Notarize .dmg
  474. env:
  475. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  476. run: |
  477. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  478. sudo xcode-select -s /Applications/Xcode_13.0.app
  479. xcrun notarytool submit Cryptomator-*.dmg --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}" --keychain "${KEYCHAIN_PATH}" --wait
  480. xcrun stapler staple Cryptomator-*.dmg
  481. - name: Clean up notarization credentials
  482. if: ${{ always() }}
  483. run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db
  484. - name: Add possible alpha/beta tags to installer name
  485. run: mv Cryptomator-*.dmg Cryptomator-${{ needs.metadata.outputs.semVerStr }}.dmg
  486. - name: Upload mac-dmg
  487. uses: actions/upload-artifact@v2
  488. with:
  489. name: mac-dmg
  490. path: Cryptomator-*.dmg
  491. if-no-files-found: error
  492. #
  493. # MSI package
  494. #
  495. win-msi:
  496. name: Build Cryptomator.msi
  497. runs-on: windows-latest
  498. needs: [appdir, metadata]
  499. steps:
  500. - uses: actions/checkout@v2
  501. - name: Download win-appdir
  502. uses: actions/download-artifact@v2
  503. with:
  504. name: win-appdir
  505. - name: Untar appdir.tar
  506. run: tar -xvf appdir.tar
  507. - uses: actions/setup-java@v2
  508. with:
  509. distribution: 'temurin'
  510. java-version: ${{ env.JAVA_VERSION }}
  511. - name: Patch Application Directory
  512. run: |
  513. cp dist/win/contrib/* appdir/Cryptomator
  514. - name: Fix permissions
  515. run: attrib -r appdir/Cryptomator/Cryptomator.exe
  516. shell: pwsh
  517. - name: Codesign
  518. uses: skymatic/code-sign-action@v1
  519. with:
  520. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  521. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  522. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  523. description: Cryptomator
  524. timestampUrl: 'http://timestamp.digicert.com'
  525. folder: appdir/Cryptomator
  526. recursive: true
  527. - name: Create MSI
  528. run: >
  529. ${JAVA_HOME}/bin/jpackage
  530. --verbose
  531. --type msi
  532. --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775
  533. --app-image appdir/Cryptomator
  534. --dest installer
  535. --name Cryptomator
  536. --vendor "Skymatic GmbH"
  537. --copyright "(C) 2016 - 2022 Skymatic GmbH"
  538. --app-version "${{ needs.metadata.outputs.semVerNum }}"
  539. --win-menu
  540. --win-dir-chooser
  541. --win-shortcut-prompt
  542. --win-update-url "https:\\cryptomator.org"
  543. --win-menu-group Cryptomator
  544. --resource-dir dist/win/resources
  545. --license-file dist/win/resources/license.rtf
  546. --file-associations dist/win/resources/FAvaultFile.properties
  547. env:
  548. JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
  549. - name: Codesign MSI
  550. uses: skymatic/code-sign-action@v1
  551. with:
  552. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  553. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  554. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  555. description: Cryptomator Installer
  556. timestampUrl: 'http://timestamp.digicert.com'
  557. folder: installer
  558. - name: Add possible alpha/beta tags to installer name
  559. run: mv installer/Cryptomator-*.msi installer/Cryptomator-${{ needs.metadata.outputs.semVerStr }}-x64.msi
  560. - name: Upload win-msi
  561. uses: actions/upload-artifact@v2
  562. with:
  563. name: win-msi
  564. path: installer/*.msi
  565. if-no-files-found: error
  566. #
  567. # Release
  568. #
  569. release:
  570. name: Draft a release on Github
  571. runs-on: ubuntu-latest
  572. needs: [metadata,linux-appimage,mac-dmg,win-msi,ppa]
  573. if: startsWith(github.ref, 'refs/tags/') && github.repository == 'cryptomator/cryptomator'
  574. steps:
  575. - uses: actions/checkout@v2
  576. - name: Create tarball
  577. run: git archive --prefix="cryptomator-${{ needs.metadata.outputs.semVerStr }}/" -o "cryptomator-${{ needs.metadata.outputs.semVerStr }}.tar.gz" ${{ github.ref }}
  578. - name: Download Debian package
  579. uses: actions/download-artifact@v2
  580. with:
  581. name: linux-deb-package
  582. - name: Download linux appimage
  583. uses: actions/download-artifact@v2
  584. with:
  585. name: linux-appimage
  586. - name: Download macOS dmg
  587. uses: actions/download-artifact@v2
  588. with:
  589. name: mac-dmg
  590. - name: Download Windows msi
  591. uses: actions/download-artifact@v2
  592. with:
  593. name: win-msi
  594. - name: Create detached GPG signature for all release files with key 615D449FE6E6A235
  595. run: |
  596. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  597. for FILE in `find . -name "*.AppImage" -o -name "*.deb" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do
  598. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ${FILE}
  599. done
  600. env:
  601. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  602. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  603. - name: Compute SHA256 checksums of release artifacts
  604. run: |
  605. SHA256_SUMS=`find . -name "*.AppImage" -o -name "*.deb" -o -name "*.dmg" -o -name "*.msi" -o -name "*.tar.gz" | xargs sha256sum`
  606. echo "SHA256_SUMS<<EOF" >> $GITHUB_ENV
  607. echo "${SHA256_SUMS}" >> $GITHUB_ENV
  608. echo "EOF" >> $GITHUB_ENV
  609. continue-on-error: true
  610. - name: Create release draft
  611. uses: softprops/action-gh-release@v1
  612. with:
  613. draft: true
  614. fail_on_unmatched_files: true
  615. discussion_category_name: releases
  616. token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
  617. files: |
  618. *.AppImage
  619. *.zsync
  620. *.asc
  621. *.deb
  622. *.dmg
  623. *.msi
  624. body: |-
  625. :construction: Work in Progress
  626. ## What's New
  627. ## Bugfixes
  628. ## Misc
  629. ---
  630. :scroll: A complete list of closed issues is available [here](LINK).
  631. ---
  632. :floppy_disk: SHA-256 checksums of release artifacts:
  633. ```
  634. ${{ env.SHA256_SUMS }}
  635. ```