Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 043313c

Browse files
committed
Merge branch 'feature/update_electron' into feature/update_bettersqlite3
2 parents 946a02f + 62804ec commit 043313c

26 files changed

+8405
-17606
lines changed

.github/workflows/dev.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Dev
22
on:
33
push:
4+
branches-ignore:
5+
- 'develop'
6+
- 'feature/update**'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
412
jobs:
513
build_docker:
614
name: Build Docker image

.github/workflows/main.yml

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ on:
33
push:
44
branches:
55
- 'develop'
6+
- 'feature/update*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
612
env:
713
REGISTRY: ghcr.io
814
IMAGE_NAME: ${{ github.repository }}
15+
916
jobs:
1017
build_darwin-x64:
1118
name: Build macOS x86_64
@@ -18,7 +25,9 @@ jobs:
1825
node-version: 20
1926
cache: "npm"
2027
- run: npm ci
21-
- run: ./bin/build-mac-x64.sh
28+
- run: |
29+
npm run update-build-info
30+
./bin/build-mac-x64.sh
2231
- uses: actions/upload-artifact@v4
2332
with:
2433
name: trilium-mac-x64.zip
@@ -34,7 +43,9 @@ jobs:
3443
node-version: 20
3544
cache: "npm"
3645
- run: npm ci
37-
- run: ./bin/build-mac-arm64.sh
46+
- run: |
47+
npm run update-build-info
48+
./bin/build-mac-arm64.sh
3849
- uses: actions/upload-artifact@v4
3950
with:
4051
name: trilium-mac-arm64.zip
@@ -50,7 +61,9 @@ jobs:
5061
node-version: 20
5162
cache: "npm"
5263
- run: npm ci
53-
- run: ./bin/build-linux-x64.sh
64+
- run: |
65+
npm run update-build-info
66+
./bin/build-linux-x64.sh
5467
- uses: actions/upload-artifact@v4
5568
with:
5669
name: trilium-linux-x64.tar.xz
@@ -70,7 +83,9 @@ jobs:
7083
node-version: 20
7184
cache: "npm"
7285
- run: npm ci
73-
- run: ./bin/build-server.sh
86+
- run: |
87+
npm run update-build-info
88+
./bin/build-server.sh
7489
- uses: actions/upload-artifact@v4
7590
with:
7691
name: trilium-linux-x64-server.tar.xz
@@ -93,11 +108,33 @@ jobs:
93108
node-version: 20
94109
cache: "npm"
95110
- run: npm ci
96-
- run: ./bin/build-win-x64.sh
111+
- run: |
112+
npm run update-build-info
113+
./bin/build-win-x64.sh DONTPACK
97114
- uses: actions/upload-artifact@v4
98115
with:
99-
name: trilium-windows-x64.zip
100-
path: dist/trilium-windows-x64-*.zip
116+
name: trilium-windows-x64
117+
path: dist/trilium-windows-x64
118+
build_windows-installer:
119+
name: Build Windows x86_64 (Setup)
120+
runs-on: windows-latest
121+
steps:
122+
- uses: actions/checkout@v4
123+
- name: Set up node & dependencies
124+
uses: actions/setup-node@v4
125+
with:
126+
node-version: 20
127+
cache: "npm"
128+
- run: npm ci
129+
- name: Run installer build
130+
run: |
131+
npm run update-build-info
132+
npm run make-electron
133+
- name: Publish installer artifact
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: TriliumNext Notes for Windows (Setup)
137+
path: out/make/squirrel.windows/x64/*.exe
101138
build_docker:
102139
name: Build Docker image
103140
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ data/
1515
data-test/
1616
tmp/
1717
.eslintcache
18+
19+
out/

bin/build-linux-x64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ echo "Packaging linux x64 electron build"
3535
BUILD_DIR=./dist/trilium-linux-x64
3636
rm -rf "$BUILD_DIR"
3737

38-
mv "./dist/Trilium Notes-linux-x64" "$BUILD_DIR"
38+
mv "./dist/TriliumNext Notes-linux-x64" "$BUILD_DIR"
3939

4040
cp images/app-icons/png/128x128.png "$BUILD_DIR"/icon.png
4141
cp bin/tpl/anonymize-database.sql "$BUILD_DIR"/

bin/build-mac-arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BUILD_DIR=./dist/trilium-mac-arm64
2121
rm -rf $BUILD_DIR
2222

2323
# Mac build has by default useless directory level
24-
mv "./dist/Trilium Notes-darwin-arm64" $BUILD_DIR
24+
mv "./dist/TriliumNext Notes-darwin-arm64" $BUILD_DIR
2525

2626
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
2727

bin/build-mac-x64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BUILD_DIR=./dist/trilium-mac-x64
2121
rm -rf $BUILD_DIR
2222

2323
# Mac build has by default useless directory level
24-
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
24+
mv "./dist/TriliumNext Notes-darwin-x64" $BUILD_DIR
2525

2626
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
2727

bin/build-win-x64.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo "Packaging windows x64 electron build"
2525
BUILD_DIR=./dist/trilium-windows-x64
2626
rm -rf $BUILD_DIR
2727

28-
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
28+
mv "./dist/TriliumNext Notes-win32-x64" $BUILD_DIR
2929

3030
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
3131

@@ -34,9 +34,11 @@ rm -rf $BUILD_DIR/dump-db/node_modules
3434

3535
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.bat $BUILD_DIR/
3636

37-
echo "Zipping windows x64 electron distribution..."
38-
VERSION=`jq -r ".version" package.json`
39-
40-
cd dist
37+
if [ "$1" != "DONTPACK" ]
38+
then
39+
echo "Zipping windows x64 electron distribution..."
40+
VERSION=`jq -r ".version" package.json`
4141

42-
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
42+
cd dist
43+
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
44+
fi

bin/copy-trilium.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,36 @@ for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample
3535
cp "$f" "$DIR"/
3636
done
3737

38+
# Patch package.json main
39+
sed -i 's/.\/dist\/electron.js/electron.js/g' "$DIR/package.json"
40+
3841
script_dir=$(realpath $(dirname $0))
39-
cp -Rv "$script_dir/../build/src" "$DIR"
42+
cp -R "$script_dir/../build/src" "$DIR"
4043
cp "$script_dir/../build/electron.js" "$DIR"
4144

4245
# run in subshell (so we return to original dir)
43-
(cd $DIR && npm install --only=prod)
44-
(cd $DIR && npm run switch-electron)
46+
(cd $DIR && npm install --omit=dev)
4547

4648
if [[ -d "$DIR"/node_modules ]]; then
47-
# cleanup of useless files in dependencies
48-
for d in 'image-q/demo' 'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
49-
[[ -e "$DIR"/node_modules/"$d" ]] && rm -rv "$DIR"/node_modules/"$d"
49+
# cleanup of useless files in dependencies
50+
for d in 'image-q/demo' \
51+
'@excalidraw/excalidraw/dist/excalidraw-assets-dev' '@excalidraw/excalidraw/dist/excalidraw.development.js' '@excalidraw/excalidraw/dist/excalidraw-with-preact.development.js' \
52+
'mermaid/dist/mermaid.js' \
53+
'boxicons/svg' 'boxicons/node_modules/react'/* \
54+
'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' 'better-sqlite3/deps/sqlite3' \
55+
'@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
56+
[[ -e "$DIR"/node_modules/"$d" ]] && rm -r "$DIR"/node_modules/"$d"
5057
done
5158

52-
# delete all tests (there are often large images as test file for jimp etc.)
53-
for d in 'test' 'docs' 'demo'; do
54-
find "$DIR"/node_modules -name "$d" -exec rm -rf {} \;
59+
# delete all tests (there are often large images as test file for jimp etc.)
60+
for d in 'test' 'docs' 'demo' 'example'; do
61+
find "$DIR"/node_modules -name "$d" -exec rm -rf {} +
5562
done
5663
fi
5764

5865
find $DIR/libraries -name "*.map" -type f -delete
66+
find $DIR/node_modules -name "*.map" -type f -delete
67+
find $DIR -name "*.ts" -type f -delete
5968

6069
d="$DIR"/src/public
6170
[[ -d "$d"/app-dist ]] || mkdir -pv "$d"/app-dist
File renamed without changes.

bin/docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
output
2+
.env

0 commit comments

Comments
 (0)