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]
platform: [
build-mac,
build-mac-arm
build-mac-arm,
build-win
]
if: startsWith(github.event.ref, 'refs/tags/v')

40
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(/"appId":\s*"(.*?)"/, `"appId": "${data.id}"`);
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');
//
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');
packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${config.name}"`);
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');
}
@ -188,26 +188,30 @@ if (["build", "prod"].includes(argv[2])) {
];
inquirer.prompt(questions).then(answers => {
step1();
answers.platform.forEach(platform => {
step2({
"name": config.name,
"id": config.app.id,
"url": answers.website,
"platform": platform
}, false)
});
step3();
setTimeout(() => {
answers.platform.forEach(platform => {
step2({
"name": config.name,
"id": config.app.id,
"url": answers.website,
"platform": platform
}, false)
});
step3();
}, 3000)
});
} else if (platform.includes(argv[2])) {
// 自动编译
step1();
config.app.sites.forEach((data) => {
if (data.name && data.id && data.url) {
data.platform = argv[2];
step2(data, true)
}
})
step3();
setTimeout(() => {
config.app.sites.forEach((data) => {
if (data.name && data.id && data.url) {
data.platform = argv[2];
step2(data)
}
})
step3();
}, 3000);
} else {
// 开发模式
fs.writeFileSync(devloadCachePath, formatUrl("127.0.0.1:" + env.parsed.APP_PORT), 'utf8');

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.4.0",
"version": "0.4.2",
"description": "DooTask is task management system.",
"main": "main.js",
"license": "MIT",
@ -45,9 +45,9 @@
},
"build": {
"appId": "com.dootask.task",
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
"files": [
"public/**/*",
"public",
"main.js",
"preload.js"
],
@ -63,7 +63,7 @@
},
"nsis": {
"oneClick": false,
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
"allowToChangeInstallationDirectory": true
}
},

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.4.0",
"version": "0.4.2",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",