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