Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
318808f
chore(monorepo): move everything into subdirectory for easy diffing
eliandoran Apr 17, 2025
a3cfef2
chore(monorepo): prepare basic structure
eliandoran Apr 17, 2025
4aad055
chore(monorepo): set up package.json for client
eliandoran Apr 17, 2025
de2cdd5
chore(monorepo): relocate client files
eliandoran Apr 17, 2025
6b62bde
chore(monorepo): relocate webpack dependencies
eliandoran Apr 17, 2025
3021449
chore(monorepo): get webpack to run something
eliandoran Apr 17, 2025
5b28e30
fix(monorepo): remove profiling which was masking errors
eliandoran Apr 17, 2025
a446e9c
fix(monorepo/client): errors due to missing dependencies
eliandoran Apr 17, 2025
2793f48
chore(monorepo/client): update package-lock
eliandoran Apr 17, 2025
25160a2
Merge remote-tracking branch 'origin/develop' into feature/client_ser…
eliandoran Apr 17, 2025
42744ac
chore(monorepo/client): set up commons package
eliandoran Apr 17, 2025
011c859
chore(monorepo/client): set up some common dependencies
eliandoran Apr 18, 2025
1b24207
fix(monorepo/client): error related to blobs
eliandoran Apr 18, 2025
6b73ec4
chore(monorepo/client): group more data types into commons
eliandoran Apr 18, 2025
28a319b
chore(monorepo/client): allow top-level await
eliandoran Apr 18, 2025
17c7d7d
fix(monorepo/client): missing electron remote dep
eliandoran Apr 18, 2025
c02a006
chore(monorepo/client): solve some type errors
eliandoran Apr 18, 2025
920e1db
chore(monorepo/client): solve some import errors
eliandoran Apr 18, 2025
13a6fef
fix(monorepo/client): errors in type definition
eliandoran Apr 18, 2025
fe87889
chore(monorepo/client): various type errors
eliandoran Apr 18, 2025
04e51bd
fix(monorepo/client): missing CSS loader
eliandoran Apr 18, 2025
e327c91
fix(monorepo/client): wrong data type for autocomplete
eliandoran Apr 18, 2025
470e443
chore(monorepo/client): integrate test support
eliandoran Apr 18, 2025
bb4cf44
chore(monorepo/client): add back stylesheets
eliandoran Apr 18, 2025
b109e7d
chore(monorepo/client): add eslint
eliandoran Apr 18, 2025
c4b7f6f
chore(monorepo/client): CKEditor-related type errors
eliandoran Apr 18, 2025
1542c4f
chore(monorepo/client): missing eslint dependency
eliandoran Apr 18, 2025
dd3982e
chore(monorepo/client): missing script-loader declaration
eliandoran Apr 18, 2025
059e617
chore(monorepo/client): type error in library loader
eliandoran Apr 18, 2025
8bcea01
chore(monorepo/client): missing provider in vitest config
eliandoran Apr 18, 2025
9a2cd6b
chore(monorepo/server): create package.json
eliandoran Apr 18, 2025
da41b95
chore(monorepo/server): integrate type definitions
eliandoran Apr 18, 2025
5058891
chore(monorepo/server): move server-side source code
eliandoran Apr 18, 2025
4185b2d
chore(monorepo/server): specify dependencies
eliandoran Apr 18, 2025
872d868
chore(monorepo/server): add more libraries & their types
eliandoran Apr 18, 2025
816355d
chore(monorepo/server): keyboard-actions
eliandoran Apr 18, 2025
0c5a678
chore(monorepo/server): trimindentation import
eliandoran Apr 18, 2025
a59954e
chore(monorepo/server): rows import
eliandoran Apr 18, 2025
04594ed
chore(monorepo/server): revert imports to share rows
eliandoran Apr 18, 2025
ad8b775
chore(monorepo/server): fix imports for options_interface
eliandoran Apr 18, 2025
b0e9785
chore(monorepo/server): fix imports for hidden subtree
eliandoran Apr 18, 2025
3ddc8e5
chore(monorepo/server): fix imports for becca mocking
eliandoran Apr 18, 2025
fc228ca
chore(monorepo/server): integrate turndown-plugin-gfm
eliandoran Apr 18, 2025
f6d095f
chore(monorepo/server): fix error due to express types
eliandoran Apr 18, 2025
1861d15
chore(monorepo): update package lock
eliandoran Apr 18, 2025
8d6194f
chore(monorepo/server): serve client staticly
eliandoran Apr 18, 2025
fa49f8a
chore(monorepo/server): fix most dependency issues
eliandoran Apr 18, 2025
ea13565
chore(monorepo/server): fix error due to markdown-gfm
eliandoran Apr 18, 2025
4b109c1
chore(monorepo/server): missing initialization data
eliandoran Apr 18, 2025
4ef4b84
chore(monorepo/server): missing swagger-ui-express
eliandoran Apr 18, 2025
7f5154a
chore(monorepo/server): get favicon to work
eliandoran Apr 18, 2025
04b89da
chore(monorepo/server): add assets temporarily in order to start
eliandoran Apr 18, 2025
f95f2e1
fix(monorepo/server): get app assets to be served
eliandoran Apr 18, 2025
2af9a9a
fix(monorepo/server): serve stylesheets
eliandoran Apr 18, 2025
1af338b
fix(monorepo/server): app-dist (as requested by webpack) on dev mode
eliandoran Apr 18, 2025
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
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: 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 ./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
44 changes: 22 additions & 22 deletions .github/actions/build-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ 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"
- 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
npm run server:package
- name: Prepare artifacts
shell: bash
run: |
mkdir -p upload
file=$(find ./apps/server/dist -name '*.tar.xz' -print -quit)
name=${{ github.ref_name }}
cp "$file" "upload/TriliumNextNotes-Server-${name//\//-}-${{ inputs.os }}-${{ inputs.arch }}.tar.xz"
3 changes: 0 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ jobs:

- run: npm ci

- name: Run the TypeScript build
run: npx tsc

- name: Run the unit tests
run: npm run test

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: npx playwright install --with-deps

- name: Run the TypeScript build
run: npx tsc
run: npm run build

- name: Build and export to Docker
uses: docker/build-push-action@v6
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
node-version: 22
- name: Install dependencies
run: npm ci
run: npm i
- name: Update nightly version
run: npm run chore:ci-update-nightly-version
- name: Run the build
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
prerelease: true
draft: false
fail_on_unmatched_files: true
files: upload/*.*
files: apps/desktop/upload/*.*
tag_name: nightly
name: Nightly Build

Expand All @@ -82,7 +82,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
with:
name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}
path: upload
path: apps/desktop/upload

nightly-server:
name: Deploy server nightly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: release-desktop-${{ matrix.os.name }}-${{ matrix.arch }}
path: upload/*.*
path: apps/desktop/upload/*.*

build_server:
name: Build Linux Server
Expand Down
Loading
Loading