Skip to content

Build Zed

Build Zed #8

Workflow file for this run

name: Build Zed
on:
workflow_dispatch:
jobs:
get-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Get last releases
id: get-releases
uses: actions/github-script@v5
with:
script: |
const releasesToCheck = 5;
const zedReleases = await github.repos.listReleases({
owner: 'zed-industries',
repo: 'zed',
per_page: releasesToCheck
});
const thisReleases = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100
});
const thisReleaseTags = new Set(thisReleases.data.map(release => release.tag_name));
const zedReleaseTagsWithoutThisRelease = zedReleases.data.map(release => release.tag_name).filter(tag => !thisReleaseTags.has(tag));
return zedReleaseTagsWithoutThisRelease;
- name: Set matrix for build
id: set-matrix
run: echo "::set-output name=matrix::${{ toJSON(steps.get-releases.outputs.result) }}"
build:
runs-on: windows-latest
strategy:
matrix:
version: ${{ fromJson(needs.get-versions.outputs.matrix) }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: zed-industries/zed
ref: ${{ matrix.version }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Add WASM target
run: rustup target add wasm32-wasi
- name: Install C++ build tools
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo
run: cargo build --release
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: zed
path: target\release\Zed.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ matrix.version }}
files: target\release\Zed.exe