mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-20 00:57:22 -05:00
use CI_JOB_TOKEN for release publishing
This commit is contained in:
@@ -96,31 +96,29 @@ build:
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# 2. Build the payload and encrypt credentials
|
|
||||||
- Write-Host "Starting secure build process..."
|
- Write-Host "Starting secure build process..."
|
||||||
- node build-pipeline.js
|
- node build-pipeline.js
|
||||||
|
|
||||||
# 3. Verify Artifacts
|
|
||||||
- |
|
- |
|
||||||
if (Test-Path "update-payload.zip") {
|
if (Test-Path "update-payload.zip") {
|
||||||
Write-Host "✓ Build artifact verified: update-payload.zip exists"
|
Write-Host "Build artifact verified: update-payload.zip exists"
|
||||||
$size = (Get-Item update-payload.zip).Length
|
$size = (Get-Item update-payload.zip).Length
|
||||||
Write-Host " Size: $size bytes"
|
Write-Host " Size: $size bytes"
|
||||||
} else {
|
} else {
|
||||||
Write-Error "✗ Build artifact missing: update-payload.zip"
|
Write-Error "Build artifact missing: update-payload.zip"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path "manifest.json") {
|
if (Test-Path "manifest.json") {
|
||||||
Write-Host "✓ Manifest file verified"
|
Write-Host "Manifest file verified"
|
||||||
Get-Content manifest.json | ConvertFrom-Json | ConvertTo-Json -Depth 10
|
Get-Content manifest.json | ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||||
} else {
|
} else {
|
||||||
Write-Error "✗ Manifest file missing"
|
Write-Error "Manifest file missing"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path "validation-report.json") {
|
if (Test-Path "validation-report.json") {
|
||||||
Write-Host "✓ Validation report verified"
|
Write-Host "Validation report verified"
|
||||||
}
|
}
|
||||||
|
|
||||||
- Write-Host "Packaging Electron application..."
|
- Write-Host "Packaging Electron application..."
|
||||||
@@ -134,7 +132,7 @@ build:
|
|||||||
name = "Vyla Home Release $versionTag"
|
name = "Vyla Home Release $versionTag"
|
||||||
tag_name = "$versionTag"
|
tag_name = "$versionTag"
|
||||||
description = "Automated release for build $versionTag"
|
description = "Automated release for build $versionTag"
|
||||||
ref = "$env:CI_COMMIT_BRANCH"
|
ref = "$env:CI_COMMIT_SHA"
|
||||||
assets = @{
|
assets = @{
|
||||||
links = @(
|
links = @(
|
||||||
@{
|
@{
|
||||||
@@ -154,15 +152,16 @@ build:
|
|||||||
} | ConvertTo-Json -Depth 5
|
} | ConvertTo-Json -Depth 5
|
||||||
|
|
||||||
$releaseHeaders = @{
|
$releaseHeaders = @{
|
||||||
"PRIVATE-TOKEN" = "$env:GITLAB_TOKEN"
|
"JOB-TOKEN" = "$env:CI_JOB_TOKEN"
|
||||||
"Content-Type" = "application/json"
|
"Content-Type" = "application/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$createdRelease = Invoke-RestMethod -Uri "https://gitlab.com/api/v4/projects/vyla-entertainment%2Fhome/releases" -Method Post -Headers $releaseHeaders -Body $releaseBody
|
$createdRelease = Invoke-RestMethod -Uri "https://gitlab.com/api/v4/projects/$env:CI_PROJECT_ID/releases" -Method Post -Headers $releaseHeaders -Body $releaseBody
|
||||||
Write-Host "✓ Release successfully published: $($createdRelease.tag_name)"
|
Write-Host "Release successfully published: $($createdRelease.tag_name)"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Warning "Release creation note: $($_.Exception.Message)"
|
Write-Warning "Release creation failed: $($_.Exception.Message)"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
Reference in New Issue
Block a user