build.yml 24 KB

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