Skip to content

Commit 6648af4

Browse files
committed
ci: Trim FE package.json files before publishing (no-changelog)
1 parent 9cfe5e3 commit 6648af4

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.github/workflows/release-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ jobs:
3737
run: pnpm build
3838

3939
- name: Publish to NPM
40+
env:
41+
NPM_CONFIG_PROVENANCE: true
4042
run: |
4143
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
42-
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc
44+
node scripts/trim-fe-packageJson.js
45+
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
4346
npm dist-tag rm n8n rc
4447
4548
- name: Create a Release on GitHub

docker/images/n8n-custom/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ RUN pnpm install --frozen-lockfile
1616
RUN pnpm build
1717
RUN rm -rf node_modules
1818
RUN jq 'del(.pnpm.patchedDependencies)' package.json > package.json.tmp; mv package.json.tmp package.json
19-
RUN jq '{name: .name, version: .version}' packages/editor-ui/package.json > editor-ui.tmp; mv editor-ui.tmp packages/editor-ui/package.json
20-
RUN jq '{name: .name, version: .version}' packages/design-system/package.json > design-system.tmp; mv design-system.tmp packages/design-system/package.json
19+
RUN node scripts/trim-fe-packageJson.js
2120
RUN NODE_ENV=production pnpm install --prod --no-optional
2221
RUN find . -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" -o -name "tsconfig.json" -o -name "*.tsbuildinfo" | xargs rm -rf
2322
RUN rm -rf packages/@n8n_io/eslint-config packages/editor-ui/src packages/editor-ui/node_modules packages/design-system

docker/images/n8n/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN set -eux; \
1515
case "$apkArch" in \
1616
'armv7') apk del build-dependencies;; \
1717
esac && \
18+
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-design-system && \
19+
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/node_modules && \
1820
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm && \
1921
rm -rf /root/.npm
2022

scripts/trim-fe-packageJson.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { writeFileSync } = require('fs')
2+
const { resolve } = require('path');
3+
const baseDir = resolve(__dirname, '..');
4+
5+
const trimPackageJson = (packageName) => {
6+
const filePath = resolve(baseDir, 'packages', packageName, 'package.json');
7+
const { scripts, peerDependencies, devDependencies, dependencies, ...packageJson } = require(filePath);
8+
writeFileSync(filePath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
9+
}
10+
11+
trimPackageJson('design-system')
12+
trimPackageJson('editor-ui')

0 commit comments

Comments
 (0)