Skip to content

Commit d85ef70

Browse files
committed
🐛 Simplified actions packaging path
1 parent 4685d3f commit d85ef70

1 file changed

Lines changed: 1 addition & 55 deletions

File tree

script/build_with_pake_cli.js

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import fs from "fs";
21
import path from "path";
32
import { execa } from "execa";
4-
// We'll call the CLI directly for icon handling
53

64
// Configuration logging
75
const logConfiguration = () => {
@@ -80,59 +78,7 @@ const main = async () => {
8078
const timeout = 900000; // 15 minutes for all builds
8179
await execa("node", params, { stdio: "inherit", timeout });
8280

83-
// Create output directory if it doesn't exist
84-
if (!fs.existsSync("output")) {
85-
fs.mkdirSync("output");
86-
}
87-
88-
// Move built files to output directory more efficiently
89-
const buildPaths = [
90-
`src-tauri/target/release/bundle`,
91-
`src-tauri/target/universal-apple-darwin/release/bundle`,
92-
];
93-
94-
for (const buildPath of buildPaths) {
95-
if (fs.existsSync(buildPath)) {
96-
const bundleFiles = fs
97-
.readdirSync(buildPath, { recursive: true })
98-
.filter((file) => {
99-
const fullPath = path.join(buildPath, file);
100-
return (
101-
fs.statSync(fullPath).isFile() &&
102-
(file.endsWith(".dmg") ||
103-
file.endsWith(".exe") ||
104-
file.endsWith(".deb") ||
105-
file.endsWith(".rpm") ||
106-
file.endsWith(".AppImage"))
107-
);
108-
});
109-
110-
for (const file of bundleFiles) {
111-
const srcPath = path.join(buildPath, file);
112-
const destPath = path.join("output", path.basename(file));
113-
// Use fs.copyFileSync for cross-platform compatibility
114-
fs.copyFileSync(srcPath, destPath);
115-
}
116-
break; // Found files, no need to check other paths
117-
}
118-
}
119-
120-
// Fallback to original method if no bundle files found
121-
const files = fs.readdirSync(".");
122-
const namePattern = new RegExp(`^${process.env.NAME}\\..*$`);
123-
let foundFiles = false;
124-
for (const file of files) {
125-
if (namePattern.test(file)) {
126-
// Use fs for cross-platform file operations
127-
const destPath = path.join("output", file);
128-
fs.renameSync(file, destPath);
129-
foundFiles = true;
130-
}
131-
}
132-
133-
if (!foundFiles) {
134-
console.log("Warning: No output files found matching pattern");
135-
}
81+
// pake-cli will handle file output to its own output directory
13682

13783
console.log("Build Success");
13884
process.chdir("../..");

0 commit comments

Comments
 (0)