Skip to content

Zed Windows Build

Zed Windows Build #12

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/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo build --release
- run: copy target\release\Zed.exe target\release\Zed-windows-amd64.exe
- uses: actions/upload-artifact@v4
with:
name: Zed-windows-amd64
path: target\release\Zed-windows-amd64.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 current date
id: get_date
run: |
echo "DATE=$(date +'%m-%d-%Y')" >> $GITHUB_ENV
- name: Set next version tag
id: next_ver_code
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/zed-industries/zed/releases/latest | jq -r .tag_name)
echo "NEXT_VER_CODE=$LATEST_TAG" >> $GITHUB_ENV
- name: List build artifacts
run: |
echo "Contents of current directory:"
ls -R
- name: Set release info
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
echo "RELEASE_NAME=Zed Windows Prerelease - ${{ env.DATE }}" >> $GITHUB_ENV
echo "NEXT_VER_CODE=pre-${{ env.NEXT_VER_CODE }}" >> $GITHUB_ENV
else
echo "RELEASE_NAME=Zed Windows - ${{ env.DATE }}" >> $GITHUB_ENV
fi
- name: Upload modules to release
uses: svenstaro/upload-release-action@v2
with:
release_name: Zed Windows - ${{ env.RELEASE_NAME }}
tag: ${{ env.NEXT_VER_CODE }}
body: ${{ steps.get_output.outputs.BUILD_LOG }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Zed-windows-amd64.exe
overwrite: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: update
skip_checkout: true
file_pattern: build.md *-update.json
commit_message: Bump version ${{ env.NEXT_VER_CODE }}