mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
ci: Trim FE package.json files before publishing (no-changelog)
This commit is contained in:
parent
9cfe5e3c66
commit
1b4247498b
3
.github/workflows/release-publish.yml
vendored
3
.github/workflows/release-publish.yml
vendored
|
@ -39,7 +39,8 @@ jobs:
|
|||
- name: Publish to NPM
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
||||
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc
|
||||
node scripts/trim-fe-packageJson.js
|
||||
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
|
||||
npm dist-tag rm n8n rc
|
||||
|
||||
- name: Create a Release on GitHub
|
||||
|
|
|
@ -16,8 +16,7 @@ RUN pnpm install --frozen-lockfile
|
|||
RUN pnpm build
|
||||
RUN rm -rf node_modules
|
||||
RUN jq 'del(.pnpm.patchedDependencies)' package.json > package.json.tmp; mv package.json.tmp package.json
|
||||
RUN jq '{name: .name, version: .version}' packages/editor-ui/package.json > editor-ui.tmp; mv editor-ui.tmp packages/editor-ui/package.json
|
||||
RUN jq '{name: .name, version: .version}' packages/design-system/package.json > design-system.tmp; mv design-system.tmp packages/design-system/package.json
|
||||
RUN node scripts/trim-fe-packageJson.js
|
||||
RUN NODE_ENV=production pnpm install --prod --no-optional
|
||||
RUN find . -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" -o -name "tsconfig.json" -o -name "*.tsbuildinfo" | xargs rm -rf
|
||||
RUN rm -rf packages/@n8n_io/eslint-config packages/editor-ui/src packages/editor-ui/node_modules packages/design-system
|
||||
|
|
|
@ -15,6 +15,8 @@ RUN set -eux; \
|
|||
case "$apkArch" in \
|
||||
'armv7') apk del build-dependencies;; \
|
||||
esac && \
|
||||
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-design-system && \
|
||||
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/node_modules && \
|
||||
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm && \
|
||||
rm -rf /root/.npm
|
||||
|
||||
|
|
12
scripts/trim-fe-packageJson.js
Normal file
12
scripts/trim-fe-packageJson.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const { writeFileSync } = require('fs')
|
||||
const { resolve } = require('path');
|
||||
const baseDir = resolve(__dirname, '..');
|
||||
|
||||
const trimPackageJson = (packageName) => {
|
||||
const filePath = resolve(baseDir, 'packages', packageName, 'package.json');
|
||||
const { scripts, peerDependencies, devDependencies, dependencies, ...packageJson } = require(filePath);
|
||||
writeFileSync(filePath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
|
||||
}
|
||||
|
||||
trimPackageJson('design-system')
|
||||
trimPackageJson('editor-ui')
|
Loading…
Reference in a new issue