build-desktop-release.yml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. # This is the main desktop application release workflow for both nightly and beta/stable releases.
  2. name: Build-Desktop-Release
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. build-target:
  7. description: 'Build Target (Release Type)'
  8. type: choice
  9. required: true
  10. options:
  11. - beta
  12. - nightly
  13. - non-release
  14. default: "non-release"
  15. git-ref:
  16. description: "Release Git Ref (Which branch or tag to build?)"
  17. required: true
  18. default: "master"
  19. is-draft:
  20. description: 'Draft Release? (Beta only, Nightly will always be a non-draft)'
  21. type: boolean
  22. required: true
  23. default: true
  24. is-pre-release:
  25. description: 'Pre Release? (labeled as "PreRelease")'
  26. type: boolean
  27. required: true
  28. default: true
  29. enable-file-sync-production:
  30. description: 'File sync production mode'
  31. type: boolean
  32. required: true
  33. default: true
  34. enable-plugins:
  35. description: 'Build with plugin system support'
  36. type: boolean
  37. required: true
  38. default: true
  39. build-android:
  40. description: 'Build Android App'
  41. type: boolean
  42. required: true
  43. default: true
  44. schedule: # Every workday at the 2 P.M. (UTC) we run a scheduled nightly build
  45. - cron: '0 14 * * MON-FRI'
  46. env:
  47. CLOJURE_VERSION: '1.11.1.1413'
  48. NODE_VERSION: '20'
  49. JAVA_VERSION: '11'
  50. jobs:
  51. compile-cljs:
  52. runs-on: ubuntu-20.04
  53. steps:
  54. - name: Check build options
  55. if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'nightly' || github.event.inputs.build-target == 'beta') && github.event.inputs.git-ref != 'master' }}
  56. run: |
  57. echo "::error title=CheckFail::Nightly and Beta Release MUST be built from master"
  58. exit 1
  59. - name: Check out Git repository
  60. uses: actions/checkout@v3
  61. with:
  62. ref: ${{ github.event.inputs.git-ref }}
  63. - name: Install Node.js, NPM and Yarn
  64. uses: actions/setup-node@v3
  65. with:
  66. node-version: ${{ env.NODE_VERSION }}
  67. - name: Get yarn cache directory path
  68. id: yarn-cache-dir-path
  69. run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
  70. - name: Cache yarn cache directory
  71. uses: actions/cache@v3
  72. id: yarn-cache
  73. with:
  74. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  75. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  76. restore-keys: |
  77. ${{ runner.os }}-yarn-
  78. - name: Setup Java JDK
  79. uses: actions/setup-java@v3
  80. with:
  81. distribution: 'zulu'
  82. java-version: ${{ env.JAVA_VERSION }}
  83. - name: Cache clojure deps
  84. uses: actions/cache@v3
  85. with:
  86. path: |
  87. ~/.m2/repository
  88. ~/.gitlibs
  89. key: ${{ runner.os }}-clojure-lib-${{ hashFiles('**/deps.edn') }}
  90. - name: Setup clojure
  91. uses: DeLaGuardo/[email protected]
  92. with:
  93. cli: ${{ env.CLOJURE_VERSION }}
  94. - name: Retrieve tag version
  95. id: ref
  96. run: |
  97. pkgver=$(node ./scripts/get-pkg-version.js "${{ github.event.inputs.build-target }}")
  98. echo "version=$pkgver" >> $GITHUB_OUTPUT
  99. - name: Do Not Overwrite Existing Release
  100. if: ${{ github.event.inputs.build-target == 'beta' }}
  101. run: |
  102. if curl -f "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.ref.outputs.version }}" &>/dev/null; then
  103. echo "::error title=CheckFail::Release already exists"
  104. exit 1
  105. fi
  106. - name: Update Nightly APP Version
  107. if: ${{ github.event.inputs.build-target == 'nightly' || github.event_name == 'schedule' }}
  108. run: |
  109. sed -i 's/defonce version ".*"/defonce version "${{ steps.ref.outputs.version }}"/g' src/main/frontend/version.cljs
  110. - name: Set Build Environment Variables (only when workflow_dispatch)
  111. if: ${{ github.event_name == 'workflow_dispatch' }}
  112. # if scheduled, use default settings
  113. run: |
  114. echo "ENABLE_PLUGINS=${{ github.event_name == 'schedule' || github.event.inputs.enable-plugins == 'true' }}" >> $GITHUB_ENV
  115. echo "ENABLE_FILE_SYNC_PRODUCTION=${{ github.event_name == 'schedule' || github.event.inputs.enable-file-sync-production == 'true' }}" >> $GITHUB_ENV
  116. - name: Compile CLJS
  117. run: yarn install && gulp build && yarn cljs:release-electron
  118. env:
  119. LOGSEQ_SENTRY_DSN: ${{ secrets.LOGSEQ_SENTRY_DSN }}
  120. LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}
  121. - name: Update APP Version
  122. run: |
  123. sed -i 's/"version": "0.0.1"/"version": "${{ steps.ref.outputs.version }}"/g' ./package.json
  124. working-directory: ./static
  125. - name: Display Package.json
  126. run: cat ./package.json
  127. working-directory: ./static
  128. - name: Save VERSION file
  129. run: echo "${{ steps.ref.outputs.version }}" > ./VERSION
  130. working-directory: ./static
  131. - name: List Files
  132. run: ls -al
  133. working-directory: ./static
  134. - name: Upload Sentry Sourcemaps (beta only)
  135. if: ${{ github.repository == 'logseq/logseq' && github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }}
  136. run: |
  137. curl -sL https://sentry.io/get-cli/ | bash
  138. release_name="logseq@${{ steps.ref.outputs.version }}"
  139. sentry-cli releases new "${release_name}"
  140. sentry-cli releases files "${release_name}" upload-sourcemaps --ext map --ext js ./static/js --url-prefix '~/static/js'
  141. sentry-cli releases finalize "${release_name}"
  142. env:
  143. SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
  144. SENTRY_ORG: logseq
  145. SENTRY_PROJECT: logseq
  146. - name: Cache Static File
  147. uses: actions/upload-artifact@v3
  148. with:
  149. name: static
  150. path: static
  151. e2e-test:
  152. name: E2E Test Shard ${{ matrix.shard }}
  153. runs-on: ubuntu-latest
  154. strategy:
  155. matrix:
  156. shard: [1, 2, 3]
  157. needs: [ compile-cljs ]
  158. steps:
  159. - name: Checkout
  160. uses: actions/checkout@v3
  161. - name: Download The Static Asset
  162. uses: actions/download-artifact@v3
  163. with:
  164. name: static
  165. path: static
  166. - name: Set up Node
  167. uses: actions/setup-node@v3
  168. with:
  169. node-version: ${{ env.NODE_VERSION }}
  170. cache: 'yarn'
  171. cache-dependency-path: |
  172. yarn.lock
  173. static/yarn.lock
  174. - name: Fetch yarn deps for E2E test
  175. run: |
  176. yarn install
  177. (cd static && yarn install && yarn rebuild:all)
  178. env:
  179. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
  180. - name: Install Fluxbox
  181. run: sudo apt-get update && sudo apt-get install -y fluxbox
  182. # Emulate a virtual framebuffer on machines with no display hardware
  183. - name: Run XVFB
  184. run: Xvfb :1 -screen 0 1024x768x24 >/dev/null 2>&1 &
  185. # Start a lightweight window manager to simulate window actions (maximize,restore etc)
  186. - name: Start Fluxbox
  187. run: DISPLAY=:1.0 fluxbox >/dev/null 2>&1 &
  188. - name: Run Playwright test
  189. run: DISPLAY=:1.0 npx playwright test --reporter github --shard=${{ matrix.shard }}/3
  190. env:
  191. LOGSEQ_CI: true
  192. DEBUG: "pw:api"
  193. RELEASE: true # skip dev only test
  194. build-linux-x64:
  195. runs-on: ubuntu-20.04
  196. needs: [ compile-cljs ]
  197. steps:
  198. - name: Download The Static Asset
  199. uses: actions/download-artifact@v3
  200. with:
  201. name: static
  202. path: static
  203. - name: Retrieve tag version
  204. id: ref
  205. run: |
  206. pkgver=$(cat ./static/VERSION)
  207. echo "version=$pkgver" >> $GITHUB_OUTPUT
  208. - name: Install Node.js, NPM and Yarn
  209. uses: actions/setup-node@v3
  210. with:
  211. node-version: ${{ env.NODE_VERSION }}
  212. # - name: Cache Node Modules
  213. # uses: actions/cache@v3
  214. # with:
  215. # path: |
  216. # **/node_modules
  217. # key: ${{ runner.os }}-node-modules
  218. - name: Build/Release Electron App
  219. run: yarn install && yarn electron:make
  220. working-directory: ./static
  221. - name: Save artifacts
  222. run: |
  223. mkdir -p builds
  224. # NOTE: save VERSION file to builds directory
  225. cp static/VERSION ./builds/VERSION
  226. mv static/out/make/*-*.AppImage ./builds/Logseq-linux-x64-${{ steps.ref.outputs.version }}.AppImage
  227. mv static/out/make/zip/linux/x64/*-linux-x64-*.zip ./builds/Logseq-linux-x64-${{ steps.ref.outputs.version }}.zip
  228. - name: Upload Artifact
  229. uses: actions/upload-artifact@v3
  230. with:
  231. name: logseq-linux-x64-builds
  232. path: builds
  233. build-linux-arm64:
  234. runs-on: ubuntu-20.04
  235. needs: [ compile-cljs ]
  236. steps:
  237. - name: Download The Static Asset
  238. uses: actions/download-artifact@v3
  239. with:
  240. name: static
  241. path: static
  242. - name: Retrieve tag version
  243. id: ref
  244. run: |
  245. pkgver=$(cat ./static/VERSION)
  246. echo "version=$pkgver" >> $GITHUB_OUTPUT
  247. - name: Install Node.js, NPM and Yarn
  248. uses: actions/setup-node@v3
  249. with:
  250. node-version: ${{ env.NODE_VERSION }}
  251. - name: Fetch deps
  252. env:
  253. npm_config_arch: arm64
  254. run: |
  255. yarn install --target_arch=arm64 --target_platform=linux
  256. rsapi_version=`node -e 'console.log(require("@logseq/rsapi/package.json").optionalDependencies["@logseq/rsapi-linux-arm64-gnu"])'`
  257. temp_dir=`mktemp -d`
  258. cd "$temp_dir"
  259. echo '{"dependencies": {"@logseq/rsapi-linux-arm64-gnu": "'"$rsapi_version"'"}}' > package.json
  260. yarn install --ignore-platform
  261. cd -
  262. mv "$temp_dir/node_modules/@logseq/rsapi-linux-arm64-gnu" node_modules/@logseq/rsapi-linux-arm64-gnu
  263. rm -rf "$temp_dir" "node_modules/@logseq/rsapi-linux-x64-gnu"
  264. working-directory: ./static
  265. - name: Build/Release Electron App
  266. run: yarn electron:make-linux-arm64
  267. working-directory: ./static
  268. - name: Save artifacts
  269. run: |
  270. mkdir -p builds
  271. # NOTE: save VERSION file to builds directory
  272. cp static/VERSION ./builds/VERSION
  273. # mv static/out/make/*-*.AppImage ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.AppImage
  274. mv static/out/make/zip/linux/arm64/*-linux-arm64-*.zip ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.zip
  275. - name: Upload Artifact
  276. uses: actions/upload-artifact@v3
  277. with:
  278. name: logseq-linux-arm64-builds
  279. path: builds
  280. build-windows:
  281. runs-on: windows-latest
  282. needs: [ compile-cljs ]
  283. steps:
  284. - name: Download The Static Asset
  285. uses: actions/download-artifact@v3
  286. with:
  287. name: static
  288. path: static
  289. - name: Retrieve tag version
  290. id: ref
  291. run: echo "version=$(cat ./static/VERSION)" >> $env:GITHUB_OUTPUT
  292. - name: Install Node.js, NPM and Yarn
  293. uses: actions/setup-node@v3
  294. with:
  295. node-version: ${{ env.NODE_VERSION }}
  296. # - name: Cache Node Modules
  297. # uses: actions/cache@v3
  298. # with:
  299. # path: |
  300. # **/node_modules
  301. # key: ${{ runner.os }}-node-modules
  302. - name: Deps Electron app
  303. run: yarn install
  304. working-directory: ./static
  305. - name: Fix Deps Electron app
  306. run: yarn run postinstall
  307. working-directory: ./static/node_modules/dugite/
  308. - name: Build/Release Electron app
  309. run: yarn electron:make
  310. working-directory: ./static
  311. #env:
  312. # CODE_SIGN_CERTIFICATE_FILE: ../codesign.pfx
  313. # CODE_SIGN_CERTIFICATE_PASSWORD: ${{ secrets.CODE_SIGN_CERTIFICATE_PASSWORD }}
  314. - name: Save Artifact for Code Signing
  315. run: |
  316. mkdir builds
  317. mv static\out\make\squirrel.windows\x64\*.exe builds\Logseq-win-x64-${{ steps.ref.outputs.version }}.exe
  318. - name: Upload Artifact for Code Signing
  319. uses: actions/upload-artifact@v3
  320. with:
  321. name: logseq-win64-unsigned-builds
  322. path: builds
  323. - name: Save Artifact
  324. run: |
  325. rm builds\*.exe
  326. mv static\out\make\squirrel.windows\x64\*.nupkg builds\Logseq-win-x64-${{ steps.ref.outputs.version }}-full.nupkg
  327. mv static\out\make\zip\win32\x64\*.zip builds\Logseq-win-x64-${{ steps.ref.outputs.version }}.zip
  328. mv static\out\make\wix\x64\Logseq.msi builds\Logseq-win-x64-${{ steps.ref.outputs.version }}.msi
  329. mv static\out\make\squirrel.windows\x64\RELEASES builds\RELEASES
  330. - name: Upload Artifact
  331. uses: actions/upload-artifact@v3
  332. with:
  333. name: logseq-win64-builds
  334. path: builds
  335. build-macos-x64:
  336. needs: [ compile-cljs ]
  337. runs-on: macos-13
  338. steps:
  339. - name: Download The Static Asset
  340. uses: actions/download-artifact@v3
  341. with:
  342. name: static
  343. path: static
  344. - name: Retrieve tag version
  345. id: ref
  346. run: |
  347. pkgver=$(cat ./static/VERSION)
  348. echo "version=$pkgver" >> $GITHUB_OUTPUT
  349. - name: List Static Files
  350. run: ls -al ./static
  351. - name: Install Node.js, NPM and Yarn
  352. uses: actions/setup-node@v3
  353. with:
  354. node-version: ${{ env.NODE_VERSION }}
  355. - name: Install Python
  356. uses: actions/setup-python@v4
  357. with:
  358. python-version: '3.11'
  359. - name: Get yarn cache directory path
  360. id: yarn-cache-dir-path
  361. run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
  362. - name: Cache yarn cache directory
  363. uses: actions/cache@v3
  364. id: yarn-cache
  365. with:
  366. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  367. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  368. restore-keys: |
  369. ${{ runner.os }}-yarn-
  370. - name: Signing By Apple Developer ID
  371. if: ${{ github.repository == 'logseq/logseq' }}
  372. uses: apple-actions/import-codesign-certs@v1
  373. with:
  374. p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
  375. p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
  376. # - name: Cache Node Modules
  377. # uses: actions/cache@v3
  378. # with:
  379. # path: |
  380. # **/node_modules
  381. # key: ${{ runner.os }}-node-modules
  382. - name: Build/Release Electron App for x64
  383. run: yarn install && yarn electron:make
  384. working-directory: ./static
  385. env:
  386. APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
  387. APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
  388. APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
  389. - name: Save x64 artifacts
  390. run: |
  391. mkdir -p builds
  392. mv static/out/make/Logseq.dmg ./builds/Logseq-darwin-x64-${{ steps.ref.outputs.version }}.dmg
  393. mv static/out/make/zip/darwin/x64/*.zip ./builds/Logseq-darwin-x64-${{ steps.ref.outputs.version }}.zip
  394. - name: Upload Artifact
  395. uses: actions/upload-artifact@v3
  396. with:
  397. name: logseq-darwin-x64-builds
  398. path: builds
  399. build-macos-arm64:
  400. needs: [ compile-cljs ]
  401. runs-on: macos-14
  402. steps:
  403. - name: Download The Static Asset
  404. uses: actions/download-artifact@v3
  405. with:
  406. name: static
  407. path: static
  408. - name: Retrieve tag version
  409. id: ref
  410. run: |
  411. pkgver=$(cat ./static/VERSION)
  412. echo "version=$pkgver" >> $GITHUB_OUTPUT
  413. - name: Install Node.js, NPM and Yarn
  414. uses: actions/setup-node@v3
  415. with:
  416. node-version: ${{ env.NODE_VERSION }}
  417. - name: Get yarn cache directory path
  418. id: yarn-cache-dir-path
  419. run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
  420. - name: Cache yarn cache directory
  421. uses: actions/cache@v3
  422. id: yarn-cache
  423. with:
  424. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  425. key: ${{ runner.os }}-arm64-yarn-${{ hashFiles('**/yarn.lock') }}
  426. restore-keys: |
  427. ${{ runner.os }}-arm64-yarn-
  428. - name: Install Python
  429. uses: actions/setup-python@v4
  430. with:
  431. python-version: '3.11'
  432. - name: Signing By Apple Developer ID
  433. if: ${{ github.repository == 'logseq/logseq' }}
  434. uses: apple-actions/import-codesign-certs@v1
  435. with:
  436. p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
  437. p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
  438. # - name: Cache Node Modules
  439. # uses: actions/cache@v3
  440. # with:
  441. # path: |
  442. # **/node_modules
  443. # key: ${{ runner.os }}-node-modules
  444. - name: Fetch deps and fix dugit arch for arm64
  445. run: yarn install --ignore-platform && cd node_modules/dugite && npm_config_arch=arm64 node script/download-git.js
  446. working-directory: ./static
  447. - name: Build/Release Electron App for arm64
  448. run: yarn electron:make-macos-arm64
  449. working-directory: ./static
  450. env:
  451. APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
  452. APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
  453. APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
  454. - name: Save arm64 artifacts
  455. run: |
  456. mkdir -p builds
  457. mv static/out/make/Logseq.dmg ./builds/Logseq-darwin-arm64-${{ steps.ref.outputs.version }}.dmg
  458. mv static/out/make/zip/darwin/arm64/*.zip ./builds/Logseq-darwin-arm64-${{ steps.ref.outputs.version }}.zip
  459. - name: Upload Artifact
  460. uses: actions/upload-artifact@v3
  461. with:
  462. name: logseq-darwin-arm64-builds
  463. path: builds
  464. # reuse workflow via workflow_call
  465. build-android:
  466. uses: ./.github/workflows/build-android.yml
  467. if: ${{ github.event_name == 'schedule' || github.event.inputs.build-android == 'true' }}
  468. with:
  469. build-target: "${{ github.event.inputs.build-target }}"
  470. # if scheduled, use production mode
  471. enable-file-sync-production: "${{ github.event_name == 'schedule' || github.event.inputs.enable-file-sync-production == 'true' }}"
  472. secrets:
  473. ANDROID_KEYSTORE: "${{ secrets.ANDROID_KEYSTORE }}"
  474. ANDROID_KEYSTORE_PASSWORD: "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
  475. SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
  476. codesign-windows:
  477. if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly' || github.event.inputs.build-target == 'beta' }}
  478. needs: [ build-windows ]
  479. runs-on: [self-hosted, macos, token]
  480. steps:
  481. - name: Download Windows Artifact
  482. uses: actions/download-artifact@v3
  483. with:
  484. name: logseq-win64-unsigned-builds
  485. path: ./builds
  486. - name: Sign Windows Executable
  487. run: |
  488. ls -lah ./builds
  489. jsign --storetype ETOKEN --storepass "${PASS}" -t http://timestamp.sectigo.com ./builds/*.exe
  490. env:
  491. PASS: ${{ secrets.CODE_SIGN_CERTIFICATE_PASSWORD }}
  492. - name: Upload Artifact
  493. uses: actions/upload-artifact@v3
  494. with:
  495. name: logseq-win64-signed-builds
  496. path: builds
  497. nightly-release:
  498. if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly' }}
  499. needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, codesign-windows, build-android, e2e-test ]
  500. runs-on: ubuntu-20.04
  501. steps:
  502. - name: Download MacOS x64 Artifacts
  503. uses: actions/download-artifact@v3
  504. with:
  505. name: logseq-darwin-x64-builds
  506. path: ./
  507. - name: Download MacOS arm64 Artifacts
  508. uses: actions/download-artifact@v3
  509. with:
  510. name: logseq-darwin-arm64-builds
  511. path: ./
  512. - name: Download The Linux x64 Artifacts
  513. uses: actions/download-artifact@v3
  514. with:
  515. name: logseq-linux-x64-builds
  516. path: ./
  517. - name: Download The Linux arm64 Artifacts
  518. uses: actions/download-artifact@v3
  519. with:
  520. name: logseq-linux-arm64-builds
  521. path: ./
  522. - name: Download The Windows Artifact (Signed)
  523. uses: actions/download-artifact@v3
  524. with:
  525. name: logseq-win64-signed-builds
  526. path: ./
  527. - name: Download The Windows Artifact
  528. uses: actions/download-artifact@v3
  529. with:
  530. name: logseq-win64-builds
  531. path: ./
  532. - name: Download Android Artifacts
  533. uses: actions/download-artifact@v3
  534. with:
  535. name: logseq-android-builds
  536. path: ./
  537. - name: Generate SHA256 checksums
  538. run: |
  539. sha256sum *-darwin-* > SHA256SUMS.txt
  540. sha256sum *-win-* >> SHA256SUMS.txt
  541. sha256sum *-linux-* >> SHA256SUMS.txt
  542. sha256sum *.apk >> SHA256SUMS.txt
  543. cat SHA256SUMS.txt
  544. - name: List files
  545. run: ls -rl
  546. - name: Update Nightly Release
  547. uses: andelf/nightly-release@main
  548. env:
  549. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  550. with:
  551. tag_name: nightly
  552. name: 'Desktop/Android APP Nightly Release $$'
  553. draft: false
  554. prerelease: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.is-pre-release) || (github.event_name == 'schedule')}}
  555. body: |
  556. This is a nightly release of the Logseq desktop app.
  557. It's unstable compared to the official releases, **use it with caution**!
  558. files: |
  559. ./SHA256SUMS.txt
  560. ./*.zip
  561. ./*.dmg
  562. ./*.exe
  563. ./*.msi
  564. ./*.AppImage
  565. ./*.apk
  566. release:
  567. # NOTE: For now, we only have beta channel to be released on Github
  568. if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }}
  569. needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, codesign-windows, build-android, e2e-test ]
  570. runs-on: ubuntu-20.04
  571. steps:
  572. - name: Download MacOS x64 Artifacts
  573. uses: actions/download-artifact@v3
  574. with:
  575. name: logseq-darwin-x64-builds
  576. path: ./
  577. - name: Download MacOS arm64 Artifacts
  578. uses: actions/download-artifact@v3
  579. with:
  580. name: logseq-darwin-arm64-builds
  581. path: ./
  582. - name: Download The Linux x64 Artifacts
  583. uses: actions/download-artifact@v3
  584. with:
  585. name: logseq-linux-x64-builds
  586. path: ./
  587. - name: Download The Linux arm64 Artifacts
  588. uses: actions/download-artifact@v3
  589. with:
  590. name: logseq-linux-arm64-builds
  591. path: ./
  592. - name: Download The Windows Artifact (Signed)
  593. uses: actions/download-artifact@v3
  594. with:
  595. name: logseq-win64-signed-builds
  596. path: ./
  597. - name: Download The Windows Artifact
  598. uses: actions/download-artifact@v3
  599. with:
  600. name: logseq-win64-builds
  601. path: ./
  602. - name: Download Android Artifacts
  603. uses: actions/download-artifact@v3
  604. if: ${{ github.event_name == 'schedule' || github.event.inputs.build-android == 'true' }}
  605. with:
  606. name: logseq-android-builds
  607. path: ./
  608. - name: List files
  609. run: ls -rl
  610. - name: Retrieve tag version
  611. id: ref
  612. run: |
  613. pkgver=$(cat VERSION)
  614. echo "version=$pkgver" >> $GITHUB_OUTPUT
  615. - name: Fix .nupkg name in RELEASES file
  616. run: |
  617. sed -i "s/Logseq-.*.nupkg/Logseq-win-x64-${{ steps.ref.outputs.version }}-full.nupkg/g" RELEASES
  618. - name: Generate SHA256 checksums
  619. run: |
  620. sha256sum *-darwin-* > SHA256SUMS.txt
  621. sha256sum *-win-* >> SHA256SUMS.txt
  622. sha256sum *-linux-* >> SHA256SUMS.txt
  623. sha256sum *.apk >> SHA256SUMS.txt
  624. sha256sum RELEASES >> SHA256SUMS.txt
  625. cat SHA256SUMS.txt
  626. - name: Create Release Draft
  627. uses: softprops/action-gh-release@v1
  628. env:
  629. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  630. with:
  631. tag_name: ${{ steps.ref.outputs.version }}
  632. name: Desktop/Android APP ${{ steps.ref.outputs.version }} (Beta Testing)
  633. body: "TODO: Fill this changelog. Sorry for the inconvenience!"
  634. draft: ${{ github.event.inputs.is-draft }}
  635. prerelease: ${{ github.event.inputs.is-pre-release }}
  636. files: |
  637. ./VERSION
  638. ./SHA256SUMS.txt
  639. ./*.zip
  640. ./*.dmg
  641. ./*.exe
  642. ./*.msi
  643. ./*.nupkg
  644. ./RELEASES
  645. ./*.AppImage
  646. ./*.apk