Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

feat: introduce cache-key per matrix build_type #15

feat: introduce cache-key per matrix build_type

feat: introduce cache-key per matrix build_type #15

Workflow file for this run

name: Build and Release Zed for Windows (Nightly)
on:
push:
branches:
- main
paths:
- ".github/workflows/nightly.yml"
schedule:
- cron: "0 11 * * *"
workflow_dispatch:
inputs:
manual_release:
description: "Manual release?"
required: true
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.date.outputs.date }}
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
build:
needs: check
runs-on: windows-latest
strategy:
matrix:
build_type: [vulkan, opengl]
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 Zed
uses: actions/checkout@v4
with:
repository: zed-industries/zed
ref: nightly
- name: Get toolchain channel
id: toolchain
shell: powershell
run: |
$channel = (Get-Content rust-toolchain.toml | Select-String -Pattern 'channel' | ForEach-Object { ($_ -split '"')[1] })
echo "channel=$channel" >> $GITHUB_OUTPUT
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ matrix.build_type }}
toolchain: ${{ steps.toolchain.outputs.channel }}
target: "wasm32-wasip1"
components: "rustfmt, clippy"
- name: Build to ${{ matrix.build_type }}
shell: powershell
run: |
$env:RUSTFLAGS="--cfg ${{ matrix.build_type }}"
$env:ZED_UPDATE_EXPLANATION="Auto-updater is disabled for this build (xarunoba/zed-windows)"
cargo build --release
- name: Archive ${{ matrix.build_type }} build
uses: actions/upload-artifact@v4
with:
name: zed-nightly-${{ matrix.build_type }}
path: target/release/zed.exe
release:
needs: [check, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Vulkan release artifact
uses: actions/download-artifact@v4
with:
name: zed-nightly-vulkan
path: zed-vulkan
- name: Download OpenGL ES release artifact
uses: actions/download-artifact@v4
with:
name: zed-nightly-opengl
path: zed-opengl
- name: Zip the Vulkan build
working-directory: zed-vulkan
run: zip ../zed-nightly-vulkan-${{ needs.check.outputs.date }}.zip zed.exe
- name: Zip the OpenGL ES build
working-directory: zed-opengl
run: zip ../zed-nightly-opengl-${{ needs.check.outputs.date }}.zip zed.exe
- name: Calculate SHA256 checksum
run: |
sha256sum zed-nightly-vulkan-${{ needs.check.outputs.date }}.zip > zed-nightly-vulkan-${{ needs.check.outputs.date }}.zip.sha256
sha256sum zed-nightly-opengl-${{ needs.check.outputs.date }}.zip > zed-nightly-opengl-${{ needs.check.outputs.date }}.zip.sha256
- name: Get Tag Information
id: tag_info
run: |
tag_info=$(curl -s "https://api.github.com/repos/zed-industries/zed/git/refs/tags/nightly" | jq -r .object.sha)
echo "tag_info=$tag_info" >> $GITHUB_OUTPUT
- name: Generate Release Notes from Zed
run: curl -s "https://api.github.com/repos/zed-industries/zed/git/commits/${{ steps.tag_info.outputs.tag_info }}" | jq -r .message > CHANGELOG.txt
- name: Generate Changelog
run: echo "\n---\nSee [Zed release note](https://github.com/zed-industries/zed/releases/tag/nightly) for more information." > CHANGELOG.txt
- name: Upload release build artifact to GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Zed for Windows (Nightly) ${{ needs.check.outputs.date }}
body_path: CHANGELOG.txt
tag_name: v${{ needs.check.outputs.date }}-nightly
draft: false
prerelease: true
make_latest: false
fail_on_unmatched_files: true
files: |
zed-nightly-vulkan-${{ needs.check.outputs.date }}.zip
zed-nightly-vulkan-${{ needs.check.outputs.date }}.zip.sha256
zed-nightly-opengl-${{ needs.check.outputs.date }}.zip
zed-nightly-opengl-${{ needs.check.outputs.date }}.zip.sha256