This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(releases): add basics to create binary releases (#41)
* adds all boilerplate needed to do cross platform releases : closes #32 and closes #40 * adds basic notification system to detect & inform of new releases : after some testing this is simpler and more efficient for now than auto updates : closes #24
- Loading branch information
1 parent
1297024
commit 2d4e729
Showing
13 changed files
with
164 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ node_modules/ | |
.nyc_output | ||
coverage | ||
*.log | ||
dist | ||
build |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const https = require('https') | ||
const packageInfo = require('../../package.json') | ||
const compareVersion = require('compare-version') | ||
const callBackToStream = require('../utils/observable-utils/callbackToObservable') | ||
const updatesFromCB = callBackToStream() | ||
|
||
function appUpdateSource () { | ||
https.get({ | ||
host: 'api.github.com', | ||
path: '/repos/jscad/jscad-desktop/releases/latest', | ||
headers: { | ||
'user-agent': `jscad v${packageInfo.localVersion}` | ||
} | ||
}, function (res) { | ||
if (res.statusCode === 200) { | ||
let result = '' | ||
res.on('data', (x) => { | ||
result += x | ||
}).on('end', () => { | ||
const info = JSON.parse(result) | ||
const remoteVersion = info.tag_name.slice(1) | ||
const localVersion = packageInfo.version | ||
const updateAvailable = (compareVersion(remoteVersion, localVersion) > 0) | ||
if (updateAvailable) { | ||
updatesFromCB.callback({available: updateAvailable, version: remoteVersion}) | ||
} | ||
}) | ||
} | ||
} | ||
) | ||
return updatesFromCB.stream | ||
} | ||
|
||
module.exports = {appUpdateSource} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters