fixed release cmd and added md

This commit is contained in:
2026-10-04 21:59:02 -07:00
parent 488fe99efb
commit 4c17c9a43c
2 changed files with 36 additions and 22 deletions

View File

@@ -71,8 +71,11 @@ const manifest = {
const manifestPath = path.join(distDir, 'manifest.json');
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
spawnSync('git', ['tag', '-a', tag, '-m', `Release ${tag}`], { shell: win, stdio: 'inherit' });
spawnSync('git', ['push', 'origin', tag], { shell: win, stdio: 'inherit' });
const branch = spawnSync('git', ['branch', '--show-current'], { shell: win, encoding: 'utf8' }).stdout.trim() || 'main';
const commitSha = spawnSync('git', ['rev-parse', 'HEAD'], { shell: win, encoding: 'utf8' }).stdout.trim();
spawnSync('git', ['tag', '-fa', tag, '-m', `Release ${tag}`], { shell: win, stdio: 'inherit' });
spawnSync('git', ['push', 'origin', tag, '--force'], { shell: win, stdio: 'inherit' });
const uploadGenericPackage = async (filePath, fileName) => {
const fileBytes = fs.readFileSync(filePath);
@@ -98,31 +101,34 @@ const uploadGenericPackage = async (filePath, fileName) => {
const apkUrl = await uploadGenericPackage(targetApk, targetApkName);
const manifestUrl = await uploadGenericPackage(manifestPath, 'manifest.json');
const releasePayload = {
name: `Vyla TV Release ${tag}`,
tag_name: tag,
ref: commitSha || branch,
description: `Automated Release ${tag}`,
assets: {
links: [
{
name: targetApkName,
url: apkUrl,
link_type: 'package'
},
{
name: 'manifest.json',
url: manifestUrl,
link_type: 'other'
}
]
}
};
const releaseRes = await fetch(`${gitlabApi}/projects/${projectPath}/releases`, {
method: 'POST',
headers: {
'PRIVATE-TOKEN': token,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: `Vyla TV Release ${tag}`,
tag_name: tag,
description: `Automated Release ${tag}`,
assets: {
links: [
{
name: targetApkName,
url: apkUrl,
link_type: 'package'
},
{
name: 'manifest.json',
url: manifestUrl,
link_type: 'other'
}
]
}
})
body: JSON.stringify(releasePayload)
});
if (!releaseRes.ok) {
@@ -130,5 +136,4 @@ if (!releaseRes.ok) {
process.exit(1);
}
const releaseData = await releaseRes.json();
console.log(`\nSuccessfully released ${tag}: https://gitlab.com/vyla-entertainment/TV/-/releases/${tag}`);