Skip to content

Set up NX-based monorepo #1773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 305 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
305 commits
Select commit Hold shift + click to select a range
ccb5ee7
fix(monorepo/server): serving of libraries
eliandoran Apr 18, 2025
9b07e60
fix(monorepo/server): translations
eliandoran Apr 18, 2025
7443d12
chore(monorepo/server): get rid of webpack middleware
eliandoran Apr 18, 2025
639a56e
Merge remote-tracking branch 'origin/develop' into feature/client_ser…
eliandoran Apr 18, 2025
0143db5
chore(monorepo): put back CI and environment setup
eliandoran Apr 18, 2025
ca37a41
chore(monorepo): put back docs
eliandoran Apr 18, 2025
42befb1
chore(monorepo): remove deprecated gitpod
eliandoran Apr 18, 2025
eb6c89f
chore(monorepo): remove npm prepare breaking npm ci
eliandoran Apr 18, 2025
15bba95
chore(monorepo): reintegrate update nightly version
eliandoran Apr 18, 2025
a271e57
chore(monorepo): adapt update nightly for client & server
eliandoran Apr 18, 2025
c62fb0f
chore(monorepo): adapt update-build-info
eliandoran Apr 18, 2025
6aa6597
chore(monorepo/server): reintroduce tests
eliandoran Apr 18, 2025
eecf984
chore(monorepo/server): improve running of tests
eliandoran Apr 18, 2025
12bdf5a
chore(monorepo/server): remove server: prefix from scripts
eliandoran Apr 18, 2025
f0d365e
chore(monorepo/client): reintegrate tests
eliandoran Apr 18, 2025
fe27eea
chore(monorepo): add global test script
eliandoran Apr 18, 2025
bc42038
chore(monorepo/client): fix non-expected error
eliandoran Apr 18, 2025
b3946db
chore(monorepo): scripts to build globally
eliandoran Apr 18, 2025
5c426df
chore(monorepo): bring back build server
eliandoran Apr 18, 2025
645cf6c
chore(monorepo): bring back copy dist
eliandoran Apr 18, 2025
c7b2a73
chore(monorepo/server): move dist & some scripts
eliandoran Apr 18, 2025
4ecb80c
chore(monorepo/server): move licenses & adapt script
eliandoran Apr 18, 2025
5b29886
fix(monorepo/server): path of copy-dist
eliandoran Apr 18, 2025
14b8578
fix(monorepo/server): copying of source code
eliandoran Apr 18, 2025
d688f7f
chore(monorepo/server): add script to run dist
eliandoran Apr 18, 2025
3df195a
fix(monorepo/server): dist not running due to gfm package
eliandoran Apr 18, 2025
d24e668
fix(monorepo/server): missing asset in dist
eliandoran Apr 18, 2025
88994ae
chore(monorepo/server): copy client artifacts
eliandoran Apr 18, 2025
81e6537
chore(monorepo/server): dist:start running in dev mode
eliandoran Apr 18, 2025
2325fbc
chore(monorepo/server): find workaround to copy node modules
eliandoran Apr 18, 2025
87f3797
fix(monorepo/server): libraries not accessible on dist
eliandoran Apr 18, 2025
5e5b307
Merge remote-tracking branch 'origin/develop' into feature/client_ser…
eliandoran Apr 18, 2025
70b49f1
fix(monorepo/ci): fix "Run the TypeScript build" steps
eliandoran Apr 18, 2025
2037868
fix(monorepo/client): fix excalidraw not being copied
eliandoran Apr 18, 2025
e8d9f98
fix(monorepo): wrong server:build
eliandoran Apr 18, 2025
37bf7c2
chore(monorepo/client): less verbose webpack output
eliandoran Apr 18, 2025
402da5d
fix(monorepo/server): building the server
eliandoran Apr 18, 2025
a588003
fix(monorepo/ci): not triggering the right package command
eliandoran Apr 18, 2025
d4ad130
chore(monorepo/ci): trigger commons build first
eliandoran Apr 18, 2025
b2ebc8d
chore(monorepo/ci): trigger client build also
eliandoran Apr 18, 2025
855c1b9
chore(monorepo/ci): script failing due to some non-existing files
eliandoran Apr 18, 2025
3f12483
chore(monorepo/ci): script failing due to anonymize-database.sql
eliandoran Apr 18, 2025
706a2ec
chore(monorepo/ci): script failing due to dist change
eliandoran Apr 18, 2025
dd07663
chore(monorepo/electron): create package.json
eliandoran Apr 18, 2025
acc7729
chore(monorepo/electron): add extra dependencies
eliandoran Apr 18, 2025
5fd8038
chore(monorepo/electron): add types for squirrel
eliandoran Apr 18, 2025
00ca0e6
chore(monorepo/electron): rewrite server imports
eliandoran Apr 18, 2025
4543017
chore(monorepo/electron): add run script
eliandoran Apr 18, 2025
183cbc6
chore(monorepo/electron): rebuild sqlite
eliandoran Apr 18, 2025
2746527
chore(monorepo/electron): invoke copy-dist
eliandoran Apr 18, 2025
e027f7e
fix(monorepo/electron): copy-dist failing
eliandoran Apr 18, 2025
d714c04
feat(monorepo/electron): allow running prod build
eliandoran Apr 18, 2025
132242b
Merge remote-tracking branch 'origin/develop' into feature/client_ser…
eliandoran Apr 18, 2025
3935ae2
chore(monorepo/electron): reintroduce electron forge
eliandoran Apr 18, 2025
6c443c1
chore(monorepo/electron): introduce global script & rename to desktop
eliandoran Apr 18, 2025
3d5e619
fix(monorepo/electron): out of date lock
eliandoran Apr 18, 2025
7010741
chore(monorepo): handle build chains in root package scripts
eliandoran Apr 18, 2025
5d9f2c8
chore(monorepo/electron): run prepare-dist for server
eliandoran Apr 19, 2025
084578b
chore(monorepo/electron): add global clean script
eliandoran Apr 19, 2025
ee422ee
fix(monorepo/electron): reintroduce app icons
eliandoran Apr 19, 2025
ba04fd3
fix(monorepo/electron): reintroduce other icons
eliandoran Apr 19, 2025
8a8c8e1
fix(monorepo/electron): artifact searching
eliandoran Apr 19, 2025
1041b33
fix(monorepo/electron): upload path
eliandoran Apr 19, 2025
45b1258
fix(monorepo/electron): bin path
eliandoran Apr 19, 2025
00a9864
chore(monorepo): move some files back to root
eliandoran Apr 19, 2025
93e4fc1
fix(monorepo/electron): windows building failing due to nuspec
eliandoran Apr 19, 2025
8dabeb1
fix(monorepo/electron): linux failing due to deb packaging
eliandoran Apr 19, 2025
0b327dd
fix(monorepo/electron): use different approach for deb that might work
eliandoran Apr 19, 2025
423cc34
fix(monorepo/electron): use yet another approach for executableName
eliandoran Apr 19, 2025
8733ace
fix(monorepo/electron): add back executable name in package.json
eliandoran Apr 19, 2025
abcf08e
fix(monorepo/electron): rewrite package.json to avoid flaky config im…
eliandoran Apr 19, 2025
31721cb
chore(monorepo): move README onto docs
eliandoran Apr 19, 2025
1450060
chore(monorepo): try to fix ARM64 not building properly on Linux
eliandoran Apr 19, 2025
fa9748e
chore(monorepo): fix artifact publishing for nightly
eliandoran Apr 19, 2025
3558d3a
fix(monorepo/electron): server dependency not packaged
eliandoran Apr 19, 2025
e408f7d
fix(monorepo/electron): fix some sub-dependencies not being copied
eliandoran Apr 19, 2025
75bdb31
fix(monorepo/server): use different mechanism for obtaining dependencies
eliandoran Apr 19, 2025
10f3926
fix(monorepo/server): try to fix npm ci error due to monorepo dep
eliandoran Apr 19, 2025
371234a
fix(monorepo/server): try npm i instead of ci
eliandoran Apr 19, 2025
2a57663
fix(monorepo/server): stop installing dependencies from build-electron
eliandoran Apr 19, 2025
f73cabc
fix(monorepo/electron): local dependency issues when running electron…
eliandoran Apr 20, 2025
75462fb
fix(monorepo/server): fix mime-types not present in dist
eliandoran Apr 20, 2025
24bce54
fix(monorepo/electron): rebuild deps for start-prod
eliandoran Apr 20, 2025
562d6fa
fix(monorepo/server): fix missing yauzl dependency in prod
eliandoran Apr 20, 2025
953ad2b
fix(monorepo/electron): fix missing commons dependency in prod
eliandoran Apr 20, 2025
8cc4bcb
fix(monorepo/server): fix missing monorepo dependencies
eliandoran Apr 20, 2025
46117ec
fix(monorepo/desktop): fix electron-level deps
eliandoran Apr 20, 2025
28972b8
fix(monorepo/desktop): fix electron-debug error
eliandoran Apr 20, 2025
d47a0a3
fix(monorepo/desktop): fix missing @electron/remote
eliandoran Apr 20, 2025
6e1a631
Merge branch 'develop' into feature/client_server_separation
JYC333 Apr 20, 2025
01121f9
chore: 🤖 update deps from develop
JYC333 Apr 20, 2025
0aa55dd
fix(monorepo/desktop): fix missing express-partial-content
eliandoran Apr 21, 2025
5564c76
chore(monorepo): sync package lock
eliandoran Apr 21, 2025
3eba61d
chore(monorepo): remove no longer relevant script
eliandoran Apr 21, 2025
df7e7b4
chore(monorepo): missing vitest dependency
eliandoran Apr 21, 2025
b750920
chore(monorepo/edit-docs): port files
eliandoran Apr 21, 2025
e49d248
chore(monorepo/dump-db): move to apps
eliandoran Apr 21, 2025
a068f75
chore(monorepo/edit-docs): fix module issue & add entry point
eliandoran Apr 22, 2025
fcd6a31
chore(monorepo/server): move Docker files
eliandoran Apr 22, 2025
2e200ea
Merge remote-tracking branch 'origin/develop' into feature/client_ser…
eliandoran Apr 22, 2025
62dbcc0
chore(nx): move all monorepo-style in subfolder for processing
eliandoran Apr 22, 2025
4f70084
chore(nx): start off with a blank package.json
eliandoran Apr 22, 2025
a56b3c8
chore(nx): move .vscode extensions to old
eliandoran Apr 22, 2025
57ecf72
chore(nx): initialize as empty project
eliandoran Apr 22, 2025
84b6764
chore(nx): initialize empty commons project
eliandoran Apr 22, 2025
41cf38a
chore(nx): prepare commons
eliandoran Apr 22, 2025
a10a4ba
chore(nx): prepare turndown-plugin-gfm
eliandoran Apr 22, 2025
9c0d422
chore(nx): create empty project for server
eliandoran Apr 22, 2025
b2af043
chore(nx/server): move source code
eliandoran Apr 22, 2025
e76f47e
chore(nx/server): switch to module
eliandoran Apr 22, 2025
1cbf574
chore(nx): remove unnecessary files
eliandoran Apr 22, 2025
9dafaba
chore(nx/server): manage dependencies
eliandoran Apr 22, 2025
462ed3c
chore(nx/server): remove empty file
eliandoran Apr 22, 2025
1c63fb7
chore(monorepo/server): configure to work with top-level await
eliandoran Apr 22, 2025
e655963
chore(monorepo): remove dist
eliandoran Apr 22, 2025
6e35806
chore(monorepo/server): fix build errors due to wrong imports
eliandoran Apr 22, 2025
6543d6c
chore(monorepo/server): remove top-level await completely
eliandoran Apr 22, 2025
2aad162
chore(monorepo/server): fix db asset path
eliandoran Apr 22, 2025
40fec89
chore(nx/turndown-plugin): fix compilation
eliandoran Apr 22, 2025
b27ff1d
chore(nx/commons): fix compilation
eliandoran Apr 22, 2025
2148714
chore(nx/server): add dependency to electron
eliandoran Apr 22, 2025
d5e1c5c
chore(nx/server): fix favicon
eliandoran Apr 22, 2025
e817a55
chore(nx/server): fix api_docs_js_1.default.register is not a function
eliandoran Apr 22, 2025
23572bd
chore(monorepo/client): create empty project
eliandoran Apr 22, 2025
9afe2ef
chore(monorepo/client): move client source files
eliandoran Apr 22, 2025
70466dd
chore(monorepo/client): sync settings
eliandoran Apr 22, 2025
fa48e59
chore(monorepo/client): set up dependencies
eliandoran Apr 22, 2025
eb6d802
chore(monorepo/client): set up stylesheets
eliandoran Apr 22, 2025
aeeedea
chore(monorepo/client): reintroduce script loader
eliandoran Apr 22, 2025
f2ade4e
chore(nx/client): bypass module errors due to electron dependency
eliandoran Apr 23, 2025
bcc908a
chore(nx/client): fix asset error
eliandoran Apr 23, 2025
23bfda0
chore(nx/client): fix dependency to commons
eliandoran Apr 23, 2025
f89eb8c
chore(nx/client): warning about util module
eliandoran Apr 23, 2025
c3a0c54
chore(nx/client): set up entrypoints
eliandoran Apr 23, 2025
eb67fe5
chore(nx/client): set up environment variables for serve
eliandoran Apr 23, 2025
4e8ab98
chore(nx/client): missing config-sample
eliandoran Apr 23, 2025
5308a08
chore(nx/client): set up proxy to client
eliandoran Apr 23, 2025
659ccd8
refactor(nx/client): set up proxy to client
eliandoran Apr 23, 2025
0d4de2a
refactor(nx/client): add types for http proxy
eliandoran Apr 23, 2025
b2d051e
refactor(nx/server): fix proxying of stylesheets
eliandoran Apr 23, 2025
824d9e8
refactor(nx/client): fix CSS comment breaking build
eliandoran Apr 23, 2025
b213f99
fix(nx/client): missing runtime chunk
eliandoran Apr 23, 2025
44b778f
fix(nx/client): proxying of libraries
eliandoran Apr 23, 2025
43a44bf
chore(nx/client): supress bootstrap warnings
eliandoran Apr 23, 2025
9d284a5
chore(nx/client): revert change to i18n debug
eliandoran Apr 23, 2025
ca309f3
chore(nx/client): get rid of warnings overlay
eliandoran Apr 23, 2025
492e953
chore(nx/desktop): start off with empty project
eliandoran Apr 23, 2025
15fbe41
chore(nx/desktop): switch to webpack-based build
eliandoran Apr 23, 2025
7f96514
chore(nx/desktop): set up source code via webpack
eliandoran Apr 23, 2025
470cd7f
chore(nx/desktop): bundle server
eliandoran Apr 23, 2025
4e6047f
chore(nx/desktop): copy .node file for better-sqlite3
eliandoran Apr 23, 2025
5d02afe
chore(nx/desktop): implement electron-rebuild
eliandoran Apr 23, 2025
5dd2b21
fix(nx/desktop): backend not imported well
eliandoran Apr 23, 2025
5389b8b
chore(monorepo): switch to pnpm
eliandoran Apr 23, 2025
42c5ef2
chore(monorepo): get electron to start
eliandoran Apr 23, 2025
de94457
chore(monorepo/server): set up copy of bettersqlite
eliandoran Apr 24, 2025
c8f0fac
fix(monorepo/client): errors after pnpm
eliandoran Apr 24, 2025
c79e3f5
fix(monorepo/server): asset path
eliandoran Apr 24, 2025
28ce71a
fix(monorepo/server): get translations to work
eliandoran Apr 24, 2025
d201087
feat(nx/server): copy client into server
eliandoran Apr 24, 2025
5911eaf
fix(nx/server): get images to work in dev mode
eliandoran Apr 24, 2025
11955ae
fix(nx/server): serve most assets for dist
eliandoran Apr 24, 2025
b3754f4
chore(nx): sync tsconfig
eliandoran Apr 24, 2025
a84744d
chore(nx): trigger client build when server is built
eliandoran Apr 24, 2025
13d9cb4
fix(nx/server): flaky run due to missing debug dependency
eliandoran Apr 24, 2025
258fe2e
fix(nx/server): missing images in dist
eliandoran Apr 24, 2025
ab2f0ee
fix(nx/server): disable chunking for prod
eliandoran Apr 24, 2025
6cd6043
chore(nx): update scripts
eliandoran Apr 24, 2025
d6f4b44
chore(nx): change data dir for server:start-prod
eliandoran Apr 24, 2025
494ee47
fix(nx/server): access to assets in prod
eliandoran Apr 24, 2025
cd14d8e
fix(nx/server): access to highlight.js styles
eliandoran Apr 24, 2025
f602a9f
chore(nx/desktop): run scripts
eliandoran Apr 24, 2025
6aef6df
chore(nx/desktop): copy client
eliandoran Apr 24, 2025
e3cff46
chore(nx/desktop): remove unnecessary dependencies & adapt scripts
eliandoran Apr 24, 2025
3ce4aa1
fix(nx/desktop): ejs missing
eliandoran Apr 24, 2025
e6f9d40
fix(nx/desktop): use proper approach for ejs missing
eliandoran Apr 24, 2025
aa68c70
chore(nx/server): remove logging
eliandoran Apr 24, 2025
aab545b
chore(nx/server): set proper resource dir when run from dist
eliandoran Apr 24, 2025
ec8740b
fix(nx/desktop): get dist to start by simplifying module import
eliandoran Apr 24, 2025
e819fac
fix(monorepo/server): missing dependencies to bettersqlite
eliandoran Apr 24, 2025
37a7cb6
chore(monorepo/desktop): improve run script
eliandoran Apr 24, 2025
e8095e8
chore(vscode): add NX console to recommended extensions
eliandoran Apr 24, 2025
7935b25
fix(monorepo/desktop): remote not working
eliandoran Apr 24, 2025
be79eb4
fix(monorepo/{client,server}): loading of fonts
eliandoran Apr 24, 2025
2681584
chore(monorepo/server): type error
eliandoran Apr 24, 2025
7adafdf
fix(monorepo/electron): tray icon
eliandoran Apr 24, 2025
12581a5
chore(monorepo/server): native dependencies
eliandoran Apr 24, 2025
12977f1
chore(nx): add server:start
eliandoran Apr 25, 2025
0e8b1f3
chore(nx/docker): basic integration
eliandoran Apr 25, 2025
b44876e
chore(nx/server): resource dir
eliandoran Apr 25, 2025
cc7d6de
chore(nx/docker): add entrypoint for starting docker
eliandoran Apr 25, 2025
422c169
chore(vscode): add docker to recommendations
eliandoran Apr 25, 2025
9ef24ef
chore(vscode): add yaml to recommendations
eliandoran Apr 25, 2025
a808f06
fix(nx/docker): wrong native for better-sqlite3
eliandoran Apr 25, 2025
b9a16c6
fix(nx/docker): wrong paths at app level
eliandoran Apr 25, 2025
9fc06c4
refactor(nx/docker): more cacheable installation
eliandoran Apr 25, 2025
73bfff3
fix(nx/docker): access to ETAPI
eliandoran Apr 25, 2025
76e43f3
chore(nx/server): sync dependencies
eliandoran Apr 25, 2025
db71c18
feat(nx/docker): bind port
eliandoran Apr 25, 2025
b63a5d3
fix(nx/docker): serving most assets
eliandoran Apr 25, 2025
d8ee579
fix(nx/docker): icon, manifest & robots.txt
eliandoran Apr 25, 2025
69f8540
fix(nx/docker): client-side translations
eliandoran Apr 25, 2025
8f26d4c
fix(nx/docker): LLM prompts not accessible
eliandoran Apr 25, 2025
506935b
fix(nx/forge): get forge command to execute
eliandoran Apr 25, 2025
4257da6
fix(nx/forge): get forge building to actually run
eliandoran Apr 25, 2025
457bf2b
chore(nx/server): get electron-forge up to "Finalizing package"
eliandoran Apr 25, 2025
997ed22
chore(nx/forge): templates not working
eliandoran Apr 25, 2025
b6b9ca1
chore(nx/forge): add strange workaround to solve node modules
eliandoran Apr 25, 2025
de4fc47
fix(nx/forge): setup icon
eliandoran Apr 25, 2025
adb6a7c
fix(nx/forge): nuspec failing due to missing meta
eliandoran Apr 25, 2025
6db093c
chore(nx): update gitignore
eliandoran Apr 25, 2025
dffbbee
chore(nx/forge): add package command
eliandoran Apr 25, 2025
aa388e0
chore(nx/forge): ignore a few unnecessary files
eliandoran Apr 25, 2025
e266b50
chore(nx/forge): fix prebuilds and build from dist
eliandoran Apr 26, 2025
ebb78e4
fix(nx/forge): serve assets from ASAR
eliandoran Apr 26, 2025
3122889
feat(nx/forge): reduce size of better-sqlite3
eliandoran Apr 26, 2025
82e98e5
fix(nx/forge): electron-forge:make not working
eliandoran Apr 26, 2025
b34d823
fix(nx/forge): app icons missing
eliandoran Apr 26, 2025
345e5cf
fix(nx/forge): path to electron-forge binaries
eliandoran Apr 26, 2025
379d482
fix(nx/server): incorrect normalize.css
eliandoran Apr 26, 2025
7a2b481
chore(nx/desktop): dedicated port
eliandoran Apr 26, 2025
880958e
fix(nx/forge): missing jquery-hotkeys
eliandoran Apr 26, 2025
bfb2ca5
fix(nx/forge): missing highlightjs
eliandoran Apr 26, 2025
81df2e7
refactor(nx/forge): typo
eliandoran Apr 26, 2025
251660e
chore(nx): restructure dependencies
eliandoran Apr 26, 2025
3890eff
chore(nx/client): reintegrate tests
eliandoran Apr 26, 2025
273af2d
chore(nx/client): set up pnpm for release
eliandoran Apr 26, 2025
76a6dec
chore(nx/ci): set up pnpm
eliandoran Apr 27, 2025
9f5d233
chore(nx/ci): set up pnpm install
eliandoran Apr 27, 2025
17e5a6e
chore(nx/ci):: workspace scripts
eliandoran Apr 27, 2025
5560691
chore(nx/ci):: run electron-forge:make
eliandoran Apr 27, 2025
8f5dc1a
chore(nx/ci):: fix glob
eliandoran Apr 27, 2025
c1a7b36
chore(nx/ci): fix some dependencies not being triggered
eliandoran Apr 27, 2025
edffe3a
chore(nx/ci): set client as implicit dependency for server
eliandoran Apr 27, 2025
54202c5
chore(nx/forge): try to fix .deb building
eliandoran Apr 27, 2025
d4b5f95
chore(nx/ci): fix wrong cache
eliandoran Apr 27, 2025
8377a80
chore(nx/forge): try setting more options to fix deb build
eliandoran Apr 27, 2025
1a92e48
chore(nx/forge): try setting more options to fix rpm build
eliandoran Apr 27, 2025
3bdd13f
chore(nx/forge): work on server packaging
eliandoran Apr 27, 2025
0784a71
chore(nx/forge): fix package not building server
eliandoran Apr 27, 2025
bf98d92
chore(nx/server): fix upload path
eliandoran Apr 27, 2025
dfdc93f
chore(nx/forge): missing license meta
eliandoran Apr 27, 2025
575f38e
chore(nx/forge): add some debug logging for env
eliandoran Apr 27, 2025
6e1b8ba
fix(nx/forge): missing apple id for signing
eliandoran Apr 27, 2025
543d615
feat(forge): bypass macos signing when building locally
eliandoran Apr 27, 2025
0080684
Revert "chore(nx/forge): add some debug logging for env"
eliandoran Apr 27, 2025
7cc2e04
fix(forge/macos): approve fs-xattr & macos-alias
eliandoran Apr 27, 2025
8c685e6
chore(nx/forge): try to force rebuild packages
eliandoran Apr 27, 2025
ceb4f20
chore(nx/forge): add debug logging for electron-rebuild
eliandoran Apr 27, 2025
fec9ca6
fix(nx/forge): rebuild not working due to ignore logic
eliandoran Apr 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
291 changes: 143 additions & 148 deletions .github/actions/build-electron/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,152 +18,147 @@ inputs:
runs:
using: composite
steps:
# Certificate setup
- name: Import Apple certificates
if: inputs.os == 'macos'
uses: apple-actions/import-codesign-certs@v5
with:
p12-file-base64: ${{ env.APPLE_APP_CERTIFICATE_BASE64 }}
p12-password: ${{ env.APPLE_APP_CERTIFICATE_PASSWORD }}
keychain: build-app-${{ github.run_id }}
keychain-password: ${{ github.run_id }}

