Build Zed Nightly #214
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Zed Nightly | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs every night at midnight UTC | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
backend: [vulkan, opengl] | |
include: | |
- backend: vulkan | |
artifact_name: zed-release | |
rustflags: "" | |
- backend: opengl | |
artifact_name: zed-release-opengl | |
rustflags: "--cfg gles" | |
steps: | |
- name: Enable long paths in Git | |
run: | | |
git config --system core.longpaths true | |
- name: Enable long paths in Windows | |
shell: powershell | |
run: | | |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` | |
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force | |
- name: Checkout self | |
uses: actions/checkout@v4 | |
- name: Checkout Zed | |
uses: actions/checkout@v4 | |
with: | |
repository: zed-industries/zed | |
ref: main | |
path: zed | |
- name: Install rust nightly | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
override: true | |
target: wasm32-wasip1 | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
with: | |
key: ${{ matrix.backend }} | |
workspaces: "zed -> target" | |
- name: Setup rustflags | |
run: pwsh ./Parse-Rustflags.ps1 ${{ matrix.rustflags }} | |
- name: Build release | |
working-directory: zed | |
run: cargo build --release | |
- name: Archive build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: zed/target/release/zed.exe | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
steps: | |
- name: Download release artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Get the current date | |
id: date | |
run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Create release directories and zip | |
run: | | |
mkdir -p zed-release zed-release-opengl | |
mv artifacts/zed-release/zed.exe zed-release/ | |
mv artifacts/zed-release-opengl/zed.exe zed-release-opengl/ | |
zip -r zed-windows.zip zed-release/* | |
zip -r zed-windows-opengl.zip zed-release-opengl/* | |
- name: Upload release build artifacts to GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.CURRENT_DATE }} | |
tag_name: ${{ env.CURRENT_DATE }} | |
draft: false | |
make_latest: true | |
files: | | |
zed-windows.zip | |
zed-windows-opengl.zip |