no message
This commit is contained in:
parent
7a850704e5
commit
a7ac2cee13
3
.github/workflows/electron.yml
vendored
3
.github/workflows/electron.yml
vendored
@ -38,7 +38,8 @@ jobs:
|
|||||||
os: [macos-11]
|
os: [macos-11]
|
||||||
platform: [
|
platform: [
|
||||||
build-mac,
|
build-mac,
|
||||||
build-mac-arm
|
build-mac-arm,
|
||||||
|
build-win
|
||||||
]
|
]
|
||||||
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||||
|
40
electron/build.js
vendored
40
electron/build.js
vendored
@ -131,7 +131,7 @@ function step2(data, publish) {
|
|||||||
packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${data.name}"`);
|
packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${data.name}"`);
|
||||||
packageString = packageString.replace(/"appId":\s*"(.*?)"/, `"appId": "${data.id}"`);
|
packageString = packageString.replace(/"appId":\s*"(.*?)"/, `"appId": "${data.id}"`);
|
||||||
packageString = packageString.replace(/"version":\s*"(.*?)"/, `"version": "${config.version}"`);
|
packageString = packageString.replace(/"version":\s*"(.*?)"/, `"version": "${config.version}"`);
|
||||||
packageString = packageString.replace(/"artifactName":\s*"(.*?)"/g, '"artifactName": "' + getDomain(data.url) + '-${version}-${os}-${arch}.${ext}"');
|
packageString = packageString.replace(/"artifactName":\s*"(.*?)"/g, '"artifactName": "' + getDomain(data.url) + '-v${version}-${os}-${arch}.${ext}"');
|
||||||
fs.writeFileSync(packageFile, packageString, 'utf8');
|
fs.writeFileSync(packageFile, packageString, 'utf8');
|
||||||
//
|
//
|
||||||
child_process.spawnSync("npm", ["run", data.platform + (publish === true ? "-publish" : "")], {stdio: "inherit", cwd: "electron"});
|
child_process.spawnSync("npm", ["run", data.platform + (publish === true ? "-publish" : "")], {stdio: "inherit", cwd: "electron"});
|
||||||
@ -143,7 +143,7 @@ function step3() {
|
|||||||
let packageString = fs.readFileSync(packageFile, 'utf8');
|
let packageString = fs.readFileSync(packageFile, 'utf8');
|
||||||
packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${config.name}"`);
|
packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${config.name}"`);
|
||||||
packageString = packageString.replace(/"appId":\s*"(.*?)"/, `"appId": "${config.app.id}"`);
|
packageString = packageString.replace(/"appId":\s*"(.*?)"/, `"appId": "${config.app.id}"`);
|
||||||
packageString = packageString.replace(/"artifactName":\s*"(.*?)"/g, '"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"');
|
packageString = packageString.replace(/"artifactName":\s*"(.*?)"/g, '"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}"');
|
||||||
fs.writeFileSync(packageFile, packageString, 'utf8');
|
fs.writeFileSync(packageFile, packageString, 'utf8');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,26 +188,30 @@ if (["build", "prod"].includes(argv[2])) {
|
|||||||
];
|
];
|
||||||
inquirer.prompt(questions).then(answers => {
|
inquirer.prompt(questions).then(answers => {
|
||||||
step1();
|
step1();
|
||||||
answers.platform.forEach(platform => {
|
setTimeout(() => {
|
||||||
step2({
|
answers.platform.forEach(platform => {
|
||||||
"name": config.name,
|
step2({
|
||||||
"id": config.app.id,
|
"name": config.name,
|
||||||
"url": answers.website,
|
"id": config.app.id,
|
||||||
"platform": platform
|
"url": answers.website,
|
||||||
}, false)
|
"platform": platform
|
||||||
});
|
}, false)
|
||||||
step3();
|
});
|
||||||
|
step3();
|
||||||
|
}, 3000)
|
||||||
});
|
});
|
||||||
} else if (platform.includes(argv[2])) {
|
} else if (platform.includes(argv[2])) {
|
||||||
// 自动编译
|
// 自动编译
|
||||||
step1();
|
step1();
|
||||||
config.app.sites.forEach((data) => {
|
setTimeout(() => {
|
||||||
if (data.name && data.id && data.url) {
|
config.app.sites.forEach((data) => {
|
||||||
data.platform = argv[2];
|
if (data.name && data.id && data.url) {
|
||||||
step2(data, true)
|
data.platform = argv[2];
|
||||||
}
|
step2(data)
|
||||||
})
|
}
|
||||||
step3();
|
})
|
||||||
|
step3();
|
||||||
|
}, 3000);
|
||||||
} else {
|
} else {
|
||||||
// 开发模式
|
// 开发模式
|
||||||
fs.writeFileSync(devloadCachePath, formatUrl("127.0.0.1:" + env.parsed.APP_PORT), 'utf8');
|
fs.writeFileSync(devloadCachePath, formatUrl("127.0.0.1:" + env.parsed.APP_PORT), 'utf8');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.4.0",
|
"version": "0.4.2",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -45,9 +45,9 @@
|
|||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.dootask.task",
|
"appId": "com.dootask.task",
|
||||||
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
|
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
|
||||||
"files": [
|
"files": [
|
||||||
"public/**/*",
|
"public",
|
||||||
"main.js",
|
"main.js",
|
||||||
"preload.js"
|
"preload.js"
|
||||||
],
|
],
|
||||||
@ -63,7 +63,7 @@
|
|||||||
},
|
},
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"oneClick": false,
|
"oneClick": false,
|
||||||
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
|
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
|
||||||
"allowToChangeInstallationDirectory": true
|
"allowToChangeInstallationDirectory": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.4.0",
|
"version": "0.4.2",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"start": "./cmd dev",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user