Task: Add electron build profiles and changed from build in package.json tp electron-build.yaml with multiple profiles in sandbox clinic

This commit is contained in:
Sambo Chea 2021-08-09 11:42:07 +07:00
parent d85a4f556f
commit b8fcde6a0d
13 changed files with 51 additions and 21 deletions

View File

@ -1,9 +1,11 @@
BUILD_PROFILE=${1:-clinic} BUILD_PROFILE=${1:-clinic}
echo "Build for profile ${BUILD_PROFILE}" echo "Build for profile ${BUILD_PROFILE}"
cat profile/${BUILD_PROFILE}.env > lib.js cat profile/${BUILD_PROFILE}.js > lib.js
cat profile/${BUILD_PROFILE}.dev > electron-builder.env
echo "Verify lib.js" echo "Verify lib.js and electron-builder.env"
cat lib.js cat lib.js
cat electron-builder.env
yarn dist yarn dist

View File

42
electron-builder.yaml Normal file
View File

@ -0,0 +1,42 @@
appId: "github.com/cubetiq/sandbox-clinic"
artifactName: ${name}-${version}-${os}-${arch}-${env.ARTIFACT_NAME_POSTFIX}.${ext}
productName: "Sandbox Clinic"
publish: { provider: github, releaseType: draft, vPrefixedTagName: true }
forceCodeSigning: false
compression: normal
npmRebuild: false
asar: true
directories:
output: ./dist
buildResources: build
app: .
mac:
category: public.app-category.productivity
darkModeSupport: true
target:
- { target: dmg }
dmg:
contents:
- { x: 380, y: 240, type: link, path: /Applications }
- { x: 122, y: 240, type: file }
linux:
category: Productivity
packageCategory: Productivity
executableArgs:
- '--js-flags="--max-old-space-size=12288"'
target:
- target: deb
- target: AppImage
win:
artifactName: ${name}-${version}-windows-${arch}.${ext}
icon: ./assets/images/icon.ico
target:
- { target: nsis }
nsis:
artifactName: ${name}-${version}-${arch}.${ext}

View File

@ -13,7 +13,6 @@ app.on("ready", () => {
mainApp = new BrowserWindow({ mainApp = new BrowserWindow({
width: 1024, width: 1024,
height: 768, height: 768,
icon: "./assets/images/icon.png",
title: APP_TITLE, title: APP_TITLE,
}); });

View File

@ -4,24 +4,7 @@
"description": "CUBETIQ Clinic System Management", "description": "CUBETIQ Clinic System Management",
"main": "main.js", "main": "main.js",
"icon": "./assets/images/icon.ico", "icon": "./assets/images/icon.ico",
"build": {
"productName": "Sandbox-Clinic",
"appId": "com.cubetiqs.clinic",
"mac": {
"category": "com.cubetiqs.clinic"
},
"linux": {
"category": "com.cubetiqs.clinic",
"target": [
"AppImage",
"deb"
]
},
"win": {
"target": "nsis",
"icon": "./assets/images/icon.ico"
}
},
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.0", "cross-env": "^7.0.0",
"electron": "^9.4.0", "electron": "^9.4.0",

1
profile/clinic.dev Normal file
View File

@ -0,0 +1 @@
ARTIFACT_NAME_POSTFIX=cubetiqclinic

1
profile/dr.dev Normal file
View File

@ -0,0 +1 @@
ARTIFACT_NAME_POSTFIX=drclinic

1
profile/em.dev Normal file
View File

@ -0,0 +1 @@
ARTIFACT_NAME_POSTFIX=emclinic

1
profile/kesor.dev Normal file
View File

@ -0,0 +1 @@
ARTIFACT_NAME_POSTFIX=kesorclinic