This directory contains helper scripts for the Zed Windows build process.
PowerShell script that processes Rust compilation flags for the build process.
Purpose:
- Parses Rust flags passed as arguments
- Sets up the build environment for different backends (Vulkan/OpenGL)
- Configures conditional compilation flags in
.cargo/config.toml
Usage:
./scripts/Parse-Rustflags.ps1 "--cfg gles"Requirements:
- PowerShell Core or Windows PowerShell
- PSToml module (for TOML file manipulation)
- Existing
.cargo/config.tomlfile
Main script that prepares release files from build artifacts. Handles partial build failures gracefully.
Features:
- Creates a
release/directory for all output files - Processes Vulkan build (
zed.exe) and creates zip if available - Processes OpenGL build (
zed-opengl.exe) and creates zip if available - Generates SHA256 checksums for all release files
- Fails fast if no build artifacts are found
- Uses wildcards for clean file handling
Usage:
./scripts/prepare-release.shInput:
artifacts/zed-release/zed.exe(Vulkan build)artifacts/zed-release-opengl/zed.exe(OpenGL build)
Output:
release/zed.exeandrelease/zed.zip(if Vulkan build exists)release/zed-opengl.exeandrelease/zed-opengl.zip(if OpenGL build exists)release/sha256sums.txt(checksums for all files)
Requirements:
zipcommand availablesha256sumcommand available
Comprehensive test suite for prepare-release.sh with full scenario coverage.
Test Scenarios:
- ✅ Both Vulkan and OpenGL builds present (5 files expected)
- ✅ Only Vulkan build present (3 files expected)
- ✅ Only OpenGL build present (3 files expected)
- ❌ No builds present (should fail with clear error)
- ✅ Checksum validation (verify SHA256 accuracy)
- ✅ Zip file content verification
Usage:
./scripts/test-prepare-release.shRequirements:
prepare-release.shin the same directoryunzipcommand for zip content verification- Temporary directory support (
mktemp)
To run the tests:
cd zed-windows-builds
./scripts/test-prepare-release.shThe test script will create temporary directories and verify that the release preparation script works correctly in all scenarios.
You can test the workflows locally using act:
# Install act (if not already installed)
# On macOS with Homebrew:
brew install act
# Or follow installation instructions at: https://github.com/nektos/act# Test the script unit tests
act -W .github/workflows/test.yml
# Test the integration workflows
act -W .github/workflows/test-integration.yml
# Test a specific job
act -j test-no-artifacts-failure -W .github/workflows/test-integration.yml
# Test partial failure scenarios
act -j test-partial-failure-scenarios -W .github/workflows/test-integration.ymlThe repository includes a .actrc file with optimal settings for testing:
- Uses
linux/amd64architecture for compatibility - Uses
catthehacker/ubuntu:act-latestimage with all required tools
- Script Logic: All branches and error conditions
- File Handling: Artifact processing and release file creation
- Checksums: SHA256 verification of all files
- Partial Failures: Vulkan-only, OpenGL-only, and both-builds scenarios
- Error Cases: No artifacts present (should fail gracefully)
The prepare-release.sh script is used in the GitHub Actions workflow (.github/workflows/release.yml) to handle partial build failures gracefully. It ensures that releases are created even if only one of the two build variants (Vulkan or OpenGL) succeeds.