new build method with Apple notarize, electron-build programatic API

This commit is contained in:
cutls
2021-04-13 12:31:17 +09:00
parent e2c0fda4c9
commit aa7d5e4586
20 changed files with 719 additions and 442 deletions

View File

@@ -1,32 +1,10 @@
const fs = require('fs')
const path = require('path')
const basefile = path.join(__dirname, '../../')
const package = fs.readFileSync(basefile + 'package.json')
const data = JSON.parse(package)
const version = data.version
const codename = data.codename
let ver = `${version} (${codename})`
if (process.argv.indexOf('--automatic') === -1) {
let input = require('readline-sync').question('version string [empty: ' + ver + ' (default)]? ')
if (input) {
ver = input
}
}
var pwa = false
if (process.argv.indexOf('--pwa') > 0) {
var pwa = true
}
var store = false
if (process.argv.indexOf('--store') > 0) {
var store = true
}
function main(ver, basefile, pwa, store) {
function construct(ver, basefile, pwa, store) {
const execSync = require('child_process').execSync
let gitHash = execSync('git rev-parse HEAD')
.toString()
.trim()
fs.writeFileSync(basefile + 'git', gitHash)
console.log('Constructing view files ' + ver)
const langs = ['ja', 'ja-KS', 'en', 'bg', 'cs', 'de',
'es-AR', 'it-IT', 'zh-CN', 'fr-FR', 'zh-TW', 'no-NO', 'pt-BR', 'ru-RU', 'es-ES','pl-PL', 'ps']
@@ -172,23 +150,4 @@ function main(ver, basefile, pwa, store) {
}
}
}
main(ver, basefile, pwa, store)
//if --watch, to yarn dev
if (process.argv.indexOf('--watch') !== -1) {
const chokidar = require('chokidar')
console.log(
'watch mode(not hot-watch): when construction files are changed, refresh view files but not reload. Please reload manually.'
)
const watcher = chokidar.watch(basefile + 'view/make', {
ignored: 'view/make/make.js',
persistent: true
})
watcher.on('ready', function () {
console.log('watching...')
watcher.on('change', function (path) {
console.log(path + ' changed.')
main(ver, basefile)
})
})
}
module.exports = construct

44
app/view/make/makeCli.js Normal file
View File

@@ -0,0 +1,44 @@
const fs = require('fs')
const path = require('path')
const construct = require('./make.js')
const basefile = path.join(__dirname, '../../')
const package = fs.readFileSync(basefile + 'package.json')
const data = JSON.parse(package)
const version = data.version
const codename = data.codename
let ver = `${version} (${codename})`
if (process.argv.indexOf('--prompt') != -1) {
let input = require('readline-sync').question('version string [empty: ' + ver + ' (default)]? ')
if (input) {
ver = input
}
}
var pwa = false
if (process.argv.indexOf('--pwa') > 0) {
var pwa = true
}
var store = false
if (process.argv.indexOf('--store') > 0) {
var store = true
}
construct(ver, basefile, pwa, store)
//if --watch, to yarn dev
if (process.argv.indexOf('--watch') !== -1) {
const chokidar = require('chokidar')
console.log(
'watch mode(not hot-watch): when construction files are changed, refresh view files but not reload. Please reload manually.'
)
const watcher = chokidar.watch(basefile + 'view/make', {
ignored: 'view/make/make.js',
persistent: true
})
watcher.on('ready', function () {
console.log('watching...')
watcher.on('change', function (path) {
console.log(path + ' changed.')
construct(ver, basefile)
})
})
}

View File

@@ -26,7 +26,7 @@
<body class="">
<script>
var ver = '22.1.1 (Koume)'
var gitHash = '816665f7d335ffd75978b96126cf43ecf456e983'
var gitHash = 'e2c0fda4c956ff5edf31442706fd915ddb9bb17d'
//betaを入れるとバージョンチェックしない
//var ver="beta";
var acct_id = 0

View File

@@ -78,7 +78,7 @@
<template v-for="(check, j) in item.text.checkbox">
<label>
<input class="with-gap" v-on:click="complete(i,check.value)" v-model="item.setValue"
type="radio" v-bind:id="item.id" v-bind:value="check.value" />
type="radio" v-bind:id="item.id+check.value" v-bind:value="check.value" />
<span>{{check.text}}</span>
</label>
</template>
@@ -609,7 +609,7 @@
style="width:100%; max-width:40rem;"><img src="../../img/desk_full.svg" class="left" width="25"
style="padding-top:5px;">Main author: Cutls@cutls.com</a>
<br>
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/816665f7d335ffd75978b96126cf43ecf456e983">816665f7d335ffd75978b96126cf43ecf456e983</a> - <a
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/e2c0fda4c956ff5edf31442706fd915ddb9bb17d">e2c0fda4c956ff5edf31442706fd915ddb9bb17d</a> - <a
onclick="checkupd(); return localStorage.removeItem('new-ver-skip'); location.href='index.html';"
class="pointer pwa">Sprawdź aktualizacje</a><br>
<br>
@@ -619,7 +619,7 @@
<img src="https://status.cutls.com/badge-service?site=thedesk.top">
</a><br>
<h5>OSS License</h5>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fcutls%2FTheDesk/refs/branch/master/816665f7d335ffd75978b96126cf43ecf456e983"
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fcutls%2FTheDesk/refs/branch/master/e2c0fda4c956ff5edf31442706fd915ddb9bb17d"
alt="FOSSA Status"><img
src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcutls%2FTheDesk.svg?type=small" /></a>
<br>

View File

@@ -160,8 +160,8 @@ var envConstruction = [
checkbox: true,
setValue: false,
text: {
head: 'undefined',
desc: 'undefined',
head: 'Webview Integration',
desc: 'To use TweetDeck Integration, please turn on. You should understand it may lessen security level.',
checkbox: [
{
text: 'Tak',