Skip to content

Commit

Permalink
automatically create releases
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mnich committed May 11, 2024
1 parent 0a4144d commit 106d69f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-zed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,48 @@ 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
Expand All @@ -37,3 +71,9 @@ jobs:
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

0 comments on commit 106d69f

Please sign in to comment.