如何使用Electron builder NSIS和AppImage发布到私有GitHub? Electron builder版本:20.38.5 目标:Windows ia32和x64

如何使用Electron builder NSIS和AppImage发布到私有GitHub? Electron builder版本:20.38.5 目标:Windows ia32和x64,electron,electron-builder,Electron,Electron Builder,我试图将项目推送到私有存储库中的GitHub版本。 主要目标是Win ia32和x64 我通过以下方式在控制台中设置令牌: set GH_TOKEN=<blabla> 它向我显示了错误: Error: Cannot cleanup: Error #1 -------------------------------------------------------------------------------- HttpError: 404 Not Found "meth

我试图将项目推送到私有存储库中的GitHub版本。 主要目标是Win ia32和x64

我通过以下方式在控制台中设置令牌:

set GH_TOKEN=<blabla>
它向我显示了错误:

Error: Cannot cleanup:

Error #1 --------------------------------------------------------------------------------
HttpError: 404 Not Found
"method: undefined url: https://github.com/repos/AndreD23/electron-todo-tasks/releases\n\nPlease double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.\n"
我将附上整个错误

我尝试将选项始终更改为
onTag
onTagOrDraft
,并将
releaseType
更改为
release

我试图先在GitHub上手动创建草稿,但没有成功

我试图将存储库公开以供测试使用,但效果不佳

我尝试两次重新生成令牌,但更新了envs、console和package.json,但都不起作用

是否有我遗漏的配置?为了让Electron发布到GitHub,我必须做什么

在错误处,它表示无法找到。在web浏览器上打开它,将返回
404
。我觉得这个链接有点奇怪,因为它在github.com之后添加了repos一词,并在浏览器中删除它,这样就可以正常加载了。这个词是自动设置的?

谢谢

参考:

这对我来说很有效,在PowerShell类型上

[Environment]::SetEnvironmentVariable("GH_TOKEN","my-personal-token","User") 
并确保package.json如下所示:

"build": {
    "appId": "com.friasoftit.electron-auto-update",
    "productName": "Electron Auto Update",
    "publish": [
      {
        "provider": "github",
        "owner": "edelCustodio",
        "repo": "electron-auto-update"
      }
    ],
    "win": {
      "publish": [
        "github"
      ],
      "target": [
        {
          "target": "nsis",
          "arch": [
            "x64",
            "ia32"
          ]
        }
      ]
    }
  },
然后我运行这个命令
warn run publish
,这就是我的
publish
在我的package.json上的方式

"publish": "build --win -p always" 
不要忘记关闭和打开新的PowerShell终端。

  • 从管理员处运行windows powerShell
  • 执行[Environment]::SetEnvironmentVariable(“GH_令牌”,“用户”)
  • 启动或完全重新启动IDE
  • 运行bozon包windows--发布
  • 配置:

    {
      "name": "",
      "version": "",
      "description": "",
      "author": "",
      "repository": "<repo_url>",
      "dependencies": {
        "cross-fetch": "^3.0.6",
        "electron-builder": "^22.10.5",
        "file-loader": "^6.2.0",
        "luxon": "^1.26.0",
        "node-fetch": "^2.6.1"
      },
      "license": "ISC",
      "devDependencies": {
        "bozon": "1.1.3",
        "eslint-config-airbnb-base": "^14.2.1",
        "eslint-plugin-import": "^2.22.1",
        "jest": "26.6.3",
        "spectron": "13.0.0"
      },
      "build": {
        "appId": "",
        "publish": [
          {
            "provider": "github"
          }
        ],
        "win": {}
      },
      "main": ".eslintrc.js",
      "directories": {
        "test": "test"
      },
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      }
    }
    
    {
    “名称”:“,
    “版本”:“,
    “说明”:“,
    “作者”:“作者”,
    “存储库”:“,
    “依赖项”:{
    “交叉提取”:“^3.0.6”,
    “electron builder”:“^22.10.5”,
    “文件加载器”:“^6.2.0”,
    “卢克森”:“^1.26.0”,
    节点提取“^2.6.1”
    },
    “许可证”:“ISC”,
    “依赖性”:{
    “bozon”:“1.1.3”,
    “eslint配置airbnb基础”:“^14.2.1”,
    “eslint插件导入”:“^2.22.1”,
    “笑话”:“26.6.3”,
    “spectron”:“13.0.0”
    },
    “构建”:{
    “appId”:“,
    “发布”:[
    {
    “提供程序”:“github”
    }
    ],
    “赢”:{}
    },
    “main”:“.eslintrc.js”,
    “目录”:{
    “测试”:“测试”
    },
    “脚本”:{
    “测试”:“echo\”错误:未指定测试\“&退出1”
    }
    }
    
    "publish": "build --win -p always" 
    
    {
      "name": "",
      "version": "",
      "description": "",
      "author": "",
      "repository": "<repo_url>",
      "dependencies": {
        "cross-fetch": "^3.0.6",
        "electron-builder": "^22.10.5",
        "file-loader": "^6.2.0",
        "luxon": "^1.26.0",
        "node-fetch": "^2.6.1"
      },
      "license": "ISC",
      "devDependencies": {
        "bozon": "1.1.3",
        "eslint-config-airbnb-base": "^14.2.1",
        "eslint-plugin-import": "^2.22.1",
        "jest": "26.6.3",
        "spectron": "13.0.0"
      },
      "build": {
        "appId": "",
        "publish": [
          {
            "provider": "github"
          }
        ],
        "win": {}
      },
      "main": ".eslintrc.js",
      "directories": {
        "test": "test"
      },
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      }
    }