diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7c0bc8 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Vyla TV + +Vyla TV is an Android TV application built with HTML, CSS, JavaScript, and Capacitor. + +## Prerequisites + +- **Node.js**: v18+ or v20+ +- **JDK**: Java Development Kit 17 +- **Android SDK**: Installed via Android Studio with `ANDROID_HOME` configured in your environment variables. \ No newline at end of file diff --git a/scripts/release.mjs b/scripts/release.mjs index d26db99..fb6a801 100644 --- a/scripts/release.mjs +++ b/scripts/release.mjs @@ -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}`); \ No newline at end of file