@@ -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
0 commit comments