diff --git a/.github/actions/build-server/action.yml b/.github/actions/build-server/action.yml index 13984e2ce..3728d9020 100644 --- a/.github/actions/build-server/action.yml +++ b/.github/actions/build-server/action.yml @@ -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 package + - 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" diff --git a/apps/server/scripts/build-server.sh b/apps/server/scripts/build-server.sh index 93102737c..1065bd8f6 100644 --- a/apps/server/scripts/build-server.sh +++ b/apps/server/scripts/build-server.sh @@ -25,7 +25,7 @@ NODE_VERSION=22.14.0 BUILD_DIR="./build" DIST_DIR="./dist" -CLEANUP_SCRIPT="./bin/cleanupNodeModules.ts" +CLEANUP_SCRIPT="./scripts/cleanupNodeModules.ts" # Trigger the build diff --git a/apps/server/scripts/cleanupNodeModules.ts b/apps/server/scripts/cleanupNodeModules.ts index bb3e90331..bb53fb9e3 100644 --- a/apps/server/scripts/cleanupNodeModules.ts +++ b/apps/server/scripts/cleanupNodeModules.ts @@ -31,13 +31,6 @@ function main() { 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 nodeModulesContent = fs.readdirSync(nodeModulesDirPath, { recursive: true, withFileTypes: true }); //const libDir = fs.readdirSync(path.join(basePath, "./libraries"), { recursive: true, withFileTypes: true });