Electron-forge: publish windows ia32,x64 to github fail

Created on 16 Aug 2018  路  9Comments  路  Source: electron-userland/electron-forge

  • [鉁旓笍] I have read the contribution documentation for this project.
  • [鉁旓笍] I agree to follow the code of conduct that this project follows, as appropriate.
  • [鉁旓笍] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

make and publish windows ia32,x64, the same name as exe is generated.
demo1-1.0.0.Setup.exe
demo1-1.0.0-full.nupkg
so publish to github fail

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

none

Put the console output here

An unhandled rejection has occurred inside Forge:
{"message":"Validation Failed","request_id":"C309:4D44:5E47BB:615029:5B743E8C","documentation_url":"https://developer.github.
com/v3","errors":[{"resource":"ReleaseAsset","code":"already_exists","field":"name"}]}
HttpError: {"message":"Validation Failed","request_id":"C309:4D44:5E47BB:615029:5B743E8C","documentation_url":"https://develo
per.github.com/v3","errors":[{"resource":"ReleaseAsset","code":"already_exists","field":"name"}]}
    at response.text.then.message (E:\github\demo1\node_modules\@octokit\rest\lib\request\request.js:72:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] publish:win64: `electron-forge publish --arch=x64 --platform=win32`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] publish:win64 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

What command line arguments are you passing?

electron-forge publish --arch=ia32,x64 --platform=win32

What does your config.forge data in package.json look like?

    "start": "electron-forge start",
    "package": "electron-forge package",
    "package:win": "electron-forge package --arch=ia32,x64 --platform=win32",
    "make": "electron-forge make",
    "make:win": "electron-forge make --arch=ia32,x64 --platform=win32",
    "publish": "electron-forge publish",
    "publish:win": "electron-forge publish --arch=ia32,x64 --platform=win32"

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

npm start publish:win
Question

Most helpful comment

forge.config.js is basically a node module that contains your configuration. So you would put in your package.json:

{
  // The rest of your package.json file
  "config": {
    "forge": "./forge.config.js"
  }
}

And in forge.config.js:

module.exports = {
  // All of the configuration options that would be in config.forge if you used the package.json method
  postMake: function (forgeConfig, outputs) {
    // outputs are the paths to files that are generated by make, like Squirrel's .exe & RELEASES
    // adapt the atom code here and return outputs
  }
};


All 9 comments

What you probably need to do is point config.forge to a JS file instead of a JSON object (as described in the 5.x readme) and then specify a postMake hook function that does roughly what Atom does to differentiate between 32-bit and 64-bit Windows installer releases:

https://github.com/atom/atom/blob/a03aac765200a01c813b9926d23c600c239e1522/script/lib/create-windows-installer.js#L25-L45

It's too hard锛宑an you support JSON object?

forge.config.js how to configure,Can you give an example?

forge.config.js is basically a node module that contains your configuration. So you would put in your package.json:

{
  // The rest of your package.json file
  "config": {
    "forge": "./forge.config.js"
  }
}

And in forge.config.js:

module.exports = {
  // All of the configuration options that would be in config.forge if you used the package.json method
  postMake: function (forgeConfig, outputs) {
    // outputs are the paths to files that are generated by make, like Squirrel's .exe & RELEASES
    // adapt the atom code here and return outputs
  }
};


tks

hi,postMake聽not being invoked,console no print log.

postMake: function (forgeConfig, outputs) {
        console.log(forgeConfig);
        console.log(outputs);
        return outputs;
    }

Sorry, I misread how these hooks are supposed to be defined. I meant that it should be in forge.config.hooks.postMake, and that it should return a Promise:

module.exports = {
  // All of the configuration options that would be in config.forge if you used the package.json method
  hooks: {
    postMake: function (forgeConfig, outputs) {
      // outputs are the paths to files that are generated by make, like Squirrel's .exe & RELEASES
      // adapt the atom code here and return outputs
      return Promise.resolve(modified_outputs);
    }
  }
};

ok, I鈥檒l try.

Was this page helpful?
0 / 5 - 0 ratings