This commit is contained in:
2026-09-09 14:39:54 -07:00
parent 82c91334f6
commit feccab9aa1

View File

@@ -32,11 +32,21 @@ function incrementVersion() {
function gitCommitAndTag(version) { function gitCommitAndTag(version) {
try { try {
execSync('git add package.json src-tauri/tauri.conf.json', { stdio: 'inherit' }); execSync('git add package.json src-tauri/tauri.conf.json', { stdio: 'inherit' });
execSync(`git commit -m "chore: release ${version}"`, { stdio: 'inherit' }); try {
execSync(`git tag -a ${version} -m "Release ${version}"`, { stdio: 'inherit' }); 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' }); execSync('git push origin HEAD --tags', { stdio: 'inherit' });
} catch (e) { } 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 payload = assets.payload;
const manifest = assets.manifest; const manifest = assets.manifest;
let branch = 'main';
try {
branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim() || 'main';
} catch (_) { }
const description = [ const description = [
`## Automated Release ${version}`, `## Automated Release ${version}`,
'', '',
@@ -110,6 +125,7 @@ async function createRelease(version, assets) {
const body = JSON.stringify({ const body = JSON.stringify({
name: `Vyla Go Release ${version}`, name: `Vyla Go Release ${version}`,
tag_name: tag, tag_name: tag,
ref: branch,
description, description,
assets: { assets: {
links: [ links: [