mirror of
https://gitlab.com/vyla-entertainment/TV.git
synced 2026-11-20 15:05:38 -05:00
fixed release cmd and added md
This commit is contained in:
9
README.md
Normal file
9
README.md
Normal file
@@ -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.
|
||||||
@@ -71,8 +71,11 @@ const manifest = {
|
|||||||
const manifestPath = path.join(distDir, 'manifest.json');
|
const manifestPath = path.join(distDir, 'manifest.json');
|
||||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
||||||
|
|
||||||
spawnSync('git', ['tag', '-a', tag, '-m', `Release ${tag}`], { shell: win, stdio: 'inherit' });
|
const branch = spawnSync('git', ['branch', '--show-current'], { shell: win, encoding: 'utf8' }).stdout.trim() || 'main';
|
||||||
spawnSync('git', ['push', 'origin', tag], { shell: win, stdio: 'inherit' });
|
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 uploadGenericPackage = async (filePath, fileName) => {
|
||||||
const fileBytes = fs.readFileSync(filePath);
|
const fileBytes = fs.readFileSync(filePath);
|
||||||
@@ -98,31 +101,34 @@ const uploadGenericPackage = async (filePath, fileName) => {
|
|||||||
const apkUrl = await uploadGenericPackage(targetApk, targetApkName);
|
const apkUrl = await uploadGenericPackage(targetApk, targetApkName);
|
||||||
const manifestUrl = await uploadGenericPackage(manifestPath, 'manifest.json');
|
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`, {
|
const releaseRes = await fetch(`${gitlabApi}/projects/${projectPath}/releases`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'PRIVATE-TOKEN': token,
|
'PRIVATE-TOKEN': token,
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(releasePayload)
|
||||||
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'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!releaseRes.ok) {
|
if (!releaseRes.ok) {
|
||||||
@@ -130,5 +136,4 @@ if (!releaseRes.ok) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const releaseData = await releaseRes.json();
|
|
||||||
console.log(`\nSuccessfully released ${tag}: https://gitlab.com/vyla-entertainment/TV/-/releases/${tag}`);
|
console.log(`\nSuccessfully released ${tag}: https://gitlab.com/vyla-entertainment/TV/-/releases/${tag}`);
|
||||||
Reference in New Issue
Block a user