mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-18 16:12:57 +05:30
ci: organized build scripts
This commit is contained in:
@@ -5,10 +5,11 @@ import { execSync } from 'child_process';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const projectRoot = path.resolve(__dirname, '..');
|
||||
|
||||
// Define array of binary source directories
|
||||
const binSrcDirs = [
|
||||
path.join(__dirname, 'src-tauri', 'binaries'),
|
||||
path.join(projectRoot, 'src-tauri', 'binaries'),
|
||||
];
|
||||
|
||||
function makeFilesExecutable() {
|
||||
@@ -34,7 +35,7 @@ function makeFilesExecutable() {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console.log(`Successfully made ${count} files executable in ${binSrc}`);
|
||||
totalCount += count;
|
||||
successDirs++;
|
||||
@@ -46,5 +47,5 @@ function makeFilesExecutable() {
|
||||
console.log(`\nSummary: Made ${totalCount} files executable across ${successDirs} directories`);
|
||||
}
|
||||
|
||||
console.log(`RUNNING: 🛠️ Build Script makeFilesExecutable.js`);
|
||||
makeFilesExecutable();
|
||||
console.log(`RUNNING: 🛠️ Build Script --> chmod.js`);
|
||||
makeFilesExecutable();
|
||||
@@ -5,8 +5,9 @@ import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const projectRoot = path.resolve(__dirname, '..');
|
||||
|
||||
console.log(`RUNNING: 🛠️ Build Script updateYtDlpBinary.js`);
|
||||
console.log(`RUNNING: 🛠️ Build Script --> update-yt-dlp.js`);
|
||||
|
||||
// Get the platform triple from command line arguments
|
||||
const platformTriple = process.argv[2];
|
||||
@@ -17,7 +18,7 @@ if (!platformTriple) {
|
||||
}
|
||||
|
||||
// Define the binaries directory
|
||||
const binariesDir = path.join(__dirname, 'src-tauri', 'binaries');
|
||||
const binariesDir = path.join(projectRoot, 'src-tauri', 'binaries');
|
||||
|
||||
// Construct the binary filename based on platform triple
|
||||
let binaryName = `yt-dlp-${platformTriple}`;
|
||||
@@ -50,7 +51,7 @@ execFile(binaryPath, ['--update-to', 'nightly'], (error, stdout, stderr) => {
|
||||
if (stderr) console.error(stderr);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
console.log(`Update successful for ${platformTriple}:`);
|
||||
console.log(stdout);
|
||||
});
|
||||
});
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"identifier": "com.neosubhamoy.neodlp",
|
||||
"build": {
|
||||
"beforeDevCommand": "cargo build --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build",
|
||||
"beforeDevCommand": "cargo build --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"identifier": "com.neosubhamoy.neodlp",
|
||||
"build": {
|
||||
"beforeDevCommand": "cargo build --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build",
|
||||
"beforeDevCommand": "cargo build --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"identifier": "com.neosubhamoy.neodlp",
|
||||
"build": {
|
||||
"beforeDevCommand": "cargo build --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build",
|
||||
"beforeDevCommand": "cargo build --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"identifier": "com.neosubhamoy.neodlp",
|
||||
"build": {
|
||||
"beforeDevCommand": "cargo build --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build",
|
||||
"beforeDevCommand": "cargo build --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev",
|
||||
"beforeBuildCommand": "cargo build --release --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user