release.yml 26 KB

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