Skip to content

Commit

Permalink
Build all at once
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Jun 28, 2024
1 parent 873e30c commit 031f169
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
35 changes: 22 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
},
"homepage": "https://github.com/buttercup/desktop#readme",
"build": {
"publish": [
{
"provider": "github",
"owner": "buttercup",
"repo": "buttercup-desktop"
}
],
"afterPack": "./resources/scripts/afterPack.js",
"afterAllArtifactBuild": "./resources/scripts/afterAllArtifactBuild.js",
"appId": "pw.buttercup.desktop",
Expand Down Expand Up @@ -145,37 +152,39 @@
]
}
],
"publish": [
{
"provider": "github",
"owner": "buttercup",
"repo": "buttercup-desktop"
}
],
"directories": {
"output": "dist"
},
"win": {
"icon": "./resources/build/icon.ico",
"artifactName": "${productName}-${os}-${env.NODE_ARCHITECTURE}-${version}.${ext}",
"artifactName": "${productName}-${os}-x64-${version}.${ext}",
"target": [
"nsis",
"portable",
"7z"
{
"target": "nsis",
"arch": ["x64"]
},
{
"target": "portable",
"arch": ["x64"]
},
{
"target": "7z",
"arch": ["x64"]
}
],
"publisherName": [
"MadDev Oy",
"Vault Garden Oy"
]
},
"nsis": {
"artifactName": "${productName}-${os}-${env.NODE_ARCHITECTURE}-${version}-installer.${ext}",
"artifactName": "${productName}-${os}-x64-${version}-installer.${ext}",
"oneClick": false,
"perMachine": false,
"include": "./resources/build/installer.nsh"
},
"portable": {
"artifactName": "${productName}-${os}-${env.NODE_ARCHITECTURE}-${version}-portable.${ext}"
"artifactName": "${productName}-${os}-x64-${version}-portable.${ext}"
}
},
"jest": {
Expand Down
20 changes: 8 additions & 12 deletions resources/scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ async function buildApp() {
await promisify(exec)("npm run build");
}

async function buildMac() {
console.log("Building Mac...");
async function buildBundle() {
console.log("Assembling bundles...");
const result = await builder.build({
targets: builder.Platform.MAC.createTarget()
});
console.log("Result:", result);
}

async function buildLinux() {
console.log("Building Linux...");
const result = await builder.build({
targets: builder.Platform.LINUX.createTarget()
targets: new Map([
...builder.Platform.MAC.createTarget(),
...builder.Platform.LINUX.createTarget(),
...builder.Platform.WINDOWS.createTarget()
])
});
console.log("Result:", result);
}
Expand All @@ -41,7 +37,7 @@ async function routine(...callbacks) {
}
}

routine(clean, buildApp, buildLinux)
routine(clean, buildApp, buildBundle)
.then(() => {
console.log("Done.");
})
Expand Down

0 comments on commit 031f169

Please sign in to comment.