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