release.yml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  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 "-Dcryptomator.logDir=\"~/Library/Logs/Cryptomator\""
  142. --java-options "-Dcryptomator.pluginDir=\"~/Library/Application Support/Cryptomator/Plugins\""
  143. --java-options "-Dcryptomator.settingsPath=\"~/Library/Application Support/Cryptomator/settings.json\""
  144. --java-options "-Dcryptomator.ipcSocketPath=\"~/Library/Application Support/Cryptomator/ipc.socket\""
  145. --java-options "-Dcryptomator.showTrayIcon=true"
  146. --java-options "-Dcryptomator.buildNumber=\"dmg-${{ needs.metadata.outputs.revNum }}\""
  147. --mac-package-identifier org.cryptomator
  148. --resource-dir dist/mac/resources
  149. steps:
  150. - uses: actions/checkout@v2
  151. - uses: actions/setup-java@v1
  152. with:
  153. java-version: ${{ env.JAVA_VERSION }}
  154. - name: Download ${{ matrix.profile }}-buildkit
  155. uses: actions/download-artifact@v2
  156. with:
  157. name: ${{ matrix.profile }}-buildkit
  158. path: buildkit
  159. - name: Create Runtime Image
  160. run: >
  161. ${JAVA_HOME}/bin/jlink
  162. --verbose
  163. --output runtime
  164. --module-path "${JAVA_HOME}/jmods"
  165. --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
  166. --no-header-files
  167. --no-man-pages
  168. --strip-debug
  169. --compress=1
  170. - name: Create App Directory
  171. run: >
  172. ${JAVA_HOME}/bin/jpackage
  173. --verbose
  174. --type app-image
  175. --runtime-image runtime
  176. --input buildkit/libs
  177. --module-path buildkit/mods
  178. --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
  179. --dest appdir
  180. --name Cryptomator
  181. --vendor "Skymatic GmbH"
  182. --copyright "(C) 2016 - 2021 Skymatic GmbH"
  183. --java-options "-Xss5m"
  184. --java-options "-Xmx256m"
  185. --java-options "-Dcryptomator.appVersion=\"${{ needs.metadata.outputs.semVerStr }}\""
  186. ${{ matrix.jpackageoptions }}
  187. - name: Create appdir.tar
  188. run: tar -cvf appdir.tar appdir
  189. - name: Upload ${{ matrix.profile }}-appdir
  190. uses: actions/upload-artifact@v2
  191. with:
  192. name: ${{ matrix.profile }}-appdir
  193. path: appdir.tar
  194. if-no-files-found: error
  195. #
  196. # Linux PPA Source Package
  197. #
  198. ppa:
  199. name: Upload source package to PPA
  200. needs: [buildkit, metadata]
  201. runs-on: ubuntu-latest
  202. steps:
  203. - uses: actions/checkout@v2
  204. - name: install build tools
  205. run: |
  206. sudo apt-get update
  207. sudo apt-get install debhelper devscripts dput
  208. - name: Download linux-buildkit
  209. uses: actions/download-artifact@v2
  210. with:
  211. name: linux-buildkit
  212. path: pkgdir
  213. - name: create orig.tar.gz
  214. run: 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. cp -r dist/linux/resources/ pkgdir
  219. export RFC2822_TIMESTAMP=`date --rfc-2822`
  220. envsubst '${VERSION_STR} ${VERSION_NUM} ${REVISION_NUM}' < dist/linux/debian/rules > pkgdir/debian/rules
  221. envsubst '${VERSION_STR}' < dist/linux/debian/org.cryptomator.Cryptomator.desktop > pkgdir/debian/org.cryptomator.Cryptomator.desktop
  222. envsubst '${PPA_VERSION} ${RFC2822_TIMESTAMP}' < dist/linux/debian/changelog > pkgdir/debian/changelog
  223. find . -name "*.jar" >> pkgdir/debian/source/include-binaries
  224. mv pkgdir cryptomator_${{ needs.metadata.outputs.ppaVerStr }}
  225. env:
  226. VERSION_STR: ${{ needs.metadata.outputs.semVerStr }}
  227. VERSION_NUM: ${{ needs.metadata.outputs.semVerNum }}
  228. REVISION_NUM: ${{ needs.metadata.outputs.revNum }}
  229. PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1
  230. - name: import gpg key 615D449FE6E6A235
  231. run: |
  232. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  233. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign dist/linux/debian/rules
  234. env:
  235. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  236. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  237. - name: debuild
  238. run: debuild -S -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-source-package
  247. path: |
  248. cryptomator_*.dsc
  249. cryptomator_*.orig.tar.xz
  250. cryptomator_*.debian.tar.xz
  251. cryptomator_*_source.changes
  252. cryptomator_*_source.buildinfo
  253. - name: dput to beta repo
  254. run: dput ppa:sebastian-stenzel/cryptomator-beta cryptomator_${PPA_VERSION}_source.changes
  255. env:
  256. PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1
  257. #
  258. # Linux Cryptomator.AppImage
  259. #
  260. linux-appimage:
  261. name: Build Cryptomator.AppImage
  262. runs-on: ubuntu-latest
  263. needs: [appdir, metadata]
  264. steps:
  265. - uses: actions/checkout@v2
  266. - name: Download linux-appdir
  267. uses: actions/download-artifact@v2
  268. with:
  269. name: linux-appdir
  270. - name: Untar appdir.tar
  271. run: |
  272. tar -xvf appdir.tar
  273. - name: Patch Cryptomator.AppDir
  274. run: |
  275. mv appdir/Cryptomator Cryptomator.AppDir
  276. cp -r dist/linux/appimage/resources/AppDir/* Cryptomator.AppDir/
  277. envsubst '${REVISION_NO} ${SEMVER_STR}' < dist/linux/appimage/resources/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh
  278. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
  279. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
  280. ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
  281. ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
  282. ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
  283. env:
  284. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  285. SEMVER_STR: ${{ needs.metadata.outputs.semVerStr }}
  286. - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
  287. run: |
  288. JFFI_NATIVE_JAR=`ls lib/app/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
  289. ${JAVA_HOME}/bin/jar -xf lib/app/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
  290. mv jni/x86_64-Linux/* lib/app/libjffi.so
  291. working-directory: Cryptomator.AppDir
  292. - name: Download AppImageKit
  293. run: |
  294. curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
  295. chmod +x appimagetool.AppImage
  296. ./appimagetool.AppImage --appimage-extract
  297. - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
  298. run: |
  299. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  300. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign Cryptomator.AppDir/AppRun
  301. env:
  302. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  303. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  304. - name: Build AppImage
  305. run: >
  306. ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.semVerStr }}-x86_64.AppImage
  307. -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
  308. --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
  309. - name: Upload AppImage
  310. uses: actions/upload-artifact@v2
  311. with:
  312. name: linux-appimage
  313. path: |
  314. cryptomator-*.AppImage
  315. cryptomator-*.AppImage.zsync
  316. if-no-files-found: error
  317. #
  318. # macOS Cryptomator.app
  319. #
  320. mac-app:
  321. name: Build Cryptomator.app
  322. runs-on: macos-latest
  323. needs: [appdir, metadata]
  324. steps:
  325. - uses: actions/checkout@v2
  326. - name: Download mac-appdir
  327. uses: actions/download-artifact@v2
  328. with:
  329. name: mac-appdir
  330. - name: Untar appdir.tar
  331. run: tar -xvf appdir.tar
  332. - name: Patch Cryptomator.app
  333. run: |
  334. mv appdir/Cryptomator.app Cryptomator.app
  335. mv dist/mac/resources/Cryptomator-Vault.icns Cryptomator.app/Contents/Resources/
  336. sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" Cryptomator.app/Contents/Info.plist
  337. sed -i '' "s|###BUNDLE_VERSION###|${REVISION_NO}|g" Cryptomator.app/Contents/Info.plist
  338. env:
  339. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  340. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  341. - name: Install codesign certificate
  342. env:
  343. CODESIGN_P12_BASE64: ${{ secrets.MACOS_CODESIGN_P12_BASE64 }}
  344. CODESIGN_P12_PW: ${{ secrets.MACOS_CODESIGN_P12_PW }}
  345. CODESIGN_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_TMP_KEYCHAIN_PW }}
  346. run: |
  347. # create variables
  348. CERTIFICATE_PATH=$RUNNER_TEMP/codesign.p12
  349. KEYCHAIN_PATH=$RUNNER_TEMP/codesign.keychain-db
  350. # import certificate and provisioning profile from secrets
  351. echo -n "$CODESIGN_P12_BASE64" | base64 --decode --output $CERTIFICATE_PATH
  352. # create temporary keychain
  353. security create-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  354. security set-keychain-settings -lut 900 $KEYCHAIN_PATH
  355. security unlock-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  356. # import certificate to keychain
  357. security import $CERTIFICATE_PATH -P "$CODESIGN_P12_PW" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
  358. security list-keychain -d user -s $KEYCHAIN_PATH
  359. - name: Codesign
  360. env:
  361. CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
  362. run: |
  363. find Cryptomator.app/Contents/runtime/Contents/MacOS -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  364. for JAR_PATH in `find Cryptomator.app -name "*.jar"`; do
  365. if [[ `unzip -l ${JAR_PATH} | grep '.dylib\|.jnilib'` ]]; then
  366. JAR_FILENAME=$(basename ${JAR_PATH})
  367. OUTPUT_PATH=${JAR_PATH%.*}
  368. echo "Codesigning libs in ${JAR_FILENAME}..."
  369. unzip -q ${JAR_PATH} -d ${OUTPUT_PATH}
  370. find ${OUTPUT_PATH} -name '*.dylib' -exec codesign -s ${CODESIGN_IDENTITY} {} \;
  371. find ${OUTPUT_PATH} -name '*.jnilib' -exec codesign -s ${CODESIGN_IDENTITY} {} \;
  372. rm ${JAR_PATH}
  373. pushd ${OUTPUT_PATH} > /dev/null
  374. zip -qr ../${JAR_FILENAME} *
  375. popd > /dev/null
  376. rm -r ${OUTPUT_PATH}
  377. fi
  378. done
  379. echo "Codesigning Cryptomator.app..."
  380. codesign --force --deep --entitlements dist/mac/Cryptomator.entitlements -o runtime -s ${CODESIGN_IDENTITY} Cryptomator.app
  381. - name: Clean up codesign certificate
  382. if: ${{ always() }}
  383. run: security delete-keychain $RUNNER_TEMP/codesign.keychain-db
  384. - name: Create app.tar
  385. run: tar -cvf app.tar Cryptomator.app
  386. - name: Upload mac-app
  387. uses: actions/upload-artifact@v2
  388. with:
  389. name: mac-app
  390. path: app.tar
  391. if-no-files-found: error
  392. #
  393. # macOS Cryptomator.dmg
  394. #
  395. mac-dmg:
  396. name: Build Cryptomator.dmg
  397. runs-on: macos-11
  398. needs: [mac-app, metadata]
  399. steps:
  400. - uses: actions/checkout@v2
  401. - name: Download mac-appdir
  402. uses: actions/download-artifact@v2
  403. with:
  404. name: mac-app
  405. - name: Untar app.tar
  406. run: tar -xvf app.tar
  407. - name: Prepare .dmg contents
  408. run: |
  409. mkdir dmg
  410. mv Cryptomator.app dmg
  411. cp dist/mac/dmg/resources/macFUSE.webloc dmg
  412. ls -l dmg
  413. - name: Install create-dmg
  414. run: |
  415. brew install create-dmg
  416. create-dmg --help
  417. - name: Create .dmg
  418. run: >
  419. create-dmg
  420. --volname Cryptomator
  421. --volicon "dist/mac/dmg/resources/Cryptomator-Volume.icns"
  422. --background "dist/mac/dmg/resources/Cryptomator-background.tiff"
  423. --window-pos 400 100
  424. --window-size 640 694
  425. --icon-size 128
  426. --icon "Cryptomator.app" 128 245
  427. --hide-extension "Cryptomator.app"
  428. --icon "macFUSE.webloc" 320 501
  429. --hide-extension "macFUSE.webloc"
  430. --app-drop-link 512 245
  431. --eula "dist/mac/dmg/resources/license.rtf"
  432. --icon ".background" 128 758
  433. --icon ".fseventsd" 320 758
  434. --icon ".VolumeIcon.icns" 512 758
  435. Cryptomator-${VERSION_NO}.dmg dmg
  436. env:
  437. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  438. - name: Install notarization credentials
  439. env:
  440. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  441. NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
  442. NOTARIZATION_PW: ${{ secrets.MACOS_NOTARIZATION_PW }}
  443. NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
  444. NOTARIZATION_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_NOTARIZATION_TMP_KEYCHAIN_PW }}
  445. run: |
  446. # create temporary keychain
  447. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  448. security create-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  449. security set-keychain-settings -lut 900 ${KEYCHAIN_PATH}
  450. security unlock-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  451. # import credentials from secrets
  452. sudo xcode-select -s /Applications/Xcode_13.0.app
  453. xcrun notarytool store-credentials "${NOTARIZATION_KEYCHAIN_PROFILE}" --apple-id "${NOTARIZATION_APPLE_ID}" --password "${NOTARIZATION_PW}" --team-id "${NOTARIZATION_TEAM_ID}" --keychain "${KEYCHAIN_PATH}"
  454. - name: Notarize .dmg
  455. env:
  456. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  457. run: |
  458. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  459. sudo xcode-select -s /Applications/Xcode_13.0.app
  460. xcrun notarytool submit Cryptomator-*.dmg --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}" --keychain "${KEYCHAIN_PATH}" --wait
  461. xcrun stapler staple Cryptomator-*.dmg
  462. - name: Clean up notarization credentials
  463. if: ${{ always() }}
  464. run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db
  465. - name: Add possible alpha/beta tags to installer name
  466. run: mv Cryptomator-*.dmg Cryptomator-${{ needs.metadata.outputs.semVerStr }}.dmg
  467. - name: Upload mac-dmg
  468. uses: actions/upload-artifact@v2
  469. with:
  470. name: mac-dmg
  471. path: Cryptomator-*.dmg
  472. if-no-files-found: error
  473. #
  474. # MSI package
  475. #
  476. win-msi:
  477. name: Build Cryptomator.msi
  478. runs-on: windows-latest
  479. needs: [appdir, metadata]
  480. steps:
  481. - uses: actions/checkout@v2
  482. - name: Download win-appdir
  483. uses: actions/download-artifact@v2
  484. with:
  485. name: win-appdir
  486. - name: Untar appdir.tar
  487. run: tar -xvf appdir.tar
  488. - uses: actions/setup-java@v1
  489. with:
  490. java-version: ${{ env.JAVA_VERSION }}
  491. - name: Patch Application Directory
  492. run: |
  493. cp dist/win/contrib/* appdir/Cryptomator
  494. - name: Fix permissions
  495. run: attrib -r appdir/Cryptomator/Cryptomator.exe
  496. shell: pwsh
  497. - name: Codesign
  498. uses: skymatic/code-sign-action@v1
  499. with:
  500. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  501. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  502. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  503. description: Cryptomator
  504. timestampUrl: 'http://timestamp.digicert.com'
  505. folder: appdir/Cryptomator
  506. recursive: true
  507. - name: Create MSI
  508. run: >
  509. ${JAVA_HOME}/bin/jpackage
  510. --verbose
  511. --type msi
  512. --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775
  513. --app-image appdir/Cryptomator
  514. --dest installer
  515. --name Cryptomator
  516. --vendor "Skymatic GmbH"
  517. --copyright "(C) 2016 - 2021 Skymatic GmbH"
  518. --app-version "${{ needs.metadata.outputs.semVerNum }}"
  519. --win-menu
  520. --win-dir-chooser
  521. --resource-dir dist/win/resources
  522. --license-file dist/win/resources/license.rtf
  523. --file-associations dist/win/resources/FAvaultFile.properties
  524. env:
  525. JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
  526. - name: Codesign MSI
  527. uses: skymatic/code-sign-action@v1
  528. with:
  529. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  530. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  531. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  532. description: Cryptomator Installer
  533. timestampUrl: 'http://timestamp.digicert.com'
  534. folder: installer
  535. - name: Add possible alpha/beta tags to installer name
  536. run: mv installer/Cryptomator-*.msi installer/Cryptomator-${{ needs.metadata.outputs.semVerStr }}.msi
  537. - name: Upload win-msi
  538. uses: actions/upload-artifact@v2
  539. with:
  540. name: win-msi
  541. path: installer/*.msi
  542. if-no-files-found: error
  543. #
  544. # Release
  545. #
  546. release:
  547. name: Draft a release on Github
  548. runs-on: ubuntu-latest
  549. needs: [metadata,linux-appimage,mac-dmg,win-msi]
  550. if: startsWith(github.ref, 'refs/tags/') && github.repository == 'cryptomator/cryptomator'
  551. env:
  552. APPIMAGE_SHA256_MSG: undefined
  553. DMG_SHA256_MSG: undefined
  554. MSI_SHA256_MSG: undefined
  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 # sha256sum is split on the whitespace with sed and reorderd. env keys are file name extensions in uppercase
  581. run: |
  582. for FILE in `find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do
  583. CHECKSUM_MSG=$(sha256sum ${FILE})
  584. VALUE=$(echo ${CHECKSUM_MSG} | sed 's/\([0-9,a-f]\{64\}\)[[:blank:]]\([Cc]ryptomator-.*$\)/\2: `\1`/' )
  585. KEY=$(echo ${CHECKSUM_MSG} | sed 's/.*[[:blank:]].*\.\(.*$\)/\1/')
  586. echo "{${KEY^^}_SHA256_MSG}={${VALUE}} >> $GITHUB_ENV
  587. done
  588. - name: Create release draft
  589. uses: softprops/action-gh-release@v1
  590. with:
  591. draft: true
  592. fail_on_unmatched_files: true
  593. discussion_category_name: releases
  594. token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
  595. files: |
  596. *.AppImage
  597. *.zsync
  598. *.asc
  599. *.dmg
  600. *.msi
  601. body: |
  602. :construction: Work in Progress
  603. ## What's new
  604. ## Bugfixes
  605. ## Misc
  606. ---
  607. :scroll: A complete list of closed issues is available [here](LINK)
  608. ---
  609. Checksums of release artifacts:
  610. * ${{ env.APPIMAGE_SHA256_MSG}}
  611. * ${{ env.DMG_SHA256_MSG}}
  612. * ${{ env.MSI_SHA_256_MSG}}