You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `publish: ['github']` to Electron Builder's config in your `vue.config.js`:
28
+
29
+
```js
30
+
module.exports= {
31
+
pluginOptions: {
32
+
electronBuilder: {
33
+
builderOptions: {
34
+
publish: ['github']
35
+
}
36
+
}
37
+
}
38
+
}
39
+
```
40
+
41
+
### Check for Updates in `background.(js|ts)`
42
+
43
+
Add the following to your main process file (`background.(js|ts)` by default):
44
+
45
+
```diff
46
+
...
47
+
+ import { autoUpdater } from "electron-updater"
48
+
...
49
+
50
+
if (process.env.WEBPACK_DEV_SERVER_URL) {
51
+
// Load the url of the dev server if in development mode
52
+
win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
53
+
if (!process.env.IS_TEST) win.webContents.openDevTools()
54
+
} else {
55
+
createProtocol('app')
56
+
// Load the index.html when not in development
57
+
win.loadURL('app://./index.html')
58
+
+ autoUpdater.checkForUpdatesAndNotify()
59
+
}
60
+
...
61
+
```
62
+
63
+
### GitHub Personal Access Token
64
+
65
+
**Note:** You will need a GitHub personal access token for this step. To get one, go to [https://github.com/settings/tokens](https://github.com/settings/tokens) and click `Generate new token`.
66
+
67
+
In order for Electron Builder to upload a release to GitHub, you will need to make your token available by setting the `GH_TOKEN` env variable to your token:
68
+
69
+
On Linux/MacOS:
70
+
71
+
`export GH_TOKEN=TOKEN-GOES-HERE`
72
+
73
+
On Windows:
74
+
75
+
`set GH_TOKEN=TOKEN-GOES-HERE`
76
+
77
+
### Upload Release to GitHub
78
+
79
+
Now that you have configured everything, tell electron-builder to upload your app to GitHub by running `electron:build` with the `-p always` argument:
80
+
81
+
With Yarn:
82
+
83
+
`yarn electron:build -p always`
84
+
85
+
or with NPM:
86
+
87
+
`npm run electron:build -- -p always`
88
+
89
+
### Publish Release
90
+
91
+
Open your repo in GitHub, and click on the releases tab. You should see a draft of your new version with all the binaries included. Publish this release so users can update to it.
92
+
93
+
### Check for Updates
94
+
95
+
Install your app, then run it. You won't get an update notification yet, because this is the latest version. You will have to publish a new version by increasing the `version` field in your `package.json`, then repeating the 3 previous steps. Now, your old app should give you an update notification.
Add "red dot" [breakpoints](https://code.visualstudio.com/docs/editor/debugging#_breakpoints) by clicking VSCode's gutter in your Vue app or background file.
290
380
291
-
#### Launch Debug Mode
381
+
### Launch Debug Mode
292
382
293
383
Run the `Electron: All` launch configuration. Execution should stop upon reaching one of your breakpoints, and VSCode will allow you to debug your code.
0 commit comments