Signing, Installer, New Workflows
This commit is contained in:
37
flutter_app/encode_certificate.ps1
Normal file
37
flutter_app/encode_certificate.ps1
Normal file
@@ -0,0 +1,37 @@
|
||||
# Encode Certificate for CI/CD
|
||||
# Converts the PFX certificate to base64 for use as GitHub/Gitea action secret
|
||||
|
||||
param(
|
||||
[string]$CertPath = "certificates\rmtPocketWatcher.pfx",
|
||||
[string]$OutputFile = "certificate_base64.txt"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "Encoding Certificate for CI/CD" -ForegroundColor Green
|
||||
Write-Host "==============================" -ForegroundColor Green
|
||||
|
||||
# Check if certificate exists
|
||||
if (-not (Test-Path $CertPath)) {
|
||||
Write-Error "Certificate not found at: $CertPath"
|
||||
Write-Host "Create a certificate first using .\create_certificate.ps1" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Read certificate and encode as base64
|
||||
Write-Host "Reading certificate: $CertPath" -ForegroundColor Yellow
|
||||
$certBytes = [System.IO.File]::ReadAllBytes((Resolve-Path $CertPath))
|
||||
$certBase64 = [System.Convert]::ToBase64String($certBytes)
|
||||
|
||||
# Save to file
|
||||
$certBase64 | Out-File -FilePath $OutputFile -Encoding ASCII -NoNewline
|
||||
|
||||
Write-Host "✅ Certificate encoded successfully!" -ForegroundColor Green
|
||||
Write-Host "Base64 encoded certificate saved to: $OutputFile" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Next steps:" -ForegroundColor Yellow
|
||||
Write-Host "1. Copy the contents of $OutputFile" -ForegroundColor White
|
||||
Write-Host "2. Add as action secret named 'CERT_BASE64'" -ForegroundColor White
|
||||
Write-Host "3. Add certificate password as secret named 'CERT_PASSWORD'" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "⚠️ IMPORTANT: Delete $OutputFile after copying to keep certificate secure!" -ForegroundColor Red
|
||||
Reference in New Issue
Block a user