From feccab9aa1ced303aa3e17d87c83ede07ab8c8d5 Mon Sep 17 00:00:00 2001 From: alwaysmesmerizingyou Date: Wed, 9 Sep 2026 14:39:54 -0700 Subject: [PATCH] update --- release.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/release.js b/release.js index 0d78ff9..a77a986 100644 --- a/release.js +++ b/release.js @@ -32,11 +32,21 @@ function incrementVersion() { function gitCommitAndTag(version) { try { execSync('git add package.json src-tauri/tauri.conf.json', { stdio: 'inherit' }); - execSync(`git commit -m "chore: release ${version}"`, { stdio: 'inherit' }); - execSync(`git tag -a ${version} -m "Release ${version}"`, { stdio: 'inherit' }); + try { + execSync(`git commit -m "chore: release ${version}"`, { stdio: 'inherit' }); + } catch (_) { + console.log('Working tree clean, skipping commit.'); + } + + try { + execSync(`git tag -a ${version} -m "Release ${version}"`, { stdio: 'inherit' }); + } catch (_) { + console.log(`Tag ${version} already exists locally.`); + } + execSync('git push origin HEAD --tags', { stdio: 'inherit' }); } catch (e) { - console.warn('Git operations failed (non-fatal):', e.message); + console.warn('Git push failed (will fallback to GitLab API ref):', e.message); } } @@ -94,6 +104,11 @@ async function createRelease(version, assets) { const payload = assets.payload; const manifest = assets.manifest; + let branch = 'main'; + try { + branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim() || 'main'; + } catch (_) { } + const description = [ `## Automated Release ${version}`, '', @@ -110,6 +125,7 @@ async function createRelease(version, assets) { const body = JSON.stringify({ name: `Vyla Go Release ${version}`, tag_name: tag, + ref: branch, description, assets: { links: [