diff --git a/release.js b/release.js index f56da77..49b13d9 100644 --- a/release.js +++ b/release.js @@ -180,7 +180,6 @@ async function main() { if (isFullBuild) { console.log('Ensuring bundled Node.js runtime...'); await ensureBundledNode(); - await ensureWebView2Loader(); const bundleDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle'); @@ -188,41 +187,32 @@ async function main() { fs.rmSync(bundleDir, { recursive: true, force: true }); } - console.log('Compiling Windows Tauri installer locally...'); - execSync('npm run build', { - stdio: 'inherit' - }); + console.log('Compiling native Tauri application...'); + execSync('npm run build', { stdio: 'inherit' }); - const nsisDir = path.join(__dirname, 'src-tauri/target/release/bundle/nsis'); - if (fs.existsSync(nsisDir)) { - const targetVersion = version.startsWith('v') ? version.substring(1) : version; + const targetVersion = version.startsWith('v') ? version.substring(1) : version; - if (process.platform === 'win32') { - const nsisDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'nsis'); - if (fs.existsSync(nsisDir)) { - const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion)); - if (files.length > 0) { - installerPath = path.join(nsisDir, files[0]); - installerUploadName = files[0].replace(/\s+/g, '-'); - } - } - } else { - const dmgDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'dmg'); - if (fs.existsSync(dmgDir)) { - const files = fs.readdirSync(dmgDir).filter(f => f.endsWith('.dmg') && f.includes(targetVersion)); - if (files.length > 0) { - installerPath = path.join(dmgDir, files[0]); - installerUploadName = files[0].replace(/\s+/g, '-'); - } + if (process.platform === 'win32') { + const nsisDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'nsis'); + if (fs.existsSync(nsisDir)) { + const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion)); + if (files.length > 0) { + installerPath = path.join(nsisDir, files[0]); + installerUploadName = files[0].replace(/\s+/g, '-'); } } - - const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion)); - - if (files.length > 0) { - const originalName = files[0]; - installerPath = path.join(nsisDir, originalName); - installerUploadName = originalName.replace(/\s+/g, '-'); + } else { + const dmgDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'dmg'); + console.log(`Checking for Mac installer in: ${dmgDir}`); + if (fs.existsSync(dmgDir)) { + const files = fs.readdirSync(dmgDir).filter(f => f.endsWith('.dmg') && f.includes(targetVersion)); + if (files.length > 0) { + installerPath = path.join(dmgDir, files[0]); + installerUploadName = files[0].replace(/\s+/g, '-'); + console.log(`Found Mac installer: ${installerUploadName}`); + } else { + console.log(`[WARNING] No .dmg found containing version ${targetVersion}`); + } } } } @@ -247,10 +237,12 @@ async function main() { const installerUnique = installerUploadName.replace(ext, `-${timestamp}${ext}`); const installerUrl = await uploadFileToGitLabPackage(installerPath, 'vyla-home', version, installerUnique); releaseLinks.push({ name: installerUploadName, url: installerUrl, link_type: 'package' }); + } else { + console.log(`[WARNING] No installer was selected for upload! (isFullBuild: ${isFullBuild})`); } console.log('[3/4] Publishing GitLab Release...'); - const release = await createGitLabRelease(version, releaseLinks); + await createGitLabRelease(version, releaseLinks); console.log(`[4/4] Release process successfully completed for ${version}!`); }