1# Builds Zed and remote_server binaries and uploads debug symbols to Sentry.
2# Intended for re-uploading symbols for releases where the original upload
3# failed or the files were corrupted.
4#
5# Usage: script/upload-sentry-symbols.ps1 [-Verify]
6#
7# Environment:
8# SENTRY_AUTH_TOKEN (required) Sentry authentication token
9
10[CmdletBinding()]
11Param(
12 [Parameter()][switch]$Verify
13)
14
15. "$PSScriptRoot/lib/sentry-upload.ps1"
16
17$ErrorActionPreference = 'Stop'
18$PSNativeCommandUseErrorActionPreference = $true
19
20if (-not (Test-Path "env:SENTRY_AUTH_TOKEN")) {
21 Write-Error "SENTRY_AUTH_TOKEN is required"
22}
23
24if (-not (Get-Command "sentry-cli" -ErrorAction SilentlyContinue)) {
25 Write-Error "sentry-cli is not installed. Install with: winget install -e --id=Sentry.sentry-cli"
26}
27
28$target_dir = if ($env:CARGO_TARGET_DIR) { $env:CARGO_TARGET_DIR } else { "target" }
29
30Write-Output "==> Building zed and cli (release)..."
31cargo build --release --package zed --package cli
32
33Write-Output "==> Building remote_server (release)..."
34cargo build --release --package remote_server
35
36Write-Output "==> Uploading debug symbols to Sentry..."
37Upload-ToSentry -Paths @($target_dir)
38
39Write-Output "==> Done."