mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(nx/forge): work on server packaging
This commit is contained in:
parent
1a92e489d9
commit
3bdd13fa44
4
.github/actions/build-server/action.yml
vendored
4
.github/actions/build-server/action.yml
vendored
@ -22,8 +22,8 @@ runs:
|
||||
MATRIX_ARCH: ${{ inputs.arch }}
|
||||
shell: bash
|
||||
run: |
|
||||
npm run chore:update-build-info
|
||||
npm run server:package
|
||||
pnpm run chore:update-build-info
|
||||
pnpm nx --project=@triliumnext/server package
|
||||
- name: Prepare artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -27,7 +27,6 @@
|
||||
"start": "cross-env nodemon src/main.ts",
|
||||
"test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./spec/data TRILIUM_INTEGRATION_TEST=memory vitest",
|
||||
"coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./spec/data TRILIUM_INTEGRATION_TEST=memory vitest --coverage",
|
||||
"package": "bash ./scripts/build-server.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
|
@ -146,6 +146,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
"dependsOn": [ "^build" ],
|
||||
"command": "bash apps/server/scripts/build-server.sh"
|
||||
},
|
||||
"docker-build": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
|
@ -23,17 +23,9 @@ echo "Selected Arch: $ARCH"
|
||||
# Set Node.js version and architecture-specific filename
|
||||
NODE_VERSION=22.14.0
|
||||
|
||||
BUILD_DIR="./build"
|
||||
DIST_DIR="./dist"
|
||||
CLEANUP_SCRIPT="./scripts/cleanupNodeModules.ts"
|
||||
|
||||
# Trigger the build
|
||||
echo "Build start"
|
||||
npm run build:prepare-dist
|
||||
echo "Build finished"
|
||||
|
||||
# pruning of unnecessary files and devDeps in node_modules
|
||||
node --experimental-strip-types $CLEANUP_SCRIPT $BUILD_DIR
|
||||
script_dir=$(realpath $(dirname $0))
|
||||
BUILD_DIR="$script_dir/../dist"
|
||||
DIST_DIR="$script_dir/../out"
|
||||
|
||||
NODE_FILENAME=node-v${NODE_VERSION}-linux-${ARCH}
|
||||
|
||||
@ -54,12 +46,8 @@ rm -rf $BUILD_DIR/node/lib/node_modules/{npm,corepack} \
|
||||
printf "#!/bin/sh\n./node/bin/node src/main\n" > $BUILD_DIR/trilium.sh
|
||||
chmod 755 $BUILD_DIR/trilium.sh
|
||||
|
||||
# TriliumNextTODO: is this still required? If yes → move to copy-dist/copy-trilium
|
||||
cp tpl/anonymize-database.sql $BUILD_DIR/
|
||||
|
||||
VERSION=`jq -r ".version" package.json`
|
||||
|
||||
|
||||
ARCHIVE_NAME="TriliumNextNotes-Server-${VERSION}-linux-${ARCH}"
|
||||
echo "Creating Archive $ARCHIVE_NAME..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user