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: 16
  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: rubenesp87/semver-validation-action@0.0.6
  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}' < 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. - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
  286. run: |
  287. JFFI_NATIVE_JAR=`ls lib/app/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
  288. ${JAVA_HOME}/bin/jar -xf lib/app/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
  289. mv jni/x86_64-Linux/* lib/app/libjffi.so
  290. working-directory: Cryptomator.AppDir
  291. - name: Download AppImageKit
  292. run: |
  293. curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
  294. chmod +x appimagetool.AppImage
  295. ./appimagetool.AppImage --appimage-extract
  296. - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
  297. run: |
  298. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  299. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign Cryptomator.AppDir/AppRun
  300. env:
  301. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  302. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  303. - name: Build AppImage
  304. run: >
  305. ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.semVerStr }}-x86_64.AppImage
  306. -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
  307. --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
  308. - name: Upload AppImage
  309. uses: actions/upload-artifact@v2
  310. with:
  311. name: linux-appimage
  312. path: |
  313. cryptomator-*.AppImage
  314. cryptomator-*.AppImage.zsync
  315. if-no-files-found: error
  316. #
  317. # macOS Cryptomator.app
  318. #
  319. mac-app:
  320. name: Build Cryptomator.app
  321. runs-on: macos-latest
  322. needs: [appdir, metadata]
  323. steps:
  324. - uses: actions/checkout@v2
  325. - name: Download mac-appdir
  326. uses: actions/download-artifact@v2
  327. with:
  328. name: mac-appdir
  329. - name: Untar appdir.tar
  330. run: tar -xvf appdir.tar
  331. - name: Patch Cryptomator.app
  332. run: |
  333. mv appdir/Cryptomator.app Cryptomator.app
  334. mv dist/mac/resources/Cryptomator-Vault.icns Cryptomator.app/Contents/Resources/
  335. sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" Cryptomator.app/Contents/Info.plist
  336. sed -i '' "s|###BUNDLE_VERSION###|${REVISION_NO}|g" Cryptomator.app/Contents/Info.plist
  337. env:
  338. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  339. REVISION_NO: ${{ needs.metadata.outputs.revNum }}
  340. - name: Install codesign certificate
  341. env:
  342. CODESIGN_P12_BASE64: ${{ secrets.MACOS_CODESIGN_P12_BASE64 }}
  343. CODESIGN_P12_PW: ${{ secrets.MACOS_CODESIGN_P12_PW }}
  344. CODESIGN_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_TMP_KEYCHAIN_PW }}
  345. run: |
  346. # create variables
  347. CERTIFICATE_PATH=$RUNNER_TEMP/codesign.p12
  348. KEYCHAIN_PATH=$RUNNER_TEMP/codesign.keychain-db
  349. # import certificate and provisioning profile from secrets
  350. echo -n "$CODESIGN_P12_BASE64" | base64 --decode --output $CERTIFICATE_PATH
  351. # create temporary keychain
  352. security create-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  353. security set-keychain-settings -lut 900 $KEYCHAIN_PATH
  354. security unlock-keychain -p "$CODESIGN_TMP_KEYCHAIN_PW" $KEYCHAIN_PATH
  355. # import certificate to keychain
  356. security import $CERTIFICATE_PATH -P "$CODESIGN_P12_PW" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
  357. security list-keychain -d user -s $KEYCHAIN_PATH
  358. - name: Codesign
  359. env:
  360. CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
  361. run: |
  362. find Cryptomator.app/Contents/runtime/Contents/MacOS -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  363. for JAR_PATH in `find Cryptomator.app -name "*.jar"`; do
  364. if [[ `unzip -l ${JAR_PATH} | grep '.dylib\|.jnilib'` ]]; then
  365. JAR_FILENAME=$(basename ${JAR_PATH})
  366. OUTPUT_PATH=${JAR_PATH%.*}
  367. echo "Codesigning libs in ${JAR_FILENAME}..."
  368. unzip -q ${JAR_PATH} -d ${OUTPUT_PATH}
  369. find ${OUTPUT_PATH} -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  370. find ${OUTPUT_PATH} -name '*.jnilib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \;
  371. rm ${JAR_PATH}
  372. pushd ${OUTPUT_PATH} > /dev/null
  373. zip -qr ../${JAR_FILENAME} *
  374. popd > /dev/null
  375. rm -r ${OUTPUT_PATH}
  376. fi
  377. done
  378. echo "Codesigning Cryptomator.app..."
  379. codesign --force --deep --entitlements dist/mac/Cryptomator.entitlements -o runtime -s ${CODESIGN_IDENTITY} Cryptomator.app
  380. - name: Clean up codesign certificate
  381. if: ${{ always() }}
  382. run: security delete-keychain $RUNNER_TEMP/codesign.keychain-db
  383. - name: Create app.tar
  384. run: tar -cvf app.tar Cryptomator.app
  385. - name: Upload mac-app
  386. uses: actions/upload-artifact@v2
  387. with:
  388. name: mac-app
  389. path: app.tar
  390. if-no-files-found: error
  391. #
  392. # macOS Cryptomator.dmg
  393. #
  394. mac-dmg:
  395. name: Build Cryptomator.dmg
  396. runs-on: macos-11
  397. needs: [mac-app, metadata]
  398. steps:
  399. - uses: actions/checkout@v2
  400. - name: Download mac-appdir
  401. uses: actions/download-artifact@v2
  402. with:
  403. name: mac-app
  404. - name: Untar app.tar
  405. run: tar -xvf app.tar
  406. - name: Prepare .dmg contents
  407. run: |
  408. mkdir dmg
  409. mv Cryptomator.app dmg
  410. cp dist/mac/dmg/resources/macFUSE.webloc dmg
  411. ls -l dmg
  412. - name: Install create-dmg
  413. run: |
  414. brew install create-dmg
  415. create-dmg --help
  416. - name: Create .dmg
  417. run: >
  418. create-dmg
  419. --volname Cryptomator
  420. --volicon "dist/mac/dmg/resources/Cryptomator-Volume.icns"
  421. --background "dist/mac/dmg/resources/Cryptomator-background.tiff"
  422. --window-pos 400 100
  423. --window-size 640 694
  424. --icon-size 128
  425. --icon "Cryptomator.app" 128 245
  426. --hide-extension "Cryptomator.app"
  427. --icon "macFUSE.webloc" 320 501
  428. --hide-extension "macFUSE.webloc"
  429. --app-drop-link 512 245
  430. --eula "dist/mac/dmg/resources/license.rtf"
  431. --icon ".background" 128 758
  432. --icon ".fseventsd" 320 758
  433. --icon ".VolumeIcon.icns" 512 758
  434. Cryptomator-${VERSION_NO}.dmg dmg
  435. env:
  436. VERSION_NO: ${{ needs.metadata.outputs.semVerNum }}
  437. - name: Install notarization credentials
  438. env:
  439. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  440. NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
  441. NOTARIZATION_PW: ${{ secrets.MACOS_NOTARIZATION_PW }}
  442. NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
  443. NOTARIZATION_TMP_KEYCHAIN_PW: ${{ secrets.MACOS_NOTARIZATION_TMP_KEYCHAIN_PW }}
  444. run: |
  445. # create temporary keychain
  446. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  447. security create-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  448. security set-keychain-settings -lut 900 ${KEYCHAIN_PATH}
  449. security unlock-keychain -p "${NOTARIZATION_TMP_KEYCHAIN_PW}" ${KEYCHAIN_PATH}
  450. # import credentials from secrets
  451. sudo xcode-select -s /Applications/Xcode_13.0.app
  452. xcrun notarytool store-credentials "${NOTARIZATION_KEYCHAIN_PROFILE}" --apple-id "${NOTARIZATION_APPLE_ID}" --password "${NOTARIZATION_PW}" --team-id "${NOTARIZATION_TEAM_ID}" --keychain "${KEYCHAIN_PATH}"
  453. - name: Notarize .dmg
  454. env:
  455. NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }}
  456. run: |
  457. KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
  458. sudo xcode-select -s /Applications/Xcode_13.0.app
  459. xcrun notarytool submit Cryptomator-*.dmg --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}" --keychain "${KEYCHAIN_PATH}" --wait
  460. xcrun stapler staple Cryptomator-*.dmg
  461. - name: Clean up notarization credentials
  462. if: ${{ always() }}
  463. run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db
  464. - name: Add possible alpha/beta tags to installer name
  465. run: mv Cryptomator-*.dmg Cryptomator-${{ needs.metadata.outputs.semVerStr }}.dmg
  466. - name: Upload mac-dmg
  467. uses: actions/upload-artifact@v2
  468. with:
  469. name: mac-dmg
  470. path: Cryptomator-*.dmg
  471. if-no-files-found: error
  472. #
  473. # MSI package
  474. #
  475. win-msi:
  476. name: Build Cryptomator.msi
  477. runs-on: windows-latest
  478. needs: [appdir, metadata]
  479. steps:
  480. - uses: actions/checkout@v2
  481. - name: Download win-appdir
  482. uses: actions/download-artifact@v2
  483. with:
  484. name: win-appdir
  485. - name: Untar appdir.tar
  486. run: tar -xvf appdir.tar
  487. - uses: actions/setup-java@v1
  488. with:
  489. java-version: ${{ env.JAVA_VERSION }}
  490. - name: Patch Application Directory
  491. run: |
  492. cp dist/win/contrib/* appdir/Cryptomator
  493. - name: Fix permissions
  494. run: attrib -r appdir/Cryptomator/Cryptomator.exe
  495. shell: pwsh
  496. - name: Codesign
  497. uses: skymatic/code-sign-action@v1
  498. with:
  499. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  500. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  501. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  502. description: Cryptomator
  503. timestampUrl: 'http://timestamp.digicert.com'
  504. folder: appdir/Cryptomator
  505. recursive: true
  506. - name: Create MSI
  507. run: >
  508. ${JAVA_HOME}/bin/jpackage
  509. --verbose
  510. --type msi
  511. --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775
  512. --app-image appdir/Cryptomator
  513. --dest installer
  514. --name Cryptomator
  515. --vendor "Skymatic GmbH"
  516. --copyright "(C) 2016 - 2021 Skymatic GmbH"
  517. --app-version "${{ needs.metadata.outputs.semVerNum }}"
  518. --win-menu
  519. --win-dir-chooser
  520. --resource-dir dist/win/resources
  521. --license-file dist/win/resources/license.rtf
  522. --file-associations dist/win/resources/FAvaultFile.properties
  523. env:
  524. JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
  525. - name: Codesign MSI
  526. uses: skymatic/code-sign-action@v1
  527. with:
  528. certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
  529. password: ${{ secrets.WIN_CODESIGN_P12_PW }}
  530. certificatesha1: FF52240075AD7D14AF25629FDF69635357C7D14B
  531. description: Cryptomator Installer
  532. timestampUrl: 'http://timestamp.digicert.com'
  533. folder: installer
  534. - name: Add possible alpha/beta tags to installer name
  535. run: mv installer/Cryptomator-*.msi installer/Cryptomator-${{ needs.metadata.outputs.semVerStr }}.msi
  536. - name: Upload win-msi
  537. uses: actions/upload-artifact@v2
  538. with:
  539. name: win-msi
  540. path: installer/*.msi
  541. if-no-files-found: error
  542. #
  543. # Release
  544. #
  545. release:
  546. name: Draft a release on Github
  547. runs-on: ubuntu-latest
  548. needs: [metadata,linux-appimage,mac-dmg,win-msi,ppa]
  549. if: startsWith(github.ref, 'refs/tags/') && github.repository == 'cryptomator/cryptomator'
  550. env:
  551. APPIMAGE_SHA256_MSG: undefined
  552. DMG_SHA256_MSG: undefined
  553. MSI_SHA256_MSG: undefined
  554. steps:
  555. - uses: actions/checkout@v2
  556. - name: Create tarball
  557. run: git archive --prefix="cryptomator-${{ needs.metadata.outputs.semVerStr }}/" -o "cryptomator-${{ needs.metadata.outputs.semVerStr }}.tar.gz" ${{ github.ref }}
  558. - name: Download linux appimage
  559. uses: actions/download-artifact@v2
  560. with:
  561. name: linux-appimage
  562. - name: Download macOS dmg
  563. uses: actions/download-artifact@v2
  564. with:
  565. name: mac-dmg
  566. - name: Download Windows msi
  567. uses: actions/download-artifact@v2
  568. with:
  569. name: win-msi
  570. - name: Create detached GPG signature for all release files with key 615D449FE6E6A235
  571. run: |
  572. echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
  573. for FILE in `find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do
  574. echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ${FILE}
  575. done
  576. env:
  577. GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
  578. GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
  579. - 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
  580. run: |
  581. for FILE in `find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do
  582. CHECKSUM_MSG=$(sha256sum ${FILE})
  583. VALUE=$(echo ${CHECKSUM_MSG} | sed 's/\([0-9,a-f]\{64\}\)[[:blank:]]\([Cc]ryptomator-.*$\)/\2: `\1`/' )
  584. KEY=$(echo ${CHECKSUM_MSG} | sed 's/.*[[:blank:]].*\.\(.*$\)/\1/')
  585. echo "{${KEY^^}_SHA256_MSG}={${VALUE}}" >> $GITHUB_ENV
  586. done
  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. Checksums of release artifacts:
  609. * ${{ env.APPIMAGE_SHA256_MSG}}
  610. * ${{ env.DMG_SHA256_MSG}}
  611. * ${{ env.MSI_SHA_256_MSG}}