build-desktop-release.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. # This is a basic workflow to help you get started with Actions
  2. name: Build-Desktop-Release
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. tag-version:
  7. description: "Release Tag Version"
  8. required: true
  9. git-ref:
  10. description: "Release Git Ref"
  11. required: true
  12. default: "master"
  13. is-draft:
  14. description: 'Draft Release? '
  15. required: true
  16. default: "true"
  17. is-pre-release:
  18. description: 'Pre Release?'
  19. required: true
  20. default: "true"
  21. jobs:
  22. compile-cljs:
  23. runs-on: ubuntu-18.04
  24. steps:
  25. - name: Check out Git repository
  26. uses: actions/checkout@v1
  27. - name: Install Node.js, NPM and Yarn
  28. uses: actions/setup-node@v2
  29. with:
  30. node-version: 16
  31. - name: Setup Java JDK
  32. uses: actions/[email protected]
  33. with:
  34. java-version: 1.8
  35. - name: Cache local Maven repository
  36. uses: actions/cache@v2
  37. with:
  38. path: ~/.m2/repository
  39. key: ${{ runner.os }}-maven
  40. - name: Install clojure
  41. run: |
  42. curl -O https://download.clojure.org/install/linux-install-1.10.1.763.sh
  43. chmod +x linux-install-1.10.1.763.sh
  44. sudo ./linux-install-1.10.1.763.sh
  45. - name: Compile CLJS
  46. run: yarn install && gulp build && yarn cljs:release-electron
  47. - name: Update APP Version
  48. run: |
  49. sed -i 's/"version": "0.0.1"/"version": "${{ github.event.inputs.tag-version }}"/g' ./package.json
  50. working-directory: ./static
  51. - name: Display Package.json
  52. run: cat ./package.json
  53. working-directory: ./static
  54. - name: List Files
  55. run: ls -al
  56. working-directory: ./static
  57. - name: Compress Static Files
  58. run: zip -r static.zip ./static
  59. - name: Cache Static File
  60. uses: actions/upload-artifact@v1
  61. with:
  62. name: static.zip
  63. path: static.zip
  64. build-linux:
  65. runs-on: ubuntu-18.04
  66. needs: [ compile-cljs ]
  67. steps:
  68. - name: Download The Static Asset
  69. uses: actions/download-artifact@v1
  70. with:
  71. name: static.zip
  72. path: ./
  73. - name: Uncompress Static FIles
  74. run: unzip static.zip
  75. - name: Install Node.js, NPM and Yarn
  76. uses: actions/setup-node@v2
  77. with:
  78. node-version: 16
  79. - name: Cache Node Modules
  80. uses: actions/cache@v2
  81. with:
  82. path: |
  83. **/node_modules
  84. key: ${{ runner.os }}-node-modules
  85. - name: Build/Release Electron App
  86. run: yarn install && yarn electron:make
  87. working-directory: ./static
  88. - name: Change Artifact Name For ZIP File
  89. run: mv static/out/make/zip/linux/x64/*-linux-x64-*.zip static/out/make/zip/linux/x64/Logseq-linux.zip
  90. - name: Change Artifact Name For AppImage File
  91. run: mv static/out/make/*-*.AppImage static/out/make/Logseq-linux.AppImage
  92. - name: Cache Artifact With ZIP format
  93. uses: actions/upload-artifact@v1
  94. with:
  95. name: Logseq-linux.zip
  96. path: static/out/make/zip/linux/x64/Logseq-linux.zip
  97. - name: Cache Artifact With AppImage format
  98. uses: actions/upload-artifact@v1
  99. with:
  100. name: Logseq-linux.AppImage
  101. path: static/out/make/Logseq-linux.AppImage
  102. build-windows:
  103. runs-on: windows-latest
  104. needs: [ compile-cljs ]
  105. steps:
  106. - name: Download The Static Asset
  107. uses: actions/download-artifact@v1
  108. with:
  109. name: static.zip
  110. path: ./
  111. - name: Uncompress Static FIles
  112. run: unzip static.zip
  113. - name: Install Node.js, NPM and Yarn
  114. uses: actions/setup-node@v2
  115. with:
  116. node-version: 16
  117. - name: Cache Node Modules
  118. uses: actions/cache@v2
  119. with:
  120. path: |
  121. **/node_modules
  122. key: ${{ runner.os }}-node-modules
  123. - name: Deps Electron app
  124. run: yarn install
  125. working-directory: ./static
  126. - name: Fix Deps Electron app
  127. run: yarn run postinstall
  128. working-directory: ./static/node_modules/dugite/
  129. - name: Build/Release Electron app
  130. run: yarn electron:make
  131. working-directory: ./static
  132. - name: Change Artifact Name
  133. run: Get-ChildItem static\out\make\squirrel.windows\x64\*.exe | Rename-Item -NewName Logseq-win64.exe
  134. - name: List Directory
  135. run: dir
  136. working-directory: static/out/make/squirrel.windows/x64/
  137. - name: Cache Artifact
  138. uses: actions/upload-artifact@v1
  139. with:
  140. name: Logseq-win64.exe
  141. path: static/out/make/squirrel.windows/x64/Logseq-win64.exe
  142. build-macos:
  143. needs: [ compile-cljs ]
  144. runs-on: macos-latest
  145. steps:
  146. - name: Download The Static Asset
  147. uses: actions/download-artifact@v1
  148. with:
  149. name: static.zip
  150. path: ./
  151. - name: Uncompress Static Files
  152. run: unzip ./static.zip
  153. - name: List Static Files
  154. run: ls -al ./static
  155. - name: Install Node.js, NPM and Yarn
  156. uses: actions/setup-node@v2
  157. with:
  158. node-version: 16
  159. - name: Signing By Apple Developer ID
  160. uses: apple-actions/import-codesign-certs@v1
  161. with:
  162. p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
  163. p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
  164. - name: Cache Node Modules
  165. uses: actions/cache@v2
  166. with:
  167. path: |
  168. **/node_modules
  169. key: ${{ runner.os }}-node-modules
  170. - name: Build/Release Electron App
  171. run: yarn install && yarn electron:make
  172. working-directory: ./static
  173. env:
  174. APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
  175. APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
  176. - name: Change DMG Name
  177. run: mv static/out/make/*.dmg static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
  178. - name: Cache Artifact DMG
  179. uses: actions/upload-artifact@v1
  180. with:
  181. name: Logseq-x64.dmg
  182. path: static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
  183. - name: ls files
  184. run: du -a static/out/
  185. - name: Change zip Name
  186. run: mv static/out/make/zip/darwin/x64/*.zip static/out/make/zip/darwin/x64/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
  187. - name: Cache Artifact ZIP
  188. uses: actions/upload-artifact@v1
  189. with:
  190. name: Logseq-x64.zip
  191. path: static/out/make/zip/darwin/x64/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
  192. build-macos-arm64:
  193. needs: [ compile-cljs ]
  194. runs-on: macos-latest
  195. steps:
  196. # this is only needed temporarily
  197. # wait until macos-11 GA https://github.com/actions/virtual-environments/issues/2486
  198. # or m1 hardware https://github.com/actions/virtual-environments/issues/2187
  199. - name: hack osx sdk
  200. run: |
  201. if [ "$(sw_vers -productVersion | cut -d'.' -f1)" = 10 ]; then
  202. pushd /Library/Developer/CommandLineTools/SDKs
  203. sudo rm MacOSX.sdk
  204. sudo ln -s MacOSX11.1.sdk MacOSX.sdk
  205. sudo rm -rf MacOSX10.15.sdk
  206. ls -l
  207. popd
  208. fi
  209. - name: Download The Static Asset
  210. uses: actions/download-artifact@v1
  211. with:
  212. name: static.zip
  213. path: ./
  214. - name: Uncompress Static Files
  215. run: unzip ./static.zip
  216. - name: List Static Files
  217. run: ls -al ./static
  218. - name: Install Node.js, NPM and Yarn
  219. uses: actions/setup-node@v2
  220. with:
  221. node-version: 16
  222. - name: Signing By Apple Developer ID
  223. uses: apple-actions/import-codesign-certs@v1
  224. with:
  225. p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
  226. p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
  227. - name: Cache Node Modules
  228. uses: actions/cache@v2
  229. with:
  230. path: |
  231. **/node_modules
  232. key: ${{ runner.os }}-node-modules
  233. - name: Build/Release Electron App
  234. run: yarn install && yarn electron:make-macos-arm64
  235. working-directory: ./static
  236. env:
  237. APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
  238. APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
  239. - name: Change DMG Name
  240. run: mv static/out/make/*.dmg static/out/make/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
  241. - name: Cache Artifact DMG
  242. uses: actions/upload-artifact@v1
  243. with:
  244. name: Logseq-arm64.dmg
  245. path: static/out/make/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
  246. - name: ls files
  247. run: du -a static/out/
  248. - name: Change zip Name
  249. run: mv static/out/make/zip/darwin/arm64/*.zip static/out/make/zip/darwin/arm64/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
  250. - name: Cache Artifact ZIP
  251. uses: actions/upload-artifact@v1
  252. with:
  253. name: Logseq-arm64.zip
  254. path: static/out/make/zip/darwin/arm64/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
  255. release:
  256. needs: [ build-macos, build-linux, build-windows, build-macos-arm64 ]
  257. runs-on: ubuntu-18.04
  258. steps:
  259. - name: Download The MacOS X64 DMG Artifact
  260. uses: actions/download-artifact@v1
  261. with:
  262. name: Logseq-x64.dmg
  263. path: ./
  264. - name: Download The MacOS X64 ZIP Artifact
  265. uses: actions/download-artifact@v1
  266. with:
  267. name: Logseq-x64.zip
  268. path: ./
  269. - name: Download The MacOS ARM64 DMG Artifact
  270. uses: actions/download-artifact@v1
  271. with:
  272. name: Logseq-arm64.dmg
  273. path: ./
  274. - name: Download The MacOS ARM64 ZIP Artifact
  275. uses: actions/download-artifact@v1
  276. with:
  277. name: Logseq-arm64.zip
  278. path: ./
  279. - name: Download The Linux Artifact In Zip format
  280. uses: actions/download-artifact@v1
  281. with:
  282. name: Logseq-linux.zip
  283. path: ./
  284. - name: Download The Linux Artifact In AppImage format
  285. uses: actions/download-artifact@v1
  286. with:
  287. name: Logseq-linux.AppImage
  288. path: ./
  289. - name: Download The Windows Artifact
  290. uses: actions/download-artifact@v1
  291. with:
  292. name: Logseq-win64.exe
  293. path: ./
  294. - name: List files
  295. run: ls -rl
  296. - name: Create Release Draft
  297. id: create_release
  298. uses: actions/create-release@v1
  299. env:
  300. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  301. with:
  302. tag_name: ${{ github.event.inputs.tag-version }}
  303. release_name: Desktop APP ${{ github.event.inputs.tag-version }} (Beta Testing)
  304. draft: ${{ github.event.inputs.is-draft }}
  305. prerelease: ${{ github.event.inputs.is-pre-release }}
  306. - name: Upload MacOS X64 ZIP Artifact
  307. id: upload-macos-x64-zip-artifact
  308. uses: actions/upload-release-asset@v1
  309. env:
  310. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  311. with:
  312. upload_url: ${{ steps.create_release.outputs.upload_url }}
  313. asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
  314. asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
  315. asset_content_type: application/zip
  316. - name: Upload MacOS X64 DMG Artifact
  317. id: upload-macos-x64-dmg-artifact
  318. uses: actions/upload-release-asset@v1
  319. env:
  320. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  321. with:
  322. upload_url: ${{ steps.create_release.outputs.upload_url }}
  323. asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
  324. asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
  325. asset_content_type: application/x-apple-diskimage
  326. - name: Upload MacOS ARM64 ZIP Artifact
  327. id: upload-macos-arm64-zip-artifact
  328. uses: actions/upload-release-asset@v1
  329. env:
  330. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  331. with:
  332. upload_url: ${{ steps.create_release.outputs.upload_url }}
  333. asset_path: ./logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
  334. asset_name: logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
  335. asset_content_type: application/zip
  336. - name: Upload MacOS ARM64 DMG Artifact
  337. id: upload-macos-arm64-dmg-artifact
  338. uses: actions/upload-release-asset@v1
  339. env:
  340. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  341. with:
  342. upload_url: ${{ steps.create_release.outputs.upload_url }}
  343. asset_path: ./logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
  344. asset_name: logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
  345. asset_content_type: application/x-apple-diskimage
  346. - name: Upload Linux Artifact With Zip format
  347. id: upload-linux-artifact-with-zip-format
  348. uses: actions/upload-release-asset@v1
  349. env:
  350. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  351. with:
  352. upload_url: ${{ steps.create_release.outputs.upload_url }}
  353. asset_path: ./Logseq-linux.zip
  354. asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.zip
  355. asset_content_type: application/zip
  356. - name: Upload Linux Artifact With AppImage format
  357. id: upload-linux-artifact-with-appimage-format
  358. uses: actions/upload-release-asset@v1
  359. env:
  360. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  361. with:
  362. upload_url: ${{ steps.create_release.outputs.upload_url }}
  363. asset_path: ./Logseq-linux.AppImage
  364. asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.AppImage
  365. asset_content_type: application/octet-stream
  366. - name: Upload Windows Artifact
  367. id: upload-win-artifact
  368. uses: actions/upload-release-asset@v1
  369. env:
  370. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  371. with:
  372. upload_url: ${{ steps.create_release.outputs.upload_url }}
  373. asset_path: ./Logseq-win64.exe
  374. asset_name: logseq-win-x64-${{ github.event.inputs.tag-version }}.exe
  375. asset_content_type: application/octet-stream