Skip to content

Zed Windows Build

Zed Windows Build #17

Workflow file for this run

name: build
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build-windows-amd64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
repository: zed-industries/zed
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add wasm32-wasi
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
C:\Users\runneradmin\.cargo\registry\
C:\Users\runneradmin\.cargo\git\
C:\Users\runneradmin\.rustup\
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo build --release -j 4
- run: copy target\release\Zed.exe target\release\Zed-windows-amd64.exe
- name: Rename executable with version
run: |
move target\release\Zed-windows-amd64.exe target\release\Zed-windows-amd64-${{ env.NEXT_VER_CODE }}.exe
- uses: actions/upload-artifact@v4
with:
name: Zed-windows-amd64-${{ env.NEXT_VER_CODE }}
path: target\release\Zed-windows-amd64-${{ env.NEXT_VER_CODE }}.exe
upload-to-release:
runs-on: ubuntu-latest
needs: [build-windows-amd64]
steps:
- uses: actions/download-artifact@v4
with:
pattern: Zed-*
merge-multiple: true
- name: Get latest Zed release info
id: zed_release
run: |
RELEASE_INFO=$(curl -s https://api.github.com/repos/zed-industries/zed/releases/latest)
RELEASE_BODY=$(echo "$RELEASE_INFO" | jq -r '.body | @base64')
echo "RELEASE_BODY=$RELEASE_BODY" >> $GITHUB_OUTPUT
- name: Set release info
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
echo "RELEASE_NAME=Zed Windows Prerelease 🎉 ${{ env.NEXT_VER_CODE }}" >> $GITHUB_ENV
echo "NEXT_VER_CODE=pre-${{ env.NEXT_VER_CODE }}" >> $GITHUB_ENV
else
echo "RELEASE_NAME=Zed Windows 🎉 ${{ env.NEXT_VER_CODE }}" >> $GITHUB_ENV
echo "NEXT_VER_CODE=${{ env.NEXT_VER_CODE }}" >> $GITHUB_ENV
fi
- name: Upload modules to release
uses: svenstaro/upload-release-action@v2
with:
release_name: ${{ env.RELEASE_NAME }}
tag: ${{ env.NEXT_VER_CODE }}
body: ${{ steps.zed_release.outputs.RELEASE_BODY }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Zed-windows-amd64-${{ env.NEXT_VER_CODE }}.exe
overwrite: true
- uses: actions/checkout@v4
with:
repository: yannouuuu/zed-windows-build
fetch-depth: 0
- uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: update
file_pattern: build.md *-update.json
commit_message: Bump version ${{ env.NEXT_VER_CODE }}