1# Generated from xtask::workflows::release
2# Rebuild with `cargo xtask workflows`.
3name: release
4env:
5 CARGO_TERM_COLOR: always
6 RUST_BACKTRACE: '1'
7on:
8 push:
9 tags:
10 - v*
11jobs:
12 run_tests_mac:
13 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
14 runs-on: namespace-profile-mac-large
15 steps:
16 - name: steps::checkout_repo
17 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
18 with:
19 clean: false
20 - name: steps::setup_cargo_config
21 run: |
22 mkdir -p ./../.cargo
23 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
24 - name: steps::cache_rust_dependencies_namespace
25 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
26 with:
27 cache: rust
28 path: ~/.rustup
29 - name: steps::setup_node
30 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
31 with:
32 node-version: '20'
33 - name: steps::cargo_install_nextest
34 uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
35 - name: steps::clear_target_dir_if_large
36 run: ./script/clear-target-dir-if-larger-than 300
37 - name: steps::setup_sccache
38 run: ./script/setup-sccache
39 env:
40 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
41 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
42 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
43 SCCACHE_BUCKET: sccache-zed
44 - name: steps::cargo_nextest
45 run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
46 - name: steps::cargo_build_visual_tests
47 run: cargo build -p zed --bin zed_visual_test_runner --features visual-tests
48 - name: steps::show_sccache_stats
49 run: sccache --show-stats || true
50 - name: steps::cleanup_cargo_config
51 if: always()
52 run: |
53 rm -rf ./../.cargo
54 timeout-minutes: 60
55 run_tests_linux:
56 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
57 runs-on: namespace-profile-16x32-ubuntu-2204
58 env:
59 CC: clang
60 CXX: clang++
61 steps:
62 - name: steps::checkout_repo
63 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
64 with:
65 clean: false
66 - name: steps::setup_cargo_config
67 run: |
68 mkdir -p ./../.cargo
69 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
70 - name: steps::cache_rust_dependencies_namespace
71 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
72 with:
73 cache: rust
74 path: ~/.rustup
75 - name: steps::setup_linux
76 run: ./script/linux
77 - name: steps::download_wasi_sdk
78 run: ./script/download-wasi-sdk
79 - name: steps::setup_node
80 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
81 with:
82 node-version: '20'
83 - name: steps::cargo_install_nextest
84 uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
85 - name: steps::clear_target_dir_if_large
86 run: ./script/clear-target-dir-if-larger-than 250
87 - name: steps::setup_sccache
88 run: ./script/setup-sccache
89 env:
90 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
91 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
92 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
93 SCCACHE_BUCKET: sccache-zed
94 - name: steps::cargo_nextest
95 run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
96 - name: steps::show_sccache_stats
97 run: sccache --show-stats || true
98 - name: steps::cleanup_cargo_config
99 if: always()
100 run: |
101 rm -rf ./../.cargo
102 timeout-minutes: 60
103 services:
104 postgres:
105 image: postgres:15
106 env:
107 POSTGRES_HOST_AUTH_METHOD: trust
108 ports:
109 - 5432:5432
110 options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10
111 run_tests_windows:
112 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
113 runs-on: self-32vcpu-windows-2022
114 steps:
115 - name: steps::checkout_repo
116 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
117 with:
118 clean: false
119 - name: steps::setup_cargo_config
120 run: |
121 New-Item -ItemType Directory -Path "./../.cargo" -Force
122 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
123 shell: pwsh
124 - name: steps::setup_node
125 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
126 with:
127 node-version: '20'
128 - name: steps::clear_target_dir_if_large
129 run: ./script/clear-target-dir-if-larger-than.ps1 250
130 shell: pwsh
131 - name: steps::setup_sccache
132 run: ./script/setup-sccache.ps1
133 shell: pwsh
134 env:
135 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
136 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
137 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
138 SCCACHE_BUCKET: sccache-zed
139 - name: steps::cargo_nextest
140 run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
141 shell: pwsh
142 - name: steps::show_sccache_stats
143 run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
144 shell: pwsh
145 - name: steps::cleanup_cargo_config
146 if: always()
147 run: |
148 Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
149 shell: pwsh
150 timeout-minutes: 60
151 clippy_mac:
152 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
153 runs-on: namespace-profile-mac-large
154 steps:
155 - name: steps::checkout_repo
156 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
157 with:
158 clean: false
159 - name: steps::setup_cargo_config
160 run: |
161 mkdir -p ./../.cargo
162 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
163 - name: steps::cache_rust_dependencies_namespace
164 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
165 with:
166 cache: rust
167 path: ~/.rustup
168 - name: steps::setup_sccache
169 run: ./script/setup-sccache
170 env:
171 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
172 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
173 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
174 SCCACHE_BUCKET: sccache-zed
175 - name: steps::clippy
176 run: ./script/clippy
177 - name: steps::show_sccache_stats
178 run: sccache --show-stats || true
179 timeout-minutes: 60
180 clippy_linux:
181 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
182 runs-on: namespace-profile-16x32-ubuntu-2204
183 env:
184 CC: clang
185 CXX: clang++
186 steps:
187 - name: steps::checkout_repo
188 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
189 with:
190 clean: false
191 - name: steps::setup_cargo_config
192 run: |
193 mkdir -p ./../.cargo
194 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
195 - name: steps::cache_rust_dependencies_namespace
196 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
197 with:
198 cache: rust
199 path: ~/.rustup
200 - name: steps::setup_linux
201 run: ./script/linux
202 - name: steps::download_wasi_sdk
203 run: ./script/download-wasi-sdk
204 - name: steps::setup_sccache
205 run: ./script/setup-sccache
206 env:
207 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
208 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
209 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
210 SCCACHE_BUCKET: sccache-zed
211 - name: steps::clippy
212 run: ./script/clippy
213 - name: steps::show_sccache_stats
214 run: sccache --show-stats || true
215 timeout-minutes: 60
216 clippy_windows:
217 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
218 runs-on: self-32vcpu-windows-2022
219 steps:
220 - name: steps::checkout_repo
221 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
222 with:
223 clean: false
224 - name: steps::setup_cargo_config
225 run: |
226 New-Item -ItemType Directory -Path "./../.cargo" -Force
227 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
228 shell: pwsh
229 - name: steps::setup_sccache
230 run: ./script/setup-sccache.ps1
231 shell: pwsh
232 env:
233 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
234 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
235 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
236 SCCACHE_BUCKET: sccache-zed
237 - name: steps::clippy
238 run: ./script/clippy.ps1
239 shell: pwsh
240 - name: steps::show_sccache_stats
241 run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
242 shell: pwsh
243 timeout-minutes: 60
244 check_scripts:
245 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
246 runs-on: namespace-profile-2x4-ubuntu-2404
247 steps:
248 - name: steps::checkout_repo
249 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
250 with:
251 clean: false
252 - name: run_tests::check_scripts::run_shellcheck
253 run: ./script/shellcheck-scripts error
254 - id: get_actionlint
255 name: run_tests::check_scripts::download_actionlint
256 run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
257 - name: run_tests::check_scripts::run_actionlint
258 run: '"$ACTIONLINT_BIN" -color'
259 env:
260 ACTIONLINT_BIN: ${{ steps.get_actionlint.outputs.executable }}
261 - name: steps::cache_rust_dependencies_namespace
262 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
263 with:
264 cache: rust
265 path: ~/.rustup
266 - name: run_tests::check_scripts::check_xtask_workflows
267 run: |
268 cargo xtask workflows
269 if ! git diff --exit-code .github; then
270 echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
271 echo "Please run 'cargo xtask workflows' locally and commit the changes"
272 exit 1
273 fi
274 timeout-minutes: 60
275 create_draft_release:
276 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
277 runs-on: namespace-profile-2x4-ubuntu-2404
278 steps:
279 - name: steps::checkout_repo
280 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
281 with:
282 clean: false
283 fetch-depth: 25
284 ref: ${{ github.ref }}
285 - name: script/determine-release-channel
286 run: script/determine-release-channel
287 - name: mkdir -p target/
288 run: mkdir -p target/
289 - name: release::create_draft_release::generate_release_notes
290 run: node --redirect-warnings=/dev/null ./script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md
291 - name: release::create_draft_release::create_release
292 run: script/create-draft-release target/release-notes.md
293 env:
294 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
295 timeout-minutes: 60
296 compliance_check:
297 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
298 runs-on: namespace-profile-2x4-ubuntu-2404
299 steps:
300 - name: steps::checkout_repo
301 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
302 with:
303 clean: false
304 fetch-depth: 0
305 ref: ${{ github.ref }}
306 - name: steps::cache_rust_dependencies_namespace
307 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
308 with:
309 cache: rust
310 path: ~/.rustup
311 - id: run-compliance-check
312 name: release::run_compliance_check
313 run: |
314 cargo xtask compliance "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
315 env:
316 GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
317 GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
318 continue-on-error: true
319 - name: '@actions/upload-artifact compliance-report-${GITHUB_REF_NAME}.md'
320 if: always()
321 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
322 with:
323 name: compliance-report-${GITHUB_REF_NAME}.md
324 path: compliance-report-${GITHUB_REF_NAME}.md
325 if-no-files-found: error
326 - name: send_compliance_slack_notification
327 if: always()
328 run: |
329 if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
330 STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
331 else
332 STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
333 fi
334
335 MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22")
336
337 curl -X POST -H 'Content-type: application/json' \
338 --data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
339 "$SLACK_WEBHOOK"
340 env:
341 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
342 COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
343 COMPLIANCE_TAG: ${{ github.ref_name }}
344 ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
345 timeout-minutes: 60
346 bundle_linux_aarch64:
347 needs:
348 - run_tests_linux
349 - clippy_linux
350 - check_scripts
351 runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
352 env:
353 CARGO_INCREMENTAL: 0
354 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
355 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
356 CC: clang-18
357 CXX: clang++-18
358 steps:
359 - name: steps::checkout_repo
360 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
361 with:
362 clean: false
363 - name: steps::setup_sentry
364 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
365 with:
366 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
367 - name: steps::setup_linux
368 run: ./script/linux
369 - name: steps::download_wasi_sdk
370 run: ./script/download-wasi-sdk
371 - name: ./script/bundle-linux
372 run: ./script/bundle-linux
373 - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
374 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
375 with:
376 name: zed-linux-aarch64.tar.gz
377 path: target/release/zed-linux-aarch64.tar.gz
378 if-no-files-found: error
379 - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
380 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
381 with:
382 name: zed-remote-server-linux-aarch64.gz
383 path: target/zed-remote-server-linux-aarch64.gz
384 if-no-files-found: error
385 timeout-minutes: 60
386 bundle_linux_x86_64:
387 needs:
388 - run_tests_linux
389 - clippy_linux
390 - check_scripts
391 runs-on: namespace-profile-32x64-ubuntu-2004
392 env:
393 CARGO_INCREMENTAL: 0
394 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
395 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
396 CC: clang-18
397 CXX: clang++-18
398 steps:
399 - name: steps::checkout_repo
400 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
401 with:
402 clean: false
403 - name: steps::setup_sentry
404 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
405 with:
406 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
407 - name: steps::setup_linux
408 run: ./script/linux
409 - name: steps::download_wasi_sdk
410 run: ./script/download-wasi-sdk
411 - name: ./script/bundle-linux
412 run: ./script/bundle-linux
413 - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
414 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
415 with:
416 name: zed-linux-x86_64.tar.gz
417 path: target/release/zed-linux-x86_64.tar.gz
418 if-no-files-found: error
419 - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
420 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
421 with:
422 name: zed-remote-server-linux-x86_64.gz
423 path: target/zed-remote-server-linux-x86_64.gz
424 if-no-files-found: error
425 timeout-minutes: 60
426 bundle_mac_aarch64:
427 needs:
428 - run_tests_mac
429 - clippy_mac
430 - check_scripts
431 runs-on: namespace-profile-mac-large
432 env:
433 CARGO_INCREMENTAL: 0
434 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
435 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
436 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
437 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
438 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
439 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
440 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
441 steps:
442 - name: steps::checkout_repo
443 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
444 with:
445 clean: false
446 - name: steps::setup_node
447 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
448 with:
449 node-version: '20'
450 - name: steps::setup_sentry
451 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
452 with:
453 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
454 - name: steps::clear_target_dir_if_large
455 run: ./script/clear-target-dir-if-larger-than 300
456 - name: run_bundling::bundle_mac::bundle_mac
457 run: ./script/bundle-mac aarch64-apple-darwin
458 - name: '@actions/upload-artifact Zed-aarch64.dmg'
459 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
460 with:
461 name: Zed-aarch64.dmg
462 path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
463 if-no-files-found: error
464 - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
465 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
466 with:
467 name: zed-remote-server-macos-aarch64.gz
468 path: target/zed-remote-server-macos-aarch64.gz
469 if-no-files-found: error
470 timeout-minutes: 60
471 bundle_mac_x86_64:
472 needs:
473 - run_tests_mac
474 - clippy_mac
475 - check_scripts
476 runs-on: namespace-profile-mac-large
477 env:
478 CARGO_INCREMENTAL: 0
479 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
480 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
481 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
482 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
483 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
484 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
485 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
486 steps:
487 - name: steps::checkout_repo
488 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
489 with:
490 clean: false
491 - name: steps::setup_node
492 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
493 with:
494 node-version: '20'
495 - name: steps::setup_sentry
496 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
497 with:
498 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
499 - name: steps::clear_target_dir_if_large
500 run: ./script/clear-target-dir-if-larger-than 300
501 - name: run_bundling::bundle_mac::bundle_mac
502 run: ./script/bundle-mac x86_64-apple-darwin
503 - name: '@actions/upload-artifact Zed-x86_64.dmg'
504 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
505 with:
506 name: Zed-x86_64.dmg
507 path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
508 if-no-files-found: error
509 - name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
510 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
511 with:
512 name: zed-remote-server-macos-x86_64.gz
513 path: target/zed-remote-server-macos-x86_64.gz
514 if-no-files-found: error
515 timeout-minutes: 60
516 bundle_windows_aarch64:
517 needs:
518 - run_tests_windows
519 - clippy_windows
520 - check_scripts
521 runs-on: self-32vcpu-windows-2022
522 env:
523 CARGO_INCREMENTAL: 0
524 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
525 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
526 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
527 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
528 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
529 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
530 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
531 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
532 FILE_DIGEST: SHA256
533 TIMESTAMP_DIGEST: SHA256
534 TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
535 steps:
536 - name: steps::checkout_repo
537 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
538 with:
539 clean: false
540 - name: steps::setup_sentry
541 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
542 with:
543 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
544 - name: run_bundling::bundle_windows::bundle_windows
545 run: script/bundle-windows.ps1 -Architecture aarch64
546 shell: pwsh
547 working-directory: ${{ env.ZED_WORKSPACE }}
548 - name: '@actions/upload-artifact Zed-aarch64.exe'
549 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
550 with:
551 name: Zed-aarch64.exe
552 path: target/Zed-aarch64.exe
553 if-no-files-found: error
554 - name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
555 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
556 with:
557 name: zed-remote-server-windows-aarch64.zip
558 path: target/zed-remote-server-windows-aarch64.zip
559 if-no-files-found: error
560 timeout-minutes: 60
561 bundle_windows_x86_64:
562 needs:
563 - run_tests_windows
564 - clippy_windows
565 - check_scripts
566 runs-on: self-32vcpu-windows-2022
567 env:
568 CARGO_INCREMENTAL: 0
569 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
570 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
571 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
572 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
573 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
574 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
575 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
576 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
577 FILE_DIGEST: SHA256
578 TIMESTAMP_DIGEST: SHA256
579 TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
580 steps:
581 - name: steps::checkout_repo
582 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
583 with:
584 clean: false
585 - name: steps::setup_sentry
586 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
587 with:
588 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
589 - name: run_bundling::bundle_windows::bundle_windows
590 run: script/bundle-windows.ps1 -Architecture x86_64
591 shell: pwsh
592 working-directory: ${{ env.ZED_WORKSPACE }}
593 - name: '@actions/upload-artifact Zed-x86_64.exe'
594 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
595 with:
596 name: Zed-x86_64.exe
597 path: target/Zed-x86_64.exe
598 if-no-files-found: error
599 - name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
600 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
601 with:
602 name: zed-remote-server-windows-x86_64.zip
603 path: target/zed-remote-server-windows-x86_64.zip
604 if-no-files-found: error
605 timeout-minutes: 60
606 upload_release_assets:
607 needs:
608 - create_draft_release
609 - bundle_linux_aarch64
610 - bundle_linux_x86_64
611 - bundle_mac_aarch64
612 - bundle_mac_x86_64
613 - bundle_windows_aarch64
614 - bundle_windows_x86_64
615 runs-on: namespace-profile-4x8-ubuntu-2204
616 steps:
617 - name: release::download_workflow_artifacts
618 uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
619 with:
620 path: ./artifacts/
621 - name: ls -lR ./artifacts
622 run: ls -lR ./artifacts
623 - name: release::prep_release_artifacts
624 run: |-
625 mkdir -p release-artifacts/
626
627 mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
628 mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
629 mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
630 mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
631 mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
632 mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
633 mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
634 mv ./artifacts/zed-remote-server-macos-x86_64.gz/zed-remote-server-macos-x86_64.gz release-artifacts/zed-remote-server-macos-x86_64.gz
635 mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
636 mv ./artifacts/zed-remote-server-linux-x86_64.gz/zed-remote-server-linux-x86_64.gz release-artifacts/zed-remote-server-linux-x86_64.gz
637 mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
638 mv ./artifacts/zed-remote-server-windows-x86_64.zip/zed-remote-server-windows-x86_64.zip release-artifacts/zed-remote-server-windows-x86_64.zip
639 - name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
640 run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
641 env:
642 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
643 validate_release_assets:
644 needs:
645 - upload_release_assets
646 runs-on: namespace-profile-2x4-ubuntu-2404
647 steps:
648 - name: release::validate_release_assets
649 run: |
650 EXPECTED_ASSETS='["Zed-aarch64.dmg", "Zed-x86_64.dmg", "zed-linux-aarch64.tar.gz", "zed-linux-x86_64.tar.gz", "Zed-x86_64.exe", "Zed-aarch64.exe", "zed-remote-server-macos-aarch64.gz", "zed-remote-server-macos-x86_64.gz", "zed-remote-server-linux-aarch64.gz", "zed-remote-server-linux-x86_64.gz", "zed-remote-server-windows-aarch64.zip", "zed-remote-server-windows-x86_64.zip"]'
651 TAG="$GITHUB_REF_NAME"
652
653 ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
654
655 MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
656
657 if [ -n "$MISSING_ASSETS" ]; then
658 echo "Error: The following assets are missing from the release:"
659 echo "$MISSING_ASSETS"
660 exit 1
661 fi
662
663 echo "All expected assets are present in the release."
664 env:
665 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
666 - name: steps::checkout_repo
667 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
668 with:
669 clean: false
670 fetch-depth: 0
671 ref: ${{ github.ref }}
672 - name: steps::cache_rust_dependencies_namespace
673 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
674 with:
675 cache: rust
676 path: ~/.rustup
677 - id: run-compliance-check
678 name: release::run_compliance_check
679 run: |
680 cargo xtask compliance "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
681 env:
682 GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
683 GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
684 continue-on-error: true
685 - name: '@actions/upload-artifact compliance-report-${GITHUB_REF_NAME}.md'
686 if: always()
687 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
688 with:
689 name: compliance-report-${GITHUB_REF_NAME}.md
690 path: compliance-report-${GITHUB_REF_NAME}.md
691 if-no-files-found: error
692 overwrite: true
693 - name: send_compliance_slack_notification
694 if: always()
695 run: |
696 if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
697 STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
698 else
699 STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
700 fi
701
702 MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22")
703
704 curl -X POST -H 'Content-type: application/json' \
705 --data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
706 "$SLACK_WEBHOOK"
707 env:
708 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
709 COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
710 COMPLIANCE_TAG: ${{ github.ref_name }}
711 ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
712 auto_release_preview:
713 needs:
714 - validate_release_assets
715 if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre')
716 runs-on: namespace-profile-2x4-ubuntu-2404
717 steps:
718 - id: generate-token
719 name: steps::authenticate_as_zippy
720 uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
721 with:
722 app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
723 private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
724 - name: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
725 run: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
726 env:
727 GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
728 push_release_update_notification:
729 needs:
730 - create_draft_release
731 - upload_release_assets
732 - validate_release_assets
733 - auto_release_preview
734 - run_tests_mac
735 - run_tests_linux
736 - run_tests_windows
737 - clippy_mac
738 - clippy_linux
739 - clippy_windows
740 - check_scripts
741 - bundle_linux_aarch64
742 - bundle_linux_x86_64
743 - bundle_mac_aarch64
744 - bundle_mac_x86_64
745 - bundle_windows_aarch64
746 - bundle_windows_x86_64
747 if: always()
748 runs-on: namespace-profile-2x4-ubuntu-2404
749 steps:
750 - id: generate-webhook-message
751 name: release::generate_slack_message
752 run: |
753 MESSAGE=$(TAG="$GITHUB_REF_NAME"
754
755 if [ "$DRAFT_RESULT" == "failure" ]; then
756 echo "❌ Draft release creation failed for $TAG: $RUN_URL"
757 else
758 RELEASE_URL=$(gh release view "$TAG" --repo=zed-industries/zed --json url -q '.url')
759 if [ "$UPLOAD_RESULT" == "failure" ]; then
760 echo "❌ Release asset upload failed for $TAG: $RELEASE_URL"
761 elif [ "$UPLOAD_RESULT" == "cancelled" ] || [ "$UPLOAD_RESULT" == "skipped" ]; then
762 FAILED_JOBS=""
763 if [ "$RESULT_RUN_TESTS_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_mac"; fi
764 if [ "$RESULT_RUN_TESTS_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_linux"; fi
765 if [ "$RESULT_RUN_TESTS_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_windows"; fi
766 if [ "$RESULT_CLIPPY_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_mac"; fi
767 if [ "$RESULT_CLIPPY_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_linux"; fi
768 if [ "$RESULT_CLIPPY_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_windows"; fi
769 if [ "$RESULT_CHECK_SCRIPTS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS check_scripts"; fi
770 if [ "$RESULT_BUNDLE_LINUX_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_aarch64"; fi
771 if [ "$RESULT_BUNDLE_LINUX_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_x86_64"; fi
772 if [ "$RESULT_BUNDLE_MAC_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_aarch64"; fi
773 if [ "$RESULT_BUNDLE_MAC_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_x86_64"; fi
774 if [ "$RESULT_BUNDLE_WINDOWS_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_aarch64"; fi
775 if [ "$RESULT_BUNDLE_WINDOWS_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_x86_64"; fi
776 FAILED_JOBS=$(echo "$FAILED_JOBS" | xargs)
777 if [ "$UPLOAD_RESULT" == "cancelled" ]; then
778 if [ -n "$FAILED_JOBS" ]; then
779 echo "❌ Release job for $TAG was cancelled, most likely because tests \`$FAILED_JOBS\` failed: $RUN_URL"
780 else
781 echo "❌ Release job for $TAG was cancelled: $RUN_URL"
782 fi
783 else
784 if [ -n "$FAILED_JOBS" ]; then
785 echo "❌ Tests \`$FAILED_JOBS\` for $TAG failed: $RUN_URL"
786 else
787 echo "❌ Tests for $TAG failed: $RUN_URL"
788 fi
789 fi
790 elif [ "$VALIDATE_RESULT" == "failure" ]; then
791 echo "❌ Release asset validation failed for $TAG (missing assets): $RUN_URL"
792 elif [ "$AUTO_RELEASE_RESULT" == "success" ]; then
793 echo "✅ Release $TAG was auto-released successfully: $RELEASE_URL"
794 elif [ "$AUTO_RELEASE_RESULT" == "failure" ]; then
795 echo "❌ Auto release failed for $TAG: $RUN_URL"
796 else
797 echo "👀 Release $TAG sitting freshly baked in the oven and waiting to be published: $RELEASE_URL"
798 fi
799 fi
800 )
801 echo "message=$MESSAGE" >> "$GITHUB_OUTPUT"
802 env:
803 GH_TOKEN: ${{ github.token }}
804 DRAFT_RESULT: ${{ needs.create_draft_release.result }}
805 UPLOAD_RESULT: ${{ needs.upload_release_assets.result }}
806 VALIDATE_RESULT: ${{ needs.validate_release_assets.result }}
807 AUTO_RELEASE_RESULT: ${{ needs.auto_release_preview.result }}
808 RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
809 RESULT_RUN_TESTS_MAC: ${{ needs.run_tests_mac.result }}
810 RESULT_RUN_TESTS_LINUX: ${{ needs.run_tests_linux.result }}
811 RESULT_RUN_TESTS_WINDOWS: ${{ needs.run_tests_windows.result }}
812 RESULT_CLIPPY_MAC: ${{ needs.clippy_mac.result }}
813 RESULT_CLIPPY_LINUX: ${{ needs.clippy_linux.result }}
814 RESULT_CLIPPY_WINDOWS: ${{ needs.clippy_windows.result }}
815 RESULT_CHECK_SCRIPTS: ${{ needs.check_scripts.result }}
816 RESULT_BUNDLE_LINUX_AARCH64: ${{ needs.bundle_linux_aarch64.result }}
817 RESULT_BUNDLE_LINUX_X86_64: ${{ needs.bundle_linux_x86_64.result }}
818 RESULT_BUNDLE_MAC_AARCH64: ${{ needs.bundle_mac_aarch64.result }}
819 RESULT_BUNDLE_MAC_X86_64: ${{ needs.bundle_mac_x86_64.result }}
820 RESULT_BUNDLE_WINDOWS_AARCH64: ${{ needs.bundle_windows_aarch64.result }}
821 RESULT_BUNDLE_WINDOWS_X86_64: ${{ needs.bundle_windows_x86_64.result }}
822 - name: release::send_slack_message
823 run: 'curl -X POST -H ''Content-type: application/json'' --data "$(jq -n --arg text "$SLACK_MESSAGE" ''{"text": $text}'')" "$SLACK_WEBHOOK"'
824 env:
825 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
826 SLACK_MESSAGE: ${{ steps.generate-webhook-message.outputs.message }}
827concurrency:
828 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
829 cancel-in-progress: true
830defaults:
831 run:
832 shell: bash -euxo pipefail {0}