- name: Install Installer certificate
if: inputs.os == 'macos'
uses: apple-actions/import-codesign-certs@v5
with:
p12-file-base64: ${{ env.APPLE_INSTALLER_CERTIFICATE_BASE64 }}
p12-password: ${{ env.APPLE_INSTALLER_CERTIFICATE_PASSWORD }}
keychain: build-installer-${{ github.run_id }}
keychain-password: ${{ github.run_id }}

- name: Verify certificates
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Available signing identities in app keychain:"
security find-identity -v -p codesigning build-app-${{ github.run_id }}.keychain

echo "Available signing identities in installer keychain:"
security find-identity -v -p codesigning build-installer-${{ github.run_id }}.keychain

# Make the keychains searchable
security list-keychains -d user -s build-app-${{ github.run_id }}.keychain build-installer-${{ github.run_id }}.keychain $(security list-keychains -d user | tr -d '"')
security default-keychain -s build-app-${{ github.run_id }}.keychain
security unlock-keychain -p ${{ github.run_id }} build-app-${{ github.run_id }}.keychain
security unlock-keychain -p ${{ github.run_id }} build-installer-${{ github.run_id }}.keychain
security set-keychain-settings -t 3600 -l build-app-${{ github.run_id }}.keychain
security set-keychain-settings -t 3600 -l build-installer-${{ github.run_id }}.keychain

