-
Notifications
You must be signed in to change notification settings - Fork 54
97 lines (83 loc) · 2.53 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build Zed Nightly
on:
schedule:
- cron: "0 0 * * *" # Runs every night at midnight UTC
push:
branches:
- main
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
backend: [vulkan, opengl]
include:
- backend: vulkan
artifact_name: zed-release
rustflags: ""
- backend: opengl
artifact_name: zed-release-opengl
rustflags: "--cfg gles"
steps:
- name: Enable long paths in Git
run: |
git config --system core.longpaths true
- name: Enable long paths in Windows
shell: powershell
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: zed-industries/zed
ref: main
- name: Install rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true
target: wasm32-wasip1
- name: Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.backend }}
- name: Build release
env:
RUSTFLAGS: ${{ matrix.rustflags }}
run: cargo build --release
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: target/release/zed.exe
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Get the current date
id: date
run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Create release directories and zip
run: |
mkdir -p zed-release zed-release-opengl
mv artifacts/zed-release/zed.exe zed-release/
mv artifacts/zed-release-opengl/zed.exe zed-release-opengl/
zip -r zed-windows.zip zed-release/*
zip -r zed-windows-opengl.zip zed-release-opengl/*
- name: Upload release build artifacts to GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.CURRENT_DATE }}
tag_name: ${{ env.CURRENT_DATE }}
draft: false
make_latest: true
files: |
zed-windows.zip
zed-windows-opengl.zip