有可能electron-builder
。我会有几个构建配置,并告诉构建electron-builder
时使用哪个。
例如,config/beta.json
使用以下设置创建文件:
{
"appId": "com.company.beta",
"productName": "App Beta",
"directories": {
"buildResources": "build/beta" // directory containing your build-specific assets (e.g., beta icons - icon.icns, icon.ico & background.png)
},
"mac": {
"category": "public.app-category.finance"
},
"win": {
"target": [
"nsis"
]
},
"nsis": {
"perMachine": false
},
"publish": [
{
"provider": "s3",
"bucket": "com-app-beta" // dedicated S3 bucket for each build
}
],
}
并复制config/beta.json
和(确保相应地编辑设置)。next.json
current.json
在package.json
中,添加以下构建脚本(注意--em.name=app-beta
覆盖package.json
“名称”值):
{
"scripts": {
"build": "build -owl --x64 --config ./config/current.json -p always --em.name=app",
"build-beta": "build -owl --x64 --config ./config/beta.json -p always --em.name=app-beta",
"build-next": "build -owl --x64 --config ./config/next.json -p always --em.name=app-next"
}
}
准备好部署时运行构建脚本:
npm run build-beta