no message

This commit is contained in:
kuaifan 2021-12-22 01:40:25 +08:00
parent 7a850704e5
commit a7ac2cee13
4 changed files with 29 additions and 24 deletions

View File

@ -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')

10
electron/build.js vendored
View File

@ -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,6 +188,7 @@ if (["build", "prod"].includes(argv[2])) {
]; ];
inquirer.prompt(questions).then(answers => { inquirer.prompt(questions).then(answers => {
step1(); step1();
setTimeout(() => {
answers.platform.forEach(platform => { answers.platform.forEach(platform => {
step2({ step2({
"name": config.name, "name": config.name,
@ -197,17 +198,20 @@ if (["build", "prod"].includes(argv[2])) {
}, false) }, false)
}); });
step3(); step3();
}, 3000)
}); });
} else if (platform.includes(argv[2])) { } else if (platform.includes(argv[2])) {
// 自动编译 // 自动编译
step1(); step1();
setTimeout(() => {
config.app.sites.forEach((data) => { config.app.sites.forEach((data) => {
if (data.name && data.id && data.url) { if (data.name && data.id && data.url) {
data.platform = argv[2]; data.platform = argv[2];
step2(data, true) 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');

View File

@ -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
} }
}, },

View File

@ -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",