Skip to content

fix: 4

fix: 4 #19

Workflow file for this run

name: build
on:
workflow_dispatch:
permissions:
contents: write
jobs:
clear-older-runs:
runs-on: windows-latest
steps:

Check failure on line 12 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 12
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || :
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 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: Get latest Zed release info
id: zed_release
run: |
RELEASE_INFO=$(curl -s https://api.github.com/repos/zed-industries/zed/releases/latest)
echo "RELEASE_BODY=$(echo $RELEASE_INFO | jq -r .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 }}