Skip to content

Commit 199a436

Browse files
committed
improvements
1 parent 26706bb commit 199a436

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,21 @@ jobs:
128128
shell: pwsh
129129
$ErrorActionPreference = "Stop"
130130

131+
# The Update-AppCast.ps1 script fetches the release notes from GitHub,
132+
# which might take a few seconds to be ready.
133+
Start-Sleep -Seconds 10
134+
135+
# Save the appcast signing key to a temporary file.
131136
$keyPath = Join-Path $env:TEMP "appcast-key.pem"
132137
$key = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($env:APPCAST_SIGNATURE_KEY_BASE64))
133138
Set-Content -Path $keyPath -Value $key
134139

140+
# Download the old appcast from GCS.
135141
$oldAppCastPath = Join-Path $env:TEMP "appcast.old.xml"
136142
& gsutil cp $env:APPCAST_GCS_URI $oldAppCastPath
137143
if ($LASTEXITCODE -ne 0) { throw "Failed to download appcast" }
138144

145+
# Generate the new appcast and signature.
139146
$newAppCastPath = Join-Path $env:TEMP "appcast.new.xml"
140147
$newAppCastSignaturePath = $newAppCastPath + ".signature"
141148
& ./scripts/Update-AppCast.ps1 `
@@ -150,6 +157,7 @@ jobs:
150157
-outputAppCastSignaturePath $newAppCastSignaturePath
151158
if ($LASTEXITCODE -ne 0) { throw "Failed to generate new appcast" }
152159

160+
# Upload the new appcast and signature to GCS.
153161
& gsutil cp $newAppCastPath $env:APPCAST_GCS_URI
154162
if ($LASTEXITCODE -ne 0) { throw "Failed to upload new appcast" }
155163
& gsutil cp $newAppCastSignaturePath $env:APPCAST_SIGNATURE_GCS_URI

scripts/Update-AppCast.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
# -outputAppCastSignaturePath <path>
1616
param (
1717
[Parameter(Mandatory = $true)]
18+
[ValidatePattern("^v\d+\.\d+\.\d+$")]
1819
[string] $tag,
1920

2021
[Parameter(Mandatory = $true)]
22+
[ValidatePattern("^\d+\.\d+\.\d+$")]
2123
[string] $version,
2224

2325
[Parameter(Mandatory = $true)]

0 commit comments

Comments
 (0)