Compare commits

..

4 Commits

5 changed files with 61 additions and 47 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "vyla-home",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vyla-home",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-process": "^2.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "vyla-home",
"version": "1.0.0",
"version": "1.0.1",
"description": "Vyla Home Desktop App Launcher",
"main": "main.js",
"scripts": {

View File

@@ -55,48 +55,57 @@ function uploadFileToGitLabPackage(filePath, packageName, version, fileName) {
}
function createGitLabRelease(tag, releaseLinks) {
return new Promise((resolve, reject) => {
let currentRef = 'main';
try {
currentRef = execSync('git rev-parse HEAD').toString().trim();
} catch (e) { }
const sendRequest = (method, path) => {
return new Promise((resolve, reject) => {
let currentRef = 'main';
try {
currentRef = execSync('git rev-parse HEAD').toString().trim();
} catch (e) { }
const postData = JSON.stringify({
name: `Vyla Home Release ${tag}`,
tag_name: tag,
ref: currentRef,
description: `Automated local release ${tag}`,
assets: {
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}`));
const postData = JSON.stringify({
name: `Vyla Home Release ${tag}`,
tag_name: tag,
ref: currentRef,
description: `Automated local release ${tag}`,
assets: {
links: releaseLinks
}
});
});
req.on('error', reject);
req.write(postData);
req.end();
});
const req = https.request({
hostname: 'gitlab.com',
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() {

View File

@@ -1,6 +1,6 @@
[package]
name = "vyla-home"
version = "1.0.0"
version = "1.0.1"
description = "Vyla Home Desktop App Launcher"
edition = "2021"
@@ -9,8 +9,8 @@ tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
tauri-plugin-process = "2"
tauri-plugin-opener = "2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tauri-plugin-process = "2"
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/cli/schema.json",
"productName": "Vyla Home",
"version": "1.0.0",
"version": "1.0.1",
"identifier": "com.vyla.home",
"build": {
"frontendDist": "../ui"
@@ -22,6 +22,11 @@
"icons/icon.icns",
"icons/icon.ico"
],
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper"
}
},
"resources": [
"../main.js",
"../service-manager.js",