mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-20 00:57:22 -05:00
Fix release installer path detection
This commit is contained in:
58
release.js
58
release.js
@@ -180,7 +180,6 @@ async function main() {
|
|||||||
if (isFullBuild) {
|
if (isFullBuild) {
|
||||||
console.log('Ensuring bundled Node.js runtime...');
|
console.log('Ensuring bundled Node.js runtime...');
|
||||||
await ensureBundledNode();
|
await ensureBundledNode();
|
||||||
|
|
||||||
await ensureWebView2Loader();
|
await ensureWebView2Loader();
|
||||||
|
|
||||||
const bundleDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle');
|
const bundleDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle');
|
||||||
@@ -188,41 +187,32 @@ async function main() {
|
|||||||
fs.rmSync(bundleDir, { recursive: true, force: true });
|
fs.rmSync(bundleDir, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Compiling Windows Tauri installer locally...');
|
console.log('Compiling native Tauri application...');
|
||||||
execSync('npm run build', {
|
execSync('npm run build', { stdio: 'inherit' });
|
||||||
stdio: 'inherit'
|
|
||||||
});
|
|
||||||
|
|
||||||
const nsisDir = path.join(__dirname, 'src-tauri/target/release/bundle/nsis');
|
const targetVersion = version.startsWith('v') ? version.substring(1) : version;
|
||||||
if (fs.existsSync(nsisDir)) {
|
|
||||||
const targetVersion = version.startsWith('v') ? version.substring(1) : version;
|
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const nsisDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'nsis');
|
const nsisDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'nsis');
|
||||||
if (fs.existsSync(nsisDir)) {
|
if (fs.existsSync(nsisDir)) {
|
||||||
const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion));
|
const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion));
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
installerPath = path.join(nsisDir, files[0]);
|
installerPath = path.join(nsisDir, files[0]);
|
||||||
installerUploadName = files[0].replace(/\s+/g, '-');
|
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, '-');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion));
|
const dmgDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle', 'dmg');
|
||||||
|
console.log(`Checking for Mac installer in: ${dmgDir}`);
|
||||||
if (files.length > 0) {
|
if (fs.existsSync(dmgDir)) {
|
||||||
const originalName = files[0];
|
const files = fs.readdirSync(dmgDir).filter(f => f.endsWith('.dmg') && f.includes(targetVersion));
|
||||||
installerPath = path.join(nsisDir, originalName);
|
if (files.length > 0) {
|
||||||
installerUploadName = originalName.replace(/\s+/g, '-');
|
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 installerUnique = installerUploadName.replace(ext, `-${timestamp}${ext}`);
|
||||||
const installerUrl = await uploadFileToGitLabPackage(installerPath, 'vyla-home', version, installerUnique);
|
const installerUrl = await uploadFileToGitLabPackage(installerPath, 'vyla-home', version, installerUnique);
|
||||||
releaseLinks.push({ name: installerUploadName, url: installerUrl, link_type: 'package' });
|
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...');
|
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}!`);
|
console.log(`[4/4] Release process successfully completed for ${version}!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user