mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-28 13:28:43 +00:00
[hopefully] add an auto-updater
This commit is contained in:
parent
c7cb3c4b23
commit
be3cffa53f
4 changed files with 73 additions and 3 deletions
14
build/entitlements.mac.plist
Normal file
14
build/entitlements.mac.plist
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
30
build/notarize.js
Normal file
30
build/notarize.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
const { notarize } = require('electron-notarize')
|
||||
const path = require('path')
|
||||
|
||||
exports.default = async function notarizing (context) {
|
||||
if (context.electronPlatformName !== 'darwin' || process.env.CSC_IDENTITY_AUTO_DISCOVERY === 'false') {
|
||||
console.log('Skipping notarization')
|
||||
return
|
||||
}
|
||||
console.log('Notarizing...')
|
||||
|
||||
const appBundleId = context.packager.appInfo.info._configuration.appId
|
||||
const appName = context.packager.appInfo.productFilename
|
||||
const appPath = path.normalize(path.join(context.appOutDir, `${appName}.app`))
|
||||
const appleId = process.env.APPLE_ID
|
||||
const appleIdPassword = process.env.APPLE_ID_PASSWORD
|
||||
if (!appleId) {
|
||||
console.warn('Not notarizing: Missing APPLE_ID environment variable')
|
||||
return
|
||||
}
|
||||
if (!appleIdPassword) {
|
||||
console.warn('Not notarizing: Missing APPLE_ID_PASSWORD environment variable')
|
||||
return
|
||||
}
|
||||
return notarize({
|
||||
appBundleId,
|
||||
appPath,
|
||||
appleId,
|
||||
appleIdPassword
|
||||
})
|
||||
}
|
||||
24
package.json
24
package.json
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "0.5.3",
|
||||
"version": "0.6.0",
|
||||
"author": "ThaUnknown_",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "SET NODE_ENV=development & concurrently \"npm run web:watch\" \"npm run electron:start\"",
|
||||
"web:watch": "vite",
|
||||
"electron:start": "electron src",
|
||||
"build": "vite build && electron-builder"
|
||||
"build": "vite build && electron-builder",
|
||||
"publish": "vite build && electron-builder -p always"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
|
||||
|
|
@ -15,6 +16,7 @@
|
|||
"concurrently": "^7.0.0",
|
||||
"electron": "^16.0.10",
|
||||
"electron-builder": "^22.14.13",
|
||||
"electron-notarize": "^1.1.1",
|
||||
"svelte": "^3.46.4",
|
||||
"vite": "^2.8.6",
|
||||
"vite-plugin-commonjs-externals": "^0.1.1"
|
||||
|
|
@ -27,18 +29,32 @@
|
|||
"env": "browser"
|
||||
},
|
||||
"build": {
|
||||
"publish": [
|
||||
{
|
||||
"provider": "github",
|
||||
"owner": "ThaUnknown",
|
||||
"repo": "miru"
|
||||
}
|
||||
],
|
||||
"afterSign": "./build/notarize.js",
|
||||
"appId": "com.github.thaunknown.miru",
|
||||
"productName": "Miru",
|
||||
"files": [
|
||||
"src/**/*"
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.video"
|
||||
},
|
||||
"win": {
|
||||
"target": "nsis",
|
||||
"icon": "src/renderer/public/logo.ico"
|
||||
},
|
||||
"linux": {
|
||||
"category": "Video",
|
||||
"target": "AppImage"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"installerIcon": "src/renderer/public/logo.ico",
|
||||
"installerHeaderIcon": "src/renderer/public/logo.ico"
|
||||
}
|
||||
|
|
@ -46,7 +62,9 @@
|
|||
"dependencies": {
|
||||
"@electron/remote": "^2.0.7",
|
||||
"anitomyscript": "^2.0.4",
|
||||
"electron-log": "^4.4.6",
|
||||
"electron-updater": "^4.6.5",
|
||||
"matroska-subtitles": "^3.3.2",
|
||||
"webtorrent": "^1.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
const { app, BrowserWindow, protocol } = require('electron')
|
||||
const path = require('path')
|
||||
const remote = require('@electron/remote/main')
|
||||
const log = require('electron-log')
|
||||
const { autoUpdater } = require('electron-updater')
|
||||
|
||||
autoUpdater.logger = log
|
||||
autoUpdater.logger.transports.file.level = 'info'
|
||||
|
||||
remote.initialize()
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
|
|
@ -22,6 +28,8 @@ function UpsertKeyValue (obj, keyToChange, value) {
|
|||
}
|
||||
|
||||
function createWindow () {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1600,
|
||||
|
|
|
|||
Loading…
Reference in a new issue