1name: CI
2
3on:
4 push:
5 branches:
6 - main
7 - "v[0-9]+.[0-9]+.x"
8 tags:
9 - "v*"
10
11 pull_request:
12 branches:
13 - "**"
14
15concurrency:
16 # Allow only one workflow per any non-`main` branch.
17 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
18 cancel-in-progress: true
19
20env:
21 CARGO_TERM_COLOR: always
22 CARGO_INCREMENTAL: 0
23 RUST_BACKTRACE: 1
24
25jobs:
26 job_spec:
27 name: Decide which jobs to run
28 if: github.repository_owner == 'zed-industries'
29 outputs:
30 run_tests: ${{ steps.filter.outputs.run_tests }}
31 run_license: ${{ steps.filter.outputs.run_license }}
32 run_docs: ${{ steps.filter.outputs.run_docs }}
33 run_nix: ${{ steps.filter.outputs.run_nix }}
34 runs-on:
35 - ubuntu-latest
36 steps:
37 - name: Checkout repo
38 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
39 with:
40 # 350 is arbitrary; ~10days of history on main (5secs); full history is ~25secs
41 fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
42 - name: Fetch git history and generate output filters
43 id: filter
44 run: |
45 if [ -z "$GITHUB_BASE_REF" ]; then
46 echo "Not in a PR context (i.e., push to main/stable/preview)"
47 COMPARE_REV=$(git rev-parse HEAD~1)
48 else
49 echo "In a PR context comparing to pull_request.base.ref"
50 git fetch origin "$GITHUB_BASE_REF" --depth=350
51 COMPARE_REV=$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)
52 fi
53 # Specify anything which should skip full CI in this regex:
54 # - docs/
55 # - .github/ISSUE_TEMPLATE/
56 # - .github/workflows/ (except .github/workflows/ci.yml)
57 SKIP_REGEX='^(docs/|\.github/(ISSUE_TEMPLATE|workflows/(?!ci)))'
58 if [[ $(git diff --name-only $COMPARE_REV ${{ github.sha }} | grep -vP "$SKIP_REGEX") ]]; then
59 echo "run_tests=true" >> $GITHUB_OUTPUT
60 else
61 echo "run_tests=false" >> $GITHUB_OUTPUT
62 fi
63 if [[ $(git diff --name-only $COMPARE_REV ${{ github.sha }} | grep '^docs/') ]]; then
64 echo "run_docs=true" >> $GITHUB_OUTPUT
65 else
66 echo "run_docs=false" >> $GITHUB_OUTPUT
67 fi
68 if [[ $(git diff --name-only $COMPARE_REV ${{ github.sha }} | grep -P '^(Cargo.lock|script/.*licenses)') ]]; then
69 echo "run_license=true" >> $GITHUB_OUTPUT
70 else
71 echo "run_license=false" >> $GITHUB_OUTPUT
72 fi
73 NIX_REGEX='^(nix/|flake\.|Cargo\.|rust-toolchain.toml|\.cargo/config.toml)'
74 if [[ $(git diff --name-only $COMPARE_REV ${{ github.sha }} | grep "$NIX_REGEX") ]]; then
75 echo "run_nix=true" >> $GITHUB_OUTPUT
76 else
77 echo "run_nix=false" >> $GITHUB_OUTPUT
78 fi
79
80 migration_checks:
81 name: Check Postgres and Protobuf migrations, mergability
82 needs: [job_spec]
83 if: |
84 github.repository_owner == 'zed-industries' &&
85 needs.job_spec.outputs.run_tests == 'true'
86 timeout-minutes: 60
87 runs-on:
88 - self-hosted
89 - macOS
90 steps:
91 - name: Checkout repo
92 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
93 with:
94 clean: false
95 fetch-depth: 0 # fetch full history
96
97 - name: Remove untracked files
98 run: git clean -df
99
100 - name: Find modified migrations
101 shell: bash -euxo pipefail {0}
102 run: |
103 export SQUAWK_GITHUB_TOKEN=${{ github.token }}
104 . ./script/squawk
105
106 - name: Ensure fresh merge
107 shell: bash -euxo pipefail {0}
108 run: |
109 if [ -z "$GITHUB_BASE_REF" ];
110 then
111 echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> $GITHUB_ENV
112 else
113 git checkout -B temp
114 git merge -q origin/$GITHUB_BASE_REF -m "merge main into temp"
115 echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
116 fi
117
118 - uses: bufbuild/buf-setup-action@v1
119 with:
120 version: v1.29.0
121 - uses: bufbuild/buf-breaking-action@v1
122 with:
123 input: "crates/proto/proto/"
124 against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/"
125
126 workspace_hack:
127 timeout-minutes: 60
128 name: Check workspace-hack crate
129 needs: [job_spec]
130 if: |
131 github.repository_owner == 'zed-industries' &&
132 needs.job_spec.outputs.run_tests == 'true'
133 runs-on:
134 - buildjet-8vcpu-ubuntu-2204
135 steps:
136 - name: Checkout repo
137 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
138 - name: Add Rust to the PATH
139 run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
140 - name: Install cargo-hakari
141 uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 # v2
142 with:
143 command: install
144 args: cargo-hakari@0.9.35
145
146 - name: Check workspace-hack Cargo.toml is up-to-date
147 run: |
148 cargo hakari generate --diff || {
149 echo "To fix, run script/update-workspace-hack or script/update-workspace-hack.ps1";
150 false
151 }
152 - name: Check all crates depend on workspace-hack
153 run: |
154 cargo hakari manage-deps --dry-run || {
155 echo "To fix, run script/update-workspace-hack or script/update-workspace-hack.ps1"
156 false
157 }
158
159 style:
160 timeout-minutes: 60
161 name: Check formatting and spelling
162 needs: [job_spec]
163 if: github.repository_owner == 'zed-industries'
164 runs-on:
165 - buildjet-8vcpu-ubuntu-2204
166 steps:
167 - name: Checkout repo
168 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
169
170 - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
171 with:
172 version: 9
173
174 - name: Prettier Check on /docs
175 working-directory: ./docs
176 run: |
177 pnpm dlx prettier@${PRETTIER_VERSION} . --check || {
178 echo "To fix, run from the root of the Zed repo:"
179 echo " cd docs && pnpm dlx prettier@${PRETTIER_VERSION} . --write && cd .."
180 false
181 }
182 env:
183 PRETTIER_VERSION: 3.5.0
184
185 - name: Prettier Check on default.json
186 run: |
187 pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --check || {
188 echo "To fix, run from the root of the Zed repo:"
189 echo " pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --write"
190 false
191 }
192 env:
193 PRETTIER_VERSION: 3.5.0
194
195 # To support writing comments that they will certainly be revisited.
196 - name: Check for todo! and FIXME comments
197 run: script/check-todos
198
199 - name: Check modifier use in keymaps
200 run: script/check-keymaps
201
202 - name: Run style checks
203 uses: ./.github/actions/check_style
204
205 - name: Check for typos
206 uses: crate-ci/typos@8e6a4285bcbde632c5d79900a7779746e8b7ea3f # v1.24.6
207 with:
208 config: ./typos.toml
209
210 check_docs:
211 timeout-minutes: 60
212 name: Check docs
213 needs: [job_spec]
214 if: |
215 github.repository_owner == 'zed-industries' &&
216 (needs.job_spec.outputs.run_tests == 'true' || needs.job_spec.outputs.run_docs == 'true')
217 runs-on:
218 - buildjet-8vcpu-ubuntu-2204
219 steps:
220 - name: Checkout repo
221 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
222 with:
223 clean: false
224
225 - name: Configure CI
226 run: |
227 mkdir -p ./../.cargo
228 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
229
230 - name: Build docs
231 uses: ./.github/actions/build_docs
232
233 macos_tests:
234 timeout-minutes: 60
235 name: (macOS) Run Clippy and tests
236 needs: [job_spec]
237 if: |
238 github.repository_owner == 'zed-industries' &&
239 needs.job_spec.outputs.run_tests == 'true'
240 runs-on:
241 - self-hosted
242 - macOS
243 steps:
244 - name: Checkout repo
245 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
246 with:
247 clean: false
248
249 - name: Configure CI
250 run: |
251 mkdir -p ./../.cargo
252 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
253
254 - name: cargo clippy
255 run: ./script/clippy
256
257 - name: Install cargo-machete
258 uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 # v2
259 with:
260 command: install
261 args: cargo-machete@0.7.0
262
263 - name: Check unused dependencies
264 uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 # v2
265 with:
266 command: machete
267
268 - name: Check licenses
269 run: |
270 script/check-licenses
271 if [[ "${{ needs.job_spec.outputs.run_license }}" == "true" ]]; then
272 script/generate-licenses /tmp/zed_licenses_output
273 fi
274
275 - name: Check for new vulnerable dependencies
276 if: github.event_name == 'pull_request'
277 uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8 # v4
278 with:
279 license-check: false
280
281 - name: Run tests
282 uses: ./.github/actions/run_tests
283
284 - name: Build collab
285 run: cargo build -p collab
286
287 - name: Build other binaries and features
288 run: |
289 cargo build --workspace --bins --all-features
290 cargo check -p gpui --features "macos-blade"
291 cargo check -p workspace
292 cargo build -p remote_server
293 cargo check -p gpui --examples
294
295 # Since the macOS runners are stateful, so we need to remove the config file to prevent potential bug.
296 - name: Clean CI config file
297 if: always()
298 run: rm -rf ./../.cargo
299
300 linux_tests:
301 timeout-minutes: 60
302 name: (Linux) Run Clippy and tests
303 needs: [job_spec]
304 if: |
305 github.repository_owner == 'zed-industries' &&
306 needs.job_spec.outputs.run_tests == 'true'
307 runs-on:
308 - buildjet-16vcpu-ubuntu-2204
309 steps:
310 - name: Add Rust to the PATH
311 run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
312
313 - name: Checkout repo
314 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
315 with:
316 clean: false
317
318 - name: Cache dependencies
319 uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
320 with:
321 save-if: ${{ github.ref == 'refs/heads/main' }}
322 cache-provider: "buildjet"
323
324 - name: Install Linux dependencies
325 run: ./script/linux
326
327 - name: Configure CI
328 run: |
329 mkdir -p ./../.cargo
330 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
331
332 - name: cargo clippy
333 run: ./script/clippy
334
335 - name: Run tests
336 uses: ./.github/actions/run_tests
337
338 - name: Build other binaries and features
339 run: |
340 cargo build -p zed
341 cargo check -p workspace
342 cargo check -p gpui --examples
343
344 # Even the Linux runner is not stateful, in theory there is no need to do this cleanup.
345 # But, to avoid potential issues in the future if we choose to use a stateful Linux runner and forget to add code
346 # to clean up the config file, I’ve included the cleanup code here as a precaution.
347 # While it’s not strictly necessary at this moment, I believe it’s better to err on the side of caution.
348 - name: Clean CI config file
349 if: always()
350 run: rm -rf ./../.cargo
351
352 build_remote_server:
353 timeout-minutes: 60
354 name: (Linux) Build Remote Server
355 needs: [job_spec]
356 if: |
357 github.repository_owner == 'zed-industries' &&
358 needs.job_spec.outputs.run_tests == 'true'
359 runs-on:
360 - buildjet-8vcpu-ubuntu-2204
361 steps:
362 - name: Add Rust to the PATH
363 run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
364
365 - name: Checkout repo
366 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
367 with:
368 clean: false
369
370 - name: Cache dependencies
371 uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
372 with:
373 save-if: ${{ github.ref == 'refs/heads/main' }}
374 cache-provider: "buildjet"
375
376 - name: Install Clang & Mold
377 run: ./script/remote-server && ./script/install-mold 2.34.0
378
379 - name: Configure CI
380 run: |
381 mkdir -p ./../.cargo
382 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
383
384 - name: Build Remote Server
385 run: cargo build -p remote_server
386
387 - name: Clean CI config file
388 if: always()
389 run: rm -rf ./../.cargo
390
391 windows_tests:
392 timeout-minutes: 60
393 name: (Windows) Run Clippy and tests
394 needs: [job_spec]
395 if: |
396 github.repository_owner == 'zed-industries' &&
397 needs.job_spec.outputs.run_tests == 'true'
398 runs-on: [self-hosted, Windows, X64]
399 steps:
400 - name: Environment Setup
401 run: |
402 $RunnerDir = Split-Path -Parent $env:RUNNER_WORKSPACE
403 Write-Output `
404 "RUSTUP_HOME=$RunnerDir\.rustup" `
405 "CARGO_HOME=$RunnerDir\.cargo" `
406 "PATH=$RunnerDir\.cargo\bin;$env:PATH" `
407 >> $env:GITHUB_ENV
408
409 - name: Checkout repo
410 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
411 with:
412 clean: false
413
414 - name: Configure CI
415 run: |
416 New-Item -ItemType Directory -Path "./../.cargo" -Force
417 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
418
419 - name: cargo clippy
420 run: |
421 .\script\clippy.ps1
422
423 - name: Run tests
424 uses: ./.github/actions/run_tests_windows
425
426 - name: Build Zed
427 run: cargo build
428
429 - name: Limit target directory size
430 run: ./script/clear-target-dir-if-larger-than.ps1 250
431
432 - name: Clean CI config file
433 if: always()
434 run: Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
435
436 tests_pass:
437 name: Tests Pass
438 runs-on: ubuntu-latest
439 needs:
440 - job_spec
441 - style
442 - check_docs
443 - migration_checks
444 # run_tests: If adding required tests, add them here and to script below.
445 - workspace_hack
446 - linux_tests
447 - build_remote_server
448 - macos_tests
449 - windows_tests
450 if: |
451 github.repository_owner == 'zed-industries' &&
452 always()
453 steps:
454 - name: Check all tests passed
455 run: |
456 # Check dependent jobs...
457 RET_CODE=0
458 # Always check style
459 [[ "${{ needs.style.result }}" != 'success' ]] && { RET_CODE=1; echo "style tests failed"; }
460
461 if [[ "${{ needs.job_spec.outputs.run_docs }}" == "true" ]]; then
462 [[ "${{ needs.check_docs.result }}" != 'success' ]] && { RET_CODE=1; echo "docs checks failed"; }
463 fi
464 # Only check test jobs if they were supposed to run
465 if [[ "${{ needs.job_spec.outputs.run_tests }}" == "true" ]]; then
466 [[ "${{ needs.workspace_hack.result }}" != 'success' ]] && { RET_CODE=1; echo "Workspace Hack failed"; }
467 [[ "${{ needs.macos_tests.result }}" != 'success' ]] && { RET_CODE=1; echo "macOS tests failed"; }
468 [[ "${{ needs.linux_tests.result }}" != 'success' ]] && { RET_CODE=1; echo "Linux tests failed"; }
469 [[ "${{ needs.windows_tests.result }}" != 'success' ]] && { RET_CODE=1; echo "Windows tests failed"; }
470 [[ "${{ needs.build_remote_server.result }}" != 'success' ]] && { RET_CODE=1; echo "Remote server build failed"; }
471 # This check is intentionally disabled. See: https://github.com/zed-industries/zed/pull/28431
472 # [[ "${{ needs.migration_checks.result }}" != 'success' ]] && { RET_CODE=1; echo "Migration Checks failed"; }
473 fi
474 if [[ "$RET_CODE" -eq 0 ]]; then
475 echo "All tests passed successfully!"
476 fi
477 exit $RET_CODE
478
479 bundle-mac:
480 timeout-minutes: 120
481 name: Create a macOS bundle
482 runs-on:
483 - self-hosted
484 - bundle
485 if: |
486 startsWith(github.ref, 'refs/tags/v')
487 || contains(github.event.pull_request.labels.*.name, 'run-bundling')
488 needs: [macos_tests]
489 env:
490 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
491 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
492 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
493 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
494 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
495 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
496 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
497 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
498 steps:
499 - name: Install Node
500 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
501 with:
502 node-version: "18"
503
504 - name: Checkout repo
505 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
506 with:
507 # We need to fetch more than one commit so that `script/draft-release-notes`
508 # is able to diff between the current and previous tag.
509 #
510 # 25 was chosen arbitrarily.
511 fetch-depth: 25
512 clean: false
513 ref: ${{ github.ref }}
514
515 - name: Limit target directory size
516 run: script/clear-target-dir-if-larger-than 100
517
518 - name: Determine version and release channel
519 if: ${{ startsWith(github.ref, 'refs/tags/v') }}
520 run: |
521 # This exports RELEASE_CHANNEL into env (GITHUB_ENV)
522 script/determine-release-channel
523
524 - name: Draft release notes
525 if: ${{ startsWith(github.ref, 'refs/tags/v') }}
526 run: |
527 mkdir -p target/
528 # Ignore any errors that occur while drafting release notes to not fail the build.
529 script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md || true
530 script/create-draft-release target/release-notes.md
531 env:
532 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
533
534 - name: Create macOS app bundle
535 run: script/bundle-mac
536
537 - name: Rename binaries
538 if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
539 run: |
540 mv target/aarch64-apple-darwin/release/Zed.dmg target/aarch64-apple-darwin/release/Zed-aarch64.dmg
541 mv target/x86_64-apple-darwin/release/Zed.dmg target/x86_64-apple-darwin/release/Zed-x86_64.dmg
542
543 - name: Upload app bundle (aarch64) to workflow run if main branch or specific label
544 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
545 if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
546 with:
547 name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg
548 path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
549
550 - name: Upload app bundle (x86_64) to workflow run if main branch or specific label
551 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
552 if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
553 with:
554 name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg
555 path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
556
557 - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
558 name: Upload app bundle to release
559 if: ${{ env.RELEASE_CHANNEL == 'preview' || env.RELEASE_CHANNEL == 'stable' }}
560 with:
561 draft: true
562 prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
563 files: |
564 target/zed-remote-server-macos-x86_64.gz
565 target/zed-remote-server-macos-aarch64.gz
566 target/aarch64-apple-darwin/release/Zed-aarch64.dmg
567 target/x86_64-apple-darwin/release/Zed-x86_64.dmg
568 env:
569 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
570
571 bundle-linux-x86_x64:
572 timeout-minutes: 60
573 name: Linux x86_x64 release bundle
574 runs-on:
575 - buildjet-16vcpu-ubuntu-2004 # ubuntu 20.04 for minimal glibc
576 if: |
577 startsWith(github.ref, 'refs/tags/v')
578 || contains(github.event.pull_request.labels.*.name, 'run-bundling')
579 needs: [linux_tests]
580 env:
581 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
582 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
583 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
584 steps:
585 - name: Checkout repo
586 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
587 with:
588 clean: false
589
590 - name: Install Linux dependencies
591 run: ./script/linux && ./script/install-mold 2.34.0
592
593 - name: Determine version and release channel
594 if: startsWith(github.ref, 'refs/tags/v')
595 run: |
596 # This exports RELEASE_CHANNEL into env (GITHUB_ENV)
597 script/determine-release-channel
598
599 - name: Create Linux .tar.gz bundle
600 run: script/bundle-linux
601
602 - name: Upload Artifact to Workflow - zed (run-bundling)
603 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
604 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
605 with:
606 name: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz
607 path: target/release/zed-*.tar.gz
608
609 - name: Upload Artifact to Workflow - zed-remote-server (run-bundling)
610 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
611 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
612 with:
613 name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.gz
614 path: target/zed-remote-server-linux-x86_64.gz
615
616 - name: Upload Artifacts to release
617 uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
618 if: ${{ !(contains(github.event.pull_request.labels.*.name, 'run-bundling')) }}
619 with:
620 draft: true
621 prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
622 files: |
623 target/zed-remote-server-linux-x86_64.gz
624 target/release/zed-linux-x86_64.tar.gz
625 env:
626 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
627
628 bundle-linux-aarch64: # this runs on ubuntu22.04
629 timeout-minutes: 60
630 name: Linux arm64 release bundle
631 runs-on:
632 - buildjet-16vcpu-ubuntu-2204-arm
633 if: |
634 startsWith(github.ref, 'refs/tags/v')
635 || contains(github.event.pull_request.labels.*.name, 'run-bundling')
636 needs: [linux_tests]
637 env:
638 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
639 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
640 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
641 steps:
642 - name: Checkout repo
643 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
644 with:
645 clean: false
646
647 - name: Install Linux dependencies
648 run: ./script/linux
649
650 - name: Determine version and release channel
651 if: startsWith(github.ref, 'refs/tags/v')
652 run: |
653 # This exports RELEASE_CHANNEL into env (GITHUB_ENV)
654 script/determine-release-channel
655
656 - name: Create and upload Linux .tar.gz bundles
657 run: script/bundle-linux
658
659 - name: Upload Artifact to Workflow - zed (run-bundling)
660 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
661 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
662 with:
663 name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz
664 path: target/release/zed-*.tar.gz
665
666 - name: Upload Artifact to Workflow - zed-remote-server (run-bundling)
667 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
668 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
669 with:
670 name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.gz
671 path: target/zed-remote-server-linux-aarch64.gz
672
673 - name: Upload Artifacts to release
674 uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
675 if: ${{ !(contains(github.event.pull_request.labels.*.name, 'run-bundling')) }}
676 with:
677 draft: true
678 prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
679 files: |
680 target/zed-remote-server-linux-aarch64.gz
681 target/release/zed-linux-aarch64.tar.gz
682 env:
683 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
684
685 freebsd:
686 timeout-minutes: 60
687 runs-on: github-8vcpu-ubuntu-2404
688 if: |
689 startsWith(github.ref, 'refs/tags/v')
690 || contains(github.event.pull_request.labels.*.name, 'run-bundling')
691 needs: [linux_tests]
692 name: Build Zed on FreeBSD
693 # env:
694 # MYTOKEN : ${{ secrets.MYTOKEN }}
695 # MYTOKEN2: "value2"
696 steps:
697 - uses: actions/checkout@v4
698 - name: Build FreeBSD remote-server
699 id: freebsd-build
700 uses: vmactions/freebsd-vm@c3ae29a132c8ef1924775414107a97cac042aad5 # v1.2.0
701 with:
702 # envs: "MYTOKEN MYTOKEN2"
703 usesh: true
704 release: 13.5
705 copyback: true
706 prepare: |
707 pkg install -y \
708 bash curl jq git \
709 rustup-init cmake-core llvm-devel-lite pkgconf protobuf # ibx11 alsa-lib rust-bindgen-cli
710 run: |
711 freebsd-version
712 sysctl hw.model
713 sysctl hw.ncpu
714 sysctl hw.physmem
715 sysctl hw.usermem
716 git config --global --add safe.directory /home/runner/work/zed/zed
717 rustup-init --profile minimal --default-toolchain none -y
718 . "$HOME/.cargo/env"
719 ./script/bundle-freebsd
720 mkdir -p out/
721 mv "target/zed-remote-server-freebsd-x86_64.gz" out/
722 rm -rf target/
723 cargo clean
724
725 - name: Upload Artifact to Workflow - zed-remote-server (run-bundling)
726 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
727 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
728 with:
729 name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-freebsd.gz
730 path: out/zed-remote-server-freebsd-x86_64.gz
731
732 - name: Upload Artifacts to release
733 uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
734 if: ${{ !(contains(github.event.pull_request.labels.*.name, 'run-bundling')) }}
735 with:
736 draft: true
737 prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
738 files: |
739 out/zed-remote-server-freebsd-x86_64.gz
740 env:
741 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
742
743 nix-build:
744 name: Build with Nix
745 uses: ./.github/workflows/nix.yml
746 needs: [job_spec]
747 if: github.repository_owner == 'zed-industries' &&
748 (contains(github.event.pull_request.labels.*.name, 'run-nix') ||
749 needs.job_spec.outputs.run_nix == 'true')
750 secrets: inherit
751 with:
752 flake-output: debug
753 # excludes the final package to only cache dependencies
754 cachix-filter: "-zed-editor-[0-9.]*-nightly"
755
756 bundle-windows-x64:
757 timeout-minutes: 120
758 name: Create a Windows installer
759 runs-on: [self-hosted, Windows, X64]
760 if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
761 needs: [windows_tests]
762 env:
763 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
764 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
765 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
766 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
767 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
768 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
769 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
770 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
771 FILE_DIGEST: SHA256
772 TIMESTAMP_DIGEST: SHA256
773 TIMESTAMP_SERVER: "http://timestamp.acs.microsoft.com"
774 steps:
775 - name: Checkout repo
776 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
777 with:
778 clean: false
779
780 - name: Determine version and release channel
781 working-directory: ${{ env.ZED_WORKSPACE }}
782 if: ${{ startsWith(github.ref, 'refs/tags/v') }}
783 run: |
784 # This exports RELEASE_CHANNEL into env (GITHUB_ENV)
785 script/determine-release-channel.ps1
786
787 - name: Install trusted signing
788 uses: ./.github/actions/install_trusted_signing
789
790 - name: Build Zed installer
791 working-directory: ${{ env.ZED_WORKSPACE }}
792 run: script/bundle-windows.ps1
793
794 - name: Upload installer (x86_64) to Workflow - zed (run-bundling)
795 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
796 if: contains(github.event.pull_request.labels.*.name, 'run-bundling')
797 with:
798 name: ZedEditorUserSetup-x64-${{ github.event.pull_request.head.sha || github.sha }}.exe
799 path: ${{ env.SETUP_PATH }}
800
801 - name: Upload Artifacts to release
802 uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
803 # Re-enable when we are ready to publish windows preview releases
804 if: false && ${{ !(contains(github.event.pull_request.labels.*.name, 'run-bundling')) && env.RELEASE_CHANNEL == 'preview' }} # upload only preview
805 with:
806 draft: true
807 prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
808 files: ${{ env.SETUP_PATH }}
809 env:
810 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
811
812 auto-release-preview:
813 name: Auto release preview
814 if: |
815 startsWith(github.ref, 'refs/tags/v')
816 && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre')
817 needs: [bundle-mac, bundle-linux-x86_x64, bundle-linux-aarch64, bundle-windows-x64, freebsd]
818 runs-on:
819 - self-hosted
820 - bundle
821 steps:
822 - name: gh release
823 run: gh release edit $GITHUB_REF_NAME --draft=false
824 env:
825 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}