question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to publish a vue-electron release to github using this plugin?

See original GitHub issue

Helo friends,

I have an electron application that uses autoUpdater, but I don’t know how to release

I have this in the background.js:

  const server = 'https://cinecoqui.chrismichael.now.sh'
  const feed = `${server}/update/${process.platform}/${app.getVersion()}`

  autoUpdater.setFeedURL(feed);

  setInterval(() => {
    autoUpdater.checkForUpdates()
  }, 60000);

  autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
    const dialogOpts = {
      type: 'info',
      buttons: ['Restart', 'Later'],
      title: 'Application Update',
      message: process.platform === 'win32' ? releaseNotes : releaseName,
      detail: 'A new version has been downloaded. Restart the application to apply the updates.'
    }
  
    dialog.showMessageBox(dialogOpts, (response) => {
      if (response === 0) autoUpdater.quitAndInstall()
    })
  })

  autoUpdater.on('error', message => {
    console.error('There was a problem updating the application')
    console.error(message)
  })

When I write the

 npm run electron:build

command it generates what is the dist_electron folder, next to the latest.yml file that have this:

version: 1.1.0
files:
  - url: cinecoqui-Setup-1.1.0.exe
    sha512: DNQh9JA/Ex2dNij3ZYNtKPXs1j9L+cHUFZR6xg2aSJkU6KglEAe6XBJMtc6UBtJIHaUXuAaZPrVmnBivJwEzrA==
    size: 43692738
path: cinecoqui-Setup-1.1.0.exe
sha512: DNQh9JA/Ex2dNij3ZYNtKPXs1j9L+cHUFZR6xg2aSJkU6KglEAe6XBJMtc6UBtJIHaUXuAaZPrVmnBivJwEzrA==
releaseDate: '2019-09-26T15:06:02.912Z'

Some help I will appreciate it

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:21 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
Christilutcommented, Sep 27, 2019

Try this page: https://www.electron.build/configuration/publish

I use this in my vue.config.js:

          publish: [
            {
              provider: "github",
              owner: "Christilut",
              repo: "myrepo",
              releaseType: 'draft'
            }
          ]

And run the publish command vue-cli-service electron:build -p always with the GH_TOKEN prefixed, eg: GH_TOKEN=123 npm run publish

Took me a bit to figure all this out, the information is there just spread out.

3reactions
ChrisMichaelPerezSantiagocommented, Sep 27, 2019

Helo @Christilut ,

Thank you very much for your input. I achieved what I wanted. I must mention is that the configuration of the vue.config.js file:

 "publish": [
      {
        "provider": "github",
        "owner": "ChrisMichaelPerezSantiago",
        "repo": "cinecoqui",
        "releaseType": "draft"
      }
  ],

It showed me an error, Invalid options in vue.config.js:

"publish" is not allowed.

To fix it, I took the configuration and pasted it into the package.json.

Then I define the script of the publication:

  "gh-publish": "vue-cli-service electron: build -p always"

And in the line command I wrote the following:

npm run gh-publish GH_TOKEN
c@Chris MINGW64 ~/Desktop/cinecoqui (master)
$ npm run gh-publish GH_TOKEN

> cinecoqui@1.1.0 gh-publish C:\Users\c\Desktop\cinecoqui
> vue-cli-service electron:build -p always "GH_TOKEN"

 INFO  Bundling render process:

\  Building modern bundle for production...

 DONE  Compiled successfully in 4870ms                                                                       11:14:24 AM

  File                                      Size             Gzipped

  dist_electron\bundled\js\chunk-vendors    474.95 KiB       130.95 KiB
  .e63000b6.js
  dist_electron\bundled\js\app.2547ac53.    109.93 KiB       29.40 KiB
  js
  dist_electron\bundled\css\app.a26b00bd    44.08 KiB        9.28 KiB
  .css

  Images and other types of assets omitted.

 DONE  Build complete. The dist_electron\bundled directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

|  Bundling main process...

 DONE  Compiled successfully in 3065ms                                                                       11:14:28 AM

  File                                   Size              Gzipped

  dist_electron\bundled\background.js    161.28 KiB        50.06 KiB

  Images and other types of assets omitted.

 INFO  Building app with electron-builder:
  • electron-builder  version=21.2.0 os=10.0.18362
  • description is missed in the package.json  appPackageFile=C:\Users\c\Desktop\cinecoqui\dist_electron\bundled\package.json
  • author is missed in the package.json  appPackageFile=C:\Users\c\Desktop\cinecoqui\dist_electron\bundled\package.json
  • writing effective config  file=dist_electron\builder-effective-config.yaml
  • packaging       platform=win32 arch=x64 electron=6.0.7 appOutDir=dist_electron\win-unpacked
  • default Electron icon is used  reason=application icon is not set
  • building        target=nsis file=dist_electron\cinecoqui Setup 1.1.0.exe archs=x64 oneClick=true perMachine=false
  • building block map  blockMapFile=dist_electron\cinecoqui Setup 1.1.0.exe.blockmap
  • publishing      publisher=Github (owner: ChrisMichaelPerezSantiago, project: cinecoqui, version: 1.1.0)
  • uploading       file=cinecoqui-Setup-1.1.0.exe.blockmap provider=GitHub
  • uploading       file=cinecoqui-Setup-1.1.0.exe provider=GitHub
  • creating GitHub release  reason=release doesn't exist tag=v1.1.0 version=1.1.0
    [====================] 100% 0.0s | cinecoqui-Setup-1.1.0.exe to GitHub
 DONE  Build complete!

💯 Now, in github in the releases section we will see our draft with the files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to upload a release to GitHub repo? · Issue #85
Hi, I have an electron release built with yarn build:electron. I want it to be uploaded automatically to a GitHub repository.
Read more >
SimulatedGREG/vue-electron - GitHub
This plugin will attach electron APIs to the Vue object itself, so accessing all APIs is dead simple. All official documentation from electron...
Read more >
SimulatedGREG/electron-vue - GitHub
The aim of this project is to remove the need of manually setting up electron apps using vue. electron-vue takes advantage of vue-cli...
Read more >
Example using electron-updater with `generic` provider. · GitHub
Update the version in package.json . Do steps 3 and 4 again. Open the installed version of the app and see that it...
Read more >
Electron isn't launching on serve:electron #24 - GitHub
Tried with npm 5.6.0, npm 6.1.0 and yarn 1.7.0. node version. node v10.4.1. vue-cli version. 3.0.0-rc.2. vue-cli-plugin-electron-builder ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found