From 442e68283df296ca097684be04049f6d660e54ef Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Fri, 13 Oct 2023 23:59:30 +0530 Subject: [PATCH] chore: distrowise build scripts --- package.json | 5 +++++ packages/bruno-electron/package.json | 6 +++++- scripts/build-electron.sh | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9778c116..33a339ed 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,11 @@ "dev:electron": "npm run dev --workspace=packages/bruno-electron", "build:bruno-query": "npm run build --workspace=packages/bruno-query", "build:graphql-docs": "npm run build --workspace=packages/bruno-graphql-docs", + "build:electron:mac": "./scripts/build-electron.sh mac", + "build:electron:win": "./scripts/build-electron.sh win", + "build:electron:linux": "./scripts/build-electron.sh linux", + "build:electron:deb": "./scripts/build-electron.sh deb", + "build:electron:rpm": "./scripts/build-electron.sh rpm", "build:electron:snap": "./scripts/build-electron.sh snap", "test:e2e": "npx playwright test", "test:report": "npx playwright show-report", diff --git a/packages/bruno-electron/package.json b/packages/bruno-electron/package.json index 4df39991..ffe266f3 100644 --- a/packages/bruno-electron/package.json +++ b/packages/bruno-electron/package.json @@ -9,7 +9,11 @@ "scripts": { "clean": "rimraf dist", "dev": "electron .", - "dist": "electron-builder --mac --config electron-builder-config.js", + "dist:mac": "electron-builder --mac --config electron-builder-config.js", + "dist:win": "electron-builder --win --config electron-builder-config.js", + "dist:linux": "electron-builder --linux AppImage --config electron-builder-config.js", + "dist:deb": "electron-builder --linux deb --config electron-builder-config.js", + "dist:rpm": "electron-builder --linux rpm --config electron-builder-config.js", "dist:snap": "electron-builder --linux snap --config electron-builder-config.js", "pack": "electron-builder --dir", "test": "jest" diff --git a/scripts/build-electron.sh b/scripts/build-electron.sh index a56b3bcc..7afb3c54 100755 --- a/scripts/build-electron.sh +++ b/scripts/build-electron.sh @@ -22,6 +22,21 @@ find packages/bruno-electron/web -name '*.map' -type f -delete if [ "$1" == "snap" ]; then echo "Building snap distribution" npm run dist:snap --workspace=packages/bruno-electron +elif [ "$1" == "mac" ]; then + echo "Building mac distribution" + npm run dist:mac --workspace=packages/bruno-electron +elif [ "$1" == "win" ]; then + echo "Building windows distribution" + npm run dist:win --workspace=packages/bruno-electron +elif [ "$1" == "deb" ]; then + echo "Building debian distribution" + npm run dist:deb --workspace=packages/bruno-electron +elif [ "$1" == "rpm" ]; then + echo "Building rpm distribution" + npm run dist:rpm --workspace=packages/bruno-electron +elif [ "$1" == "linux" ]; then + echo "Building linux distribution" + npm run dist:linux --workspace=packages/bruno-electron else echo "Please pass a build distribution type" fi \ No newline at end of file