gpt4 book ai didi

electron - 如何使用 Electron 生成器将 Electron 应用发布到GitHub版本?

转载 作者:行者123 更新时间:2023-12-03 12:28:12 57 4
gpt4 key购买 nike

我正在尝试将我的 Electron 应用发布到GitHub版本,但无法正常工作。
这就是我所拥有的:package.json

....
"scripts": {
"start": "electron . --disable-gpu",
"test": "echo \"Error: no test specified\" && exit 1",
"win": "electron-builder --windows nsis:ia32",
"linux": "electron-builder --linux",
"publish":"electron-builder -p onTag"
},
....
"build": {
"publish": [
"github"
],
....
}

当我运行 npm run publish时,它会创建可执行文件,但不会在我的GitHub版本存储库中发布:
$ npm run publish                                                                            

> Inventory-pro@1.0.1 publish /home/xander/Develop/Electron/InventoryV2
> electron-builder -p onTag

• electron-builder version=21.2.0 os=5.3.0-26-generic
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=linux arch=x64 electron=7.1.3 appOutDir=dist/linux-unpacked
• building target=deb arch=x64 file=dist/Inventory-pro_1.0.1_amd64.deb
我想发布它,以便在每个发行版上都可以在我的应用程序中包括自动更新。

最佳答案

不要指定-p选项,它将始终发布发行版,因为package.json中的脚本名为release

But please consider using automatic rules instead of explicitly specifying publish:

  • If npm script named release, — always.

资料来源: https://www.electron.build/configuration/publish#how-to-publish
...
"scripts": {
...
"publish":"electron-builder"
},
...

关于electron - 如何使用 Electron 生成器将 Electron 应用发布到GitHub版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59878155/

57 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com