1name: Release Nightly
2
3on:
4 schedule:
5 # Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)
6 - cron: "0 7 * * *"
7 push:
8 tags:
9 - "nightly"
10
11env:
12 CARGO_TERM_COLOR: always
13 CARGO_INCREMENTAL: 0
14 RUST_BACKTRACE: 1
15
16jobs:
17 style:
18 timeout-minutes: 60
19 name: Check formatting and Clippy lints
20 if: github.repository_owner == 'zed-industries'
21 runs-on:
22 - self-hosted
23 - macOS
24 steps:
25 - name: Checkout repo
26 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27 with:
28 clean: false
29 fetch-depth: 0
30
31 - name: Run style checks
32 uses: ./.github/actions/check_style
33
34 - name: Run clippy
35 run: ./script/clippy
36
37 tests:
38 timeout-minutes: 60
39 name: Run tests
40 if: github.repository_owner == 'zed-industries'
41 runs-on:
42 - self-hosted
43 - macOS
44 needs: style
45 steps:
46 - name: Checkout repo
47 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
48 with:
49 clean: false
50
51 - name: Run tests
52 uses: ./.github/actions/run_tests
53
54 windows-tests:
55 timeout-minutes: 60
56 name: Run tests on Windows
57 if: github.repository_owner == 'zed-industries'
58 runs-on: [self-hosted, Windows, X64]
59 steps:
60 - name: Checkout repo
61 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
62 with:
63 clean: false
64
65 - name: Configure CI
66 run: |
67 New-Item -ItemType Directory -Path "./../.cargo" -Force
68 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
69
70 - name: Run tests
71 uses: ./.github/actions/run_tests_windows
72
73 - name: Limit target directory size
74 run: ./script/clear-target-dir-if-larger-than.ps1 1024
75
76 - name: Clean CI config file
77 if: always()
78 run: Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
79
80 bundle-mac:
81 timeout-minutes: 60
82 name: Create a macOS bundle
83 if: github.repository_owner == 'zed-industries'
84 runs-on:
85 - self-hosted
86 - bundle
87 needs: tests
88 env:
89 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
90 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
91 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
92 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
93 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
94 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
95 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
96 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
97 steps:
98 - name: Install Node
99 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
100 with:
101 node-version: "18"
102
103 - name: Checkout repo
104 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
105 with:
106 clean: false
107
108 - name: Set release channel to nightly
109 run: |
110 set -eu
111 version=$(git rev-parse --short HEAD)
112 echo "Publishing version: ${version} on release channel nightly"
113 echo "nightly" > crates/zed/RELEASE_CHANNEL
114
115 - name: Create macOS app bundle
116 run: script/bundle-mac
117
118 - name: Upload Zed Nightly
119 run: script/upload-nightly macos
120
121 bundle-linux-x86:
122 timeout-minutes: 60
123 name: Create a Linux *.tar.gz bundle for x86
124 if: github.repository_owner == 'zed-industries'
125 runs-on:
126 - buildjet-16vcpu-ubuntu-2004
127 needs: tests
128 env:
129 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
130 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
131 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
132 steps:
133 - name: Checkout repo
134 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
135 with:
136 clean: false
137
138 - name: Add Rust to the PATH
139 run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
140
141 - name: Install Linux dependencies
142 run: ./script/linux && ./script/install-mold 2.34.0
143
144 - name: Limit target directory size
145 run: script/clear-target-dir-if-larger-than 100
146
147 - name: Set release channel to nightly
148 run: |
149 set -euo pipefail
150 version=$(git rev-parse --short HEAD)
151 echo "Publishing version: ${version} on release channel nightly"
152 echo "nightly" > crates/zed/RELEASE_CHANNEL
153
154 - name: Create Linux .tar.gz bundle
155 run: script/bundle-linux
156
157 - name: Upload Zed Nightly
158 run: script/upload-nightly linux-targz
159
160 bundle-linux-arm:
161 timeout-minutes: 60
162 name: Create a Linux *.tar.gz bundle for ARM
163 if: github.repository_owner == 'zed-industries'
164 runs-on:
165 - buildjet-16vcpu-ubuntu-2204-arm
166 needs: tests
167 env:
168 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
169 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
170 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
171 steps:
172 - name: Checkout repo
173 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
174 with:
175 clean: false
176
177 - name: Install Linux dependencies
178 run: ./script/linux
179
180 - name: Limit target directory size
181 run: script/clear-target-dir-if-larger-than 100
182
183 - name: Set release channel to nightly
184 run: |
185 set -euo pipefail
186 version=$(git rev-parse --short HEAD)
187 echo "Publishing version: ${version} on release channel nightly"
188 echo "nightly" > crates/zed/RELEASE_CHANNEL
189
190 - name: Create Linux .tar.gz bundle
191 run: script/bundle-linux
192
193 - name: Upload Zed Nightly
194 run: script/upload-nightly linux-targz
195
196 freebsd:
197 timeout-minutes: 60
198 if: github.repository_owner == 'zed-industries'
199 runs-on: github-8vcpu-ubuntu-2404
200 needs: tests
201 env:
202 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
203 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
204 name: Build Zed on FreeBSD
205 # env:
206 # MYTOKEN : ${{ secrets.MYTOKEN }}
207 # MYTOKEN2: "value2"
208 steps:
209 - uses: actions/checkout@v4
210 - name: Build FreeBSD remote-server
211 id: freebsd-build
212 uses: vmactions/freebsd-vm@c3ae29a132c8ef1924775414107a97cac042aad5 # v1.2.0
213 with:
214 # envs: "MYTOKEN MYTOKEN2"
215 usesh: true
216 release: 13.5
217 copyback: true
218 prepare: |
219 pkg install -y \
220 bash curl jq git \
221 rustup-init cmake-core llvm-devel-lite pkgconf protobuf # ibx11 alsa-lib rust-bindgen-cli
222 run: |
223 freebsd-version
224 sysctl hw.model
225 sysctl hw.ncpu
226 sysctl hw.physmem
227 sysctl hw.usermem
228 git config --global --add safe.directory /home/runner/work/zed/zed
229 rustup-init --profile minimal --default-toolchain none -y
230 . "$HOME/.cargo/env"
231 ./script/bundle-freebsd
232 mkdir -p out/
233 mv "target/zed-remote-server-freebsd-x86_64.gz" out/
234 rm -rf target/
235 cargo clean
236
237 - name: Upload Zed Nightly
238 run: script/upload-nightly freebsd
239
240 bundle-nix:
241 name: Build and cache Nix package
242 if: false
243 needs: tests
244 secrets: inherit
245 uses: ./.github/workflows/nix.yml
246
247 bundle-windows-x64:
248 timeout-minutes: 60
249 name: Create a Windows installer
250 if: github.repository_owner == 'zed-industries'
251 runs-on: [self-hosted, Windows, X64]
252 needs: windows-tests
253 env:
254 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
255 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
256 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
257 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
258 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
259 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
260 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
261 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
262 FILE_DIGEST: SHA256
263 TIMESTAMP_DIGEST: SHA256
264 TIMESTAMP_SERVER: "http://timestamp.acs.microsoft.com"
265 steps:
266 - name: Checkout repo
267 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
268 with:
269 clean: false
270
271 - name: Set release channel to nightly
272 working-directory: ${{ env.ZED_WORKSPACE }}
273 run: |
274 $ErrorActionPreference = "Stop"
275 $version = git rev-parse --short HEAD
276 Write-Host "Publishing version: $version on release channel nightly"
277 "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
278
279 - name: Install trusted signing
280 uses: ./.github/actions/install_trusted_signing
281
282 - name: Build Zed installer
283 working-directory: ${{ env.ZED_WORKSPACE }}
284 run: script/bundle-windows.ps1
285
286 - name: Upload Zed Nightly
287 working-directory: ${{ env.ZED_WORKSPACE }}
288 run: script/upload-nightly.ps1 windows
289
290 update-nightly-tag:
291 name: Update nightly tag
292 if: github.repository_owner == 'zed-industries'
293 runs-on: ubuntu-latest
294 needs:
295 - bundle-mac
296 - bundle-linux-x86
297 - bundle-linux-arm
298 - bundle-windows-x64
299 steps:
300 - name: Checkout repo
301 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
302 with:
303 fetch-depth: 0
304
305 - name: Update nightly tag
306 run: |
307 if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
308 echo "Nightly tag already points to current commit. Skipping tagging."
309 exit 0
310 fi
311 git config user.name github-actions
312 git config user.email github-actions@github.com
313 git tag -f nightly
314 git push origin nightly --force