mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-14 06:07:23 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3f9ce4ffd | |||
| d7c60212c2 | |||
| 9de3a6e637 | |||
| d48dc91f53 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vyla-home",
|
"name": "vyla-home",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vyla-home",
|
"name": "vyla-home",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.0.0",
|
"@tauri-apps/api": "^2.0.0",
|
||||||
"@tauri-apps/plugin-process": "^2.0.0",
|
"@tauri-apps/plugin-process": "^2.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vyla-home",
|
"name": "vyla-home",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Vyla Home Desktop App Launcher",
|
"description": "Vyla Home Desktop App Launcher",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
85
release.js
85
release.js
@@ -55,48 +55,57 @@ function uploadFileToGitLabPackage(filePath, packageName, version, fileName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createGitLabRelease(tag, releaseLinks) {
|
function createGitLabRelease(tag, releaseLinks) {
|
||||||
return new Promise((resolve, reject) => {
|
const sendRequest = (method, path) => {
|
||||||
let currentRef = 'main';
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
let currentRef = 'main';
|
||||||
currentRef = execSync('git rev-parse HEAD').toString().trim();
|
try {
|
||||||
} catch (e) { }
|
currentRef = execSync('git rev-parse HEAD').toString().trim();
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
const postData = JSON.stringify({
|
const postData = JSON.stringify({
|
||||||
name: `Vyla Home Release ${tag}`,
|
name: `Vyla Home Release ${tag}`,
|
||||||
tag_name: tag,
|
tag_name: tag,
|
||||||
ref: currentRef,
|
ref: currentRef,
|
||||||
description: `Automated local release ${tag}`,
|
description: `Automated local release ${tag}`,
|
||||||
assets: {
|
assets: {
|
||||||
links: releaseLinks
|
links: releaseLinks
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const req = https.request({
|
|
||||||
hostname: 'gitlab.com',
|
|
||||||
port: 443,
|
|
||||||
path: `/api/v4/projects/${PROJECT_ID}/releases`,
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'PRIVATE-TOKEN': TOKEN,
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Content-Length': Buffer.byteLength(postData)
|
|
||||||
}
|
|
||||||
}, (res) => {
|
|
||||||
let body = '';
|
|
||||||
res.on('data', chunk => body += chunk);
|
|
||||||
res.on('end', () => {
|
|
||||||
if (res.statusCode === 201 || res.statusCode === 200) {
|
|
||||||
resolve(JSON.parse(body));
|
|
||||||
} else {
|
|
||||||
reject(new Error(`Failed to create release (HTTP ${res.statusCode}): ${body}`));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
req.on('error', reject);
|
const req = https.request({
|
||||||
req.write(postData);
|
hostname: 'gitlab.com',
|
||||||
req.end();
|
port: 443,
|
||||||
});
|
path: path,
|
||||||
|
method: method,
|
||||||
|
headers: {
|
||||||
|
'PRIVATE-TOKEN': TOKEN,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Content-Length': Buffer.byteLength(postData)
|
||||||
|
}
|
||||||
|
}, (res) => {
|
||||||
|
let body = '';
|
||||||
|
res.on('data', chunk => body += chunk);
|
||||||
|
res.on('end', () => {
|
||||||
|
if (res.statusCode === 200 || res.statusCode === 201) {
|
||||||
|
resolve(JSON.parse(body));
|
||||||
|
} else if (res.statusCode === 409 && method === 'POST') {
|
||||||
|
console.log(`Release ${tag} already exists, updating assets...`);
|
||||||
|
sendRequest('PUT', `/api/v4/projects/${PROJECT_ID}/releases/${encodeURIComponent(tag)}`)
|
||||||
|
.then(resolve)
|
||||||
|
.catch(reject);
|
||||||
|
} else {
|
||||||
|
reject(new Error(`Failed to publish release (HTTP ${res.statusCode}): ${body}`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
req.on('error', reject);
|
||||||
|
req.write(postData);
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return sendRequest('POST', `/api/v4/projects/${PROJECT_ID}/releases`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "vyla-home"
|
name = "vyla-home"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
description = "Vyla Home Desktop App Launcher"
|
description = "Vyla Home Desktop App Launcher"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -9,8 +9,8 @@ tauri-build = { version = "2", features = [] }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "2", features = [] }
|
tauri = { version = "2", features = [] }
|
||||||
tauri-plugin-shell = "2"
|
|
||||||
tauri-plugin-process = "2"
|
|
||||||
tauri-plugin-opener = "2"
|
tauri-plugin-opener = "2"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
tauri-plugin-process = "2"
|
||||||
serde_json = "1.0"
|
tauri-plugin-shell = "2"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/cli/schema.json",
|
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/cli/schema.json",
|
||||||
"productName": "Vyla Home",
|
"productName": "Vyla Home",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"identifier": "com.vyla.home",
|
"identifier": "com.vyla.home",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../ui"
|
"frontendDist": "../ui"
|
||||||
@@ -22,6 +22,11 @@
|
|||||||
"icons/icon.icns",
|
"icons/icon.icns",
|
||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
|
"windows": {
|
||||||
|
"webviewInstallMode": {
|
||||||
|
"type": "downloadBootstrapper"
|
||||||
|
}
|
||||||
|
},
|
||||||
"resources": [
|
"resources": [
|
||||||
"../main.js",
|
"../main.js",
|
||||||
"../service-manager.js",
|
"../service-manager.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user