diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index a6cfd9c43b55c2cd57bb4b87485ddc1b82f0b82a..a4f86de39e3eed20dac969a9542b4d2b9edef822 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -281,11 +281,11 @@ jobs: - name: Build Zed installer working-directory: ${{ env.ZED_WORKSPACE }} - run: script/bundle-windows.ps1 + run: script/bundle-windows.ps1 -Architecture x86_64 - name: Upload Zed Nightly working-directory: ${{ env.ZED_WORKSPACE }} - run: script/upload-nightly.ps1 windows + run: script/upload-nightly.ps1 -Architecture x86_64 bundle-windows-arm64: timeout-minutes: 60 @@ -328,7 +328,7 @@ jobs: - name: Upload Zed Nightly working-directory: ${{ env.ZED_WORKSPACE }} - run: script/upload-nightly.ps1 windows + run: script/upload-nightly.ps1 -Architecture aarch64 update-nightly-tag: name: Update nightly tag diff --git a/script/upload-nightly.ps1 b/script/upload-nightly.ps1 index 94f00ae9084a991669201281bdcd6110521fb50a..deec4baecc9274381b4d3f99e611190ab0865636 100644 --- a/script/upload-nightly.ps1 +++ b/script/upload-nightly.ps1 @@ -1,32 +1,13 @@ +[CmdletBinding()] +Param( + [Parameter()][string]$Architecture +) + # Based on the template in: https://docs.digitalocean.com/reference/api/spaces-api/ $ErrorActionPreference = "Stop" . "$PSScriptRoot\lib\blob-store.ps1" . "$PSScriptRoot\lib\workspace.ps1" -$allowedTargets = @("windows") - -function Test-AllowedTarget { - param ( - [string]$Target - ) - - return $allowedTargets -contains $Target -} - -# Process arguments -if ($args.Count -gt 0) { - $target = $args[0] - if (Test-AllowedTarget $target) { - # Valid target - } else { - Write-Error "Error: Target '$target' is not allowed.`nUsage: $($MyInvocation.MyCommand.Name) [$($allowedTargets -join ', ')]" - exit 1 - } -} else { - Write-Error "Error: Target is not specified.`nUsage: $($MyInvocation.MyCommand.Name) [$($allowedTargets -join ', ')]" - exit 1 -} - ParseZedWorkspace Write-Host "Uploading nightly for target: $target" @@ -44,17 +25,8 @@ $sha | Out-File -FilePath "target/latest-sha" -NoNewline # Remove-Item -Path $file.FullName # } -switch ($target) { - "windows" { - UploadToBlobStore -BucketName $bucketName -FileToUpload $env:SETUP_PATH -BlobStoreKey "nightly/Zed-x86_64.exe" - UploadToBlobStore -BucketName $bucketName -FileToUpload "target/latest-sha" -BlobStoreKey "nightly/latest-sha-windows" - - Remove-Item -Path $env:SETUP_PATH -ErrorAction SilentlyContinue - Remove-Item -Path "target/latest-sha" -ErrorAction SilentlyContinue - } +UploadToBlobStore -BucketName $bucketName -FileToUpload "target/Zed-$Architecture.exe" -BlobStoreKey "nightly/Zed-$Architecture.exe" +UploadToBlobStore -BucketName $bucketName -FileToUpload "target/latest-sha" -BlobStoreKey "nightly/latest-sha-windows" - default { - Write-Error "Error: Unknown target '$target'" - exit 1 - } -} +Remove-Item -Path "target/Zed-$Architecture.exe" -ErrorAction SilentlyContinue +Remove-Item -Path "target/latest-sha" -ErrorAction SilentlyContinue