- name: Set up Python and other macOS dependencies
if: ${{ inputs.os == 'macos' }}
shell: ${{ inputs.shell }}
run: |
brew install python-setuptools
brew install create-dmg

- name: Install dependencies for RPM and Flatpak package building
if: ${{ inputs.os == 'linux' }}
shell: ${{ inputs.shell }}
run: |
sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
FLATPAK_ARCH=$(if [[ ${{ inputs.arch }} = 'arm64' ]]; then echo 'aarch64'; else echo 'x86_64'; fi)
FLATPAK_VERSION='24.08'
flatpak install --user --no-deps --arch $FLATPAK_ARCH --assumeyes runtime/org.freedesktop.Platform/$FLATPAK_ARCH/$FLATPAK_VERSION runtime/org.freedesktop.Sdk/$FLATPAK_ARCH/$FLATPAK_VERSION org.electronjs.Electron2.BaseApp/$FLATPAK_ARCH/$FLATPAK_VERSION

# Build setup
- name: Install dependencies
shell: ${{ inputs.shell }}
run: npm ci

- name: Update build info
shell: ${{ inputs.shell }}
run: npm run chore:update-build-info

# Critical debugging configuration
- name: Run electron-forge build with enhanced logging
shell: ${{ inputs.shell }}
env:
# Pass through required environment variables for signing and notarization
APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }}
APPLE_ID: ${{ env.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
TRILIUM_ARTIFACT_NAME_HINT: TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}
run: npm run electron-forge:make -- --arch=${{ inputs.arch }} --platform=${{ inputs.forge_platform }}

# Add DMG signing step
- name: Sign DMG
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Signing DMG file..."
dmg_file=$(find ./dist -name "*.dmg" -print -quit)
if [ -n "$dmg_file" ]; then
echo "Found DMG: $dmg_file"
# Get the first valid signing identity from the keychain
SIGNING_IDENTITY=$(security find-identity -v -p codesigning build-app-${{ github.run_id }}.keychain | grep "Developer ID Application" | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$SIGNING_IDENTITY" ]; then
echo "Error: No valid Developer ID Application certificate found in keychain"
exit 1
fi
echo "Using signing identity: $SIGNING_IDENTITY"
# Sign the DMG
codesign --force --sign "$SIGNING_IDENTITY" --options runtime --timestamp "$dmg_file"
# Notarize the DMG
xcrun notarytool submit "$dmg_file" --apple-id "$APPLE_ID" --password "$APPLE_ID_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait
# Staple the notarization ticket
xcrun stapler staple "$dmg_file"
else
echo "No DMG found to sign"
fi

- name: Verify code signing
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Verifying code signing for all artifacts..."

# First check the .app bundle
echo "Looking for .app bundle..."
app_bundle=$(find ./dist -name "*.app" -print -quit)
if [ -n "$app_bundle" ]; then
echo "Found app bundle: $app_bundle"
echo "Verifying app bundle signing..."
codesign --verify --deep --strict --verbose=2 "$app_bundle"
echo "Displaying app bundle signing info..."
codesign --display --verbose=2 "$app_bundle"

echo "Checking entitlements..."
codesign --display --entitlements :- "$app_bundle"

echo "Checking notarization status..."
xcrun stapler validate "$app_bundle" || echo "Warning: App bundle not notarized yet"
else
echo "No .app bundle found to verify"
fi

# Then check DMG if it exists
echo "Looking for DMG..."
dmg_file=$(find ./dist -name "*.dmg" -print -quit)
if [ -n "$dmg_file" ]; then
echo "Found DMG: $dmg_file"
echo "Verifying DMG signing..."
codesign --verify --deep --strict --verbose=2 "$dmg_file"
echo "Displaying DMG signing info..."
codesign --display --verbose=2 "$dmg_file"

echo "Checking DMG notarization..."
xcrun stapler validate "$dmg_file" || echo "Warning: DMG not notarized yet"
else
echo "No DMG found to verify"
fi

# Finally check ZIP if it exists
echo "Looking for ZIP..."
zip_file=$(find ./dist -name "*.zip" -print -quit)
if [ -n "$zip_file" ]; then
echo "Found ZIP: $zip_file"
echo "Note: ZIP files are not code signed, but their contents should be"
# Certificate setup
- name: Import Apple certificates
if: inputs.os == 'macos'
uses: apple-actions/import-codesign-certs@v5
with:
p12-file-base64: ${{ env.APPLE_APP_CERTIFICATE_BASE64 }}
p12-password: ${{ env.APPLE_APP_CERTIFICATE_PASSWORD }}
keychain: build-app-${{ github.run_id }}
keychain-password: ${{ github.run_id }}

- name: Install Installer certificate
if: inputs.os == 'macos'
uses: apple-actions/import-codesign-certs@v5
with:
p12-file-base64: ${{ env.APPLE_INSTALLER_CERTIFICATE_BASE64 }}
p12-password: ${{ env.APPLE_INSTALLER_CERTIFICATE_PASSWORD }}
keychain: build-installer-${{ github.run_id }}
keychain-password: ${{ github.run_id }}

- name: Verify certificates
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Available signing identities in app keychain:"
security find-identity -v -p codesigning build-app-${{ github.run_id }}.keychain

echo "Available signing identities in installer keychain:"
security find-identity -v -p codesigning build-installer-${{ github.run_id }}.keychain

# Make the keychains searchable
security list-keychains -d user -s build-app-${{ github.run_id }}.keychain build-installer-${{ github.run_id }}.keychain $(security list-keychains -d user | tr -d '"')
security default-keychain -s build-app-${{ github.run_id }}.keychain
security unlock-keychain -p ${{ github.run_id }} build-app-${{ github.run_id }}.keychain
security unlock-keychain -p ${{ github.run_id }} build-installer-${{ github.run_id }}.keychain
security set-keychain-settings -t 3600 -l build-app-${{ github.run_id }}.keychain
security set-keychain-settings -t 3600 -l build-installer-${{ github.run_id }}.keychain

- name: Set up Python and other macOS dependencies
if: ${{ inputs.os == 'macos' }}
shell: ${{ inputs.shell }}
run: |
brew install python-setuptools
brew install create-dmg

- name: Install dependencies for RPM and Flatpak package building
if: ${{ inputs.os == 'linux' }}
shell: ${{ inputs.shell }}
run: |
sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
FLATPAK_ARCH=$(if [[ ${{ inputs.arch }} = 'arm64' ]]; then echo 'aarch64'; else echo 'x86_64'; fi)
FLATPAK_VERSION='24.08'
flatpak install --user --no-deps --arch $FLATPAK_ARCH --assumeyes runtime/org.freedesktop.Platform/$FLATPAK_ARCH/$FLATPAK_VERSION runtime/org.freedesktop.Sdk/$FLATPAK_ARCH/$FLATPAK_VERSION org.electronjs.Electron2.BaseApp/$FLATPAK_ARCH/$FLATPAK_VERSION

- name: Update build info
shell: ${{ inputs.shell }}
run: npm run chore:update-build-info

# Critical debugging configuration
- name: Run electron-forge build with enhanced logging
shell: ${{ inputs.shell }}
env:
# Pass through required environment variables for signing and notarization
APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }}
APPLE_ID: ${{ env.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
TRILIUM_ARTIFACT_NAME_HINT: TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}
run: pnpm nx --project=@triliumnext/desktop electron-forge:make -- --arch=${{ inputs.arch }} --platform=${{ inputs.forge_platform }}

# Add DMG signing step
- name: Sign DMG
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Signing DMG file..."
dmg_file=$(find ./apps/desktop/dist -name "*.dmg" -print -quit)
if [ -n "$dmg_file" ]; then
echo "Found DMG: $dmg_file"
# Get the first valid signing identity from the keychain
SIGNING_IDENTITY=$(security find-identity -v -p codesigning build-app-${{ github.run_id }}.keychain | grep "Developer ID Application" | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$SIGNING_IDENTITY" ]; then
echo "Error: No valid Developer ID Application certificate found in keychain"
exit 1
fi
echo "Using signing identity: $SIGNING_IDENTITY"
# Sign the DMG
codesign --force --sign "$SIGNING_IDENTITY" --options runtime --timestamp "$dmg_file"
# Notarize the DMG
xcrun notarytool submit "$dmg_file" --apple-id "$APPLE_ID" --password "$APPLE_ID_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait
# Staple the notarization ticket
xcrun stapler staple "$dmg_file"
else
echo "No DMG found to sign"
fi

- name: Verify code signing
if: inputs.os == 'macos'
shell: ${{ inputs.shell }}
run: |
echo "Verifying code signing for all artifacts..."

# First check the .app bundle
echo "Looking for .app bundle..."
app_bundle=$(find ./apps/desktop/dist -name "*.app" -print -quit)
if [ -n "$app_bundle" ]; then
echo "Found app bundle: $app_bundle"
echo "Verifying app bundle signing..."
codesign --verify --deep --strict --verbose=2 "$app_bundle"
echo "Displaying app bundle signing info..."
codesign --display --verbose=2 "$app_bundle"

echo "Checking entitlements..."
codesign --display --entitlements :- "$app_bundle"

echo "Checking notarization status..."
xcrun stapler validate "$app_bundle" || echo "Warning: App bundle not notarized yet"
else
echo "No .app bundle found to verify"
fi

# Then check DMG if it exists
echo "Looking for DMG..."
dmg_file=$(find ./apps/desktop/dist -name "*.dmg" -print -quit)
if [ -n "$dmg_file" ]; then
echo "Found DMG: $dmg_file"
echo "Verifying DMG signing..."
codesign --verify --deep --strict --verbose=2 "$dmg_file"
echo "Displaying DMG signing info..."
codesign --display --verbose=2 "$dmg_file"

echo "Checking DMG notarization..."
xcrun stapler validate "$dmg_file" || echo "Warning: DMG not notarized yet"
else
echo "No DMG found to verify"
fi

# Finally check ZIP if it exists
echo "Looking for ZIP..."
zip_file=$(find ./apps/desktop/dist -name "*.zip" -print -quit)
if [ -n "$zip_file" ]; then
echo "Found ZIP: $zip_file"
echo "Note: ZIP files are not code signed, but their contents should be"
fi
45 changes: 23 additions & 22 deletions .github/actions/build-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ inputs:
runs:
using: composite
steps:
- name: Set up node & dependencies
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- name: Install dependencies
shell: bash
run: npm ci
- name: Run Linux server build
env:
MATRIX_ARCH: ${{ inputs.arch }}
shell: bash
run: |
npm run chore:update-build-info
./bin/build-server.sh
- name: Prepare artifacts
shell: bash
run: |
mkdir -p upload
file=$(find dist -name '*.tar.xz' -print -quit)
name=${{ github.ref_name }}
cp "$file" "upload/TriliumNextNotes-Server-${name//\//-}-${{ inputs.os }}-${{ inputs.arch }}.tar.xz"
- uses: pnpm/action-setup@v4
- name: Set up node & dependencies
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: Run Linux server build
env:
MATRIX_ARCH: ${{ inputs.arch }}
shell: bash
run: |
pnpm run chore:update-build-info
pnpm nx --project=@triliumnext/server package
- name: Prepare artifacts
shell: bash
run: |
mkdir -p upload
file=$(find ./apps/server/out -name '*.tar.xz' -print -quit)
name=${{ github.ref_name }}
cp "$file" "upload/TriliumNextNotes-Server-${name//\//-}-${{ inputs.os }}-${{ inputs.arch }}.tar.xz"
Loading
Loading