This repository was archived by the owner on Oct 16, 2025. It is now read-only.
Build Zed Latest Release #378
This file contains hidden or 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 Latest Release | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" # Runs every night at midnight UTC | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| latest_tag: ${{ steps.get_latest_tag.outputs.latest_tag }} | |
| proceed: ${{ steps.compare.outputs.proceed }} | |
| steps: | |
| - name: Get latest Zed release tag | |
| id: get_latest_tag | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| latestTag=$(gh release list -R zed-industries/zed -L 10 --json tagName,isLatest -q '.[] | select(.isLatest == true) | select(.tagName | startswith("v")) | .tagName') | |
| echo "Latest Zed release tag: $latestTag" | |
| echo "latest_tag=$latestTag" >> $GITHUB_OUTPUT | |
| - name: Get our latest release name | |
| id: get_our_release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| ourLatestRelease=$(gh release list -R ${{ github.repository }} -L 10 --json tagName,isLatest -q '.[] | select(.isLatest == true) | select(.tagName | startswith("v")) | .tagName') | |
| echo "Our latest release: $ourLatestRelease" | |
| echo "OUR_LATEST_RELEASE=$ourLatestRelease" >> $GITHUB_ENV | |
| - name: Compare releases | |
| id: compare | |
| run: | | |
| if [ -z "${{ steps.get_latest_tag.outputs.latest_tag }}" ] || [ "${{ env.OUR_LATEST_RELEASE }}" = "${{ steps.get_latest_tag.outputs.latest_tag }}" ]; then | |
| echo "Our latest release matches Zed's latest tag. Stopping workflow." | |
| echo "proceed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Proceeding with build for Zed's latest tag: ${{ steps.get_latest_tag.outputs.latest_tag }}" | |
| echo "proceed=true" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| needs: check | |
| runs-on: windows-latest | |
| if: needs.check.outputs.proceed == 'true' | |
| 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 repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: zed-industries/zed | |
| ref: ${{ needs.check.outputs.latest_tag }} | |
| fetch-depth: 1 | |
| - name: Set up for build | |
| shell: powershell | |
| run: | | |
| Write-Output "Ready to build ${{ needs.check.outputs.latest_tag }}" | |
| if (Test-Path ".cargo/config.toml") { | |
| $configString = "[profile.release]`n debug = false`n lto = `"fat`"`n opt-level = 3`n codegen-units = 1`n panic = `"abort`"`n strip = true" | |
| Write-Output "Configuration string: $configString" | |
| $configString | Add-Content .cargo/config.toml | |
| Write-Output "Successfully appended build parameters to .cargo/config.toml" | |
| Get-Content .cargo/config.toml | |
| } else { | |
| Write-Output "Error: .cargo/config.toml file does not exist" | |
| } | |
| - name: Install rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| target: wasm32-wasip1 | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2.7.3 | |
| - name: Build release | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release | |
| - name: Archive build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zed-release | |
| path: target/release/zed.exe | |
| create_installer: | |
| needs: [check, build] | |
| runs-on: windows-latest | |
| if: needs.check.outputs.proceed == 'true' | |
| steps: | |
| - name: Checkout our repository | |
| uses: actions/checkout@v3 | |
| - name: Download Zed build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zed-release | |
| path: zed-release | |
| - name: Update Inno Setup script version | |
| run: | | |
| $content = Get-Content -Path zed_setup.iss -Raw | |
| $newContent = $content -replace '#define MyAppVersion ".*"', '#define MyAppVersion "${{ needs.check.outputs.latest_tag }}"' | |
| $newContent | Set-Content -Path zed_setup.iss -NoNewline | |
| - name: Compile Setup Wizard | |
| uses: Minionguyjpro/Inno-Setup-Action@v1.2.2 | |
| with: | |
| path: zed_setup.iss | |
| options: /O+ | |
| - name: Upload Inno Setup Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zed-installer | |
| path: Output/ZedInstaller-${{ needs.check.outputs.latest_tag }}.exe | |
| release: | |
| needs: [check, build, create_installer] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: needs.check.outputs.proceed == 'true' | |
| steps: | |
| - name: Download Inno Setup Installer | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zed-installer | |
| path: zed-installer | |
| - name: Download non-installer executable | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zed-release | |
| path: zed-release | |
| - name: Zip the non-installer executable | |
| run: zip zed-${{ needs.check.outputs.latest_tag }}.zip zed-release/zed.exe | |
| - name: Upload release artifacts to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ needs.check.outputs.latest_tag }} | |
| tag_name: ${{ needs.check.outputs.latest_tag }} | |
| draft: false | |
| make_latest: true | |
| files: | | |
| zed-installer/ZedInstaller-${{ needs.check.outputs.latest_tag }}.exe | |
| zed-${{ needs.check.outputs.latest_tag }}.zip |