mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(monorepo/server): building the server
This commit is contained in:
parent
37bf7c2bfb
commit
402da5df87
44
.github/actions/build-server/action.yml
vendored
44
.github/actions/build-server/action.yml
vendored
@ -8,25 +8,25 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Set up node & dependencies
|
- name: Set up node & dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run Linux server build
|
- name: Run Linux server build
|
||||||
env:
|
env:
|
||||||
MATRIX_ARCH: ${{ inputs.arch }}
|
MATRIX_ARCH: ${{ inputs.arch }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
npm run chore:update-build-info
|
npm run chore:update-build-info
|
||||||
./bin/build-server.sh
|
npm run package
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p upload
|
mkdir -p upload
|
||||||
file=$(find dist -name '*.tar.xz' -print -quit)
|
file=$(find dist -name '*.tar.xz' -print -quit)
|
||||||
name=${{ github.ref_name }}
|
name=${{ github.ref_name }}
|
||||||
cp "$file" "upload/TriliumNextNotes-Server-${name//\//-}-${{ inputs.os }}-${{ inputs.arch }}.tar.xz"
|
cp "$file" "upload/TriliumNextNotes-Server-${name//\//-}-${{ inputs.os }}-${{ inputs.arch }}.tar.xz"
|
||||||
|
@ -25,7 +25,7 @@ NODE_VERSION=22.14.0
|
|||||||
|
|
||||||
BUILD_DIR="./build"
|
BUILD_DIR="./build"
|
||||||
DIST_DIR="./dist"
|
DIST_DIR="./dist"
|
||||||
CLEANUP_SCRIPT="./bin/cleanupNodeModules.ts"
|
CLEANUP_SCRIPT="./scripts/cleanupNodeModules.ts"
|
||||||
|
|
||||||
|
|
||||||
# Trigger the build
|
# Trigger the build
|
||||||
|
@ -31,13 +31,6 @@ function main() {
|
|||||||
|
|
||||||
function cleanupNodeModules(basePath: string, pruneDevDeps: boolean = true) {
|
function cleanupNodeModules(basePath: string, pruneDevDeps: boolean = true) {
|
||||||
|
|
||||||
// This needs to run for the server and Docker build,
|
|
||||||
// but needs to be skipped for electron-forge: its
|
|
||||||
// built-in pruning takes care of it already
|
|
||||||
if (pruneDevDeps) {
|
|
||||||
execSync(`npm ci --omit=dev --prefix ${basePath}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const nodeModulesDirPath = path.join(basePath, "node_modules");
|
const nodeModulesDirPath = path.join(basePath, "node_modules");
|
||||||
const nodeModulesContent = fs.readdirSync(nodeModulesDirPath, { recursive: true, withFileTypes: true });
|
const nodeModulesContent = fs.readdirSync(nodeModulesDirPath, { recursive: true, withFileTypes: true });
|
||||||
//const libDir = fs.readdirSync(path.join(basePath, "./libraries"), { recursive: true, withFileTypes: true });
|
//const libDir = fs.readdirSync(path.join(basePath, "./libraries"), { recursive: true, withFileTypes: true });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user