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 350 200
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::show_sccache_stats
47 run: sccache --show-stats || true
48 - name: steps::cleanup_cargo_config
49 if: always()
50 run: |
51 rm -rf ./../.cargo
52 timeout-minutes: 60
53 run_tests_linux:
54 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
55 runs-on: namespace-profile-16x32-ubuntu-2204
56 env:
57 CC: clang
58 CXX: clang++
59 steps:
60 - name: steps::checkout_repo
61 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
62 with:
63 clean: false
64 - name: steps::setup_cargo_config
65 run: |
66 mkdir -p ./../.cargo
67 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
68 - name: steps::cache_rust_dependencies_namespace
69 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
70 with:
71 cache: rust
72 path: ~/.rustup
73 - name: steps::setup_linux
74 run: ./script/linux
75 - name: steps::download_wasi_sdk
76 run: ./script/download-wasi-sdk
77 - name: steps::setup_node
78 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
79 with:
80 node-version: '20'
81 - name: steps::cargo_install_nextest
82 uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
83 - name: steps::clear_target_dir_if_large
84 run: ./script/clear-target-dir-if-larger-than 350 200
85 - name: steps::setup_sccache
86 run: ./script/setup-sccache
87 env:
88 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
89 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
90 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
91 SCCACHE_BUCKET: sccache-zed
92 - name: steps::cargo_nextest
93 run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
94 - name: steps::show_sccache_stats
95 run: sccache --show-stats || true
96 - name: steps::cleanup_cargo_config
97 if: always()
98 run: |
99 rm -rf ./../.cargo
100 timeout-minutes: 60
101 services:
102 postgres:
103 image: postgres:15
104 env:
105 POSTGRES_HOST_AUTH_METHOD: trust
106 ports:
107 - 5432:5432
108 options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10
109 run_tests_windows:
110 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
111 runs-on: self-32vcpu-windows-2022
112 steps:
113 - name: steps::checkout_repo
114 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
115 with:
116 clean: false
117 - name: steps::setup_cargo_config
118 run: |
119 New-Item -ItemType Directory -Path "./../.cargo" -Force
120 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
121 shell: pwsh
122 - name: steps::setup_node
123 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
124 with:
125 node-version: '20'
126 - name: steps::clear_target_dir_if_large
127 run: ./script/clear-target-dir-if-larger-than.ps1 350 200
128 shell: pwsh
129 - name: steps::setup_sccache
130 run: ./script/setup-sccache.ps1
131 shell: pwsh
132 env:
133 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
134 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
135 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
136 SCCACHE_BUCKET: sccache-zed
137 - name: steps::cargo_nextest
138 run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
139 shell: pwsh
140 - name: steps::show_sccache_stats
141 run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
142 shell: pwsh
143 - name: steps::cleanup_cargo_config
144 if: always()
145 run: |
146 Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
147 shell: pwsh
148 timeout-minutes: 60
149 clippy_mac:
150 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
151 runs-on: namespace-profile-mac-large
152 steps:
153 - name: steps::checkout_repo
154 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
155 with:
156 clean: false
157 - name: steps::setup_cargo_config
158 run: |
159 mkdir -p ./../.cargo
160 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
161 - name: steps::cache_rust_dependencies_namespace
162 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
163 with:
164 cache: rust
165 path: ~/.rustup
166 - name: steps::setup_sccache
167 run: ./script/setup-sccache
168 env:
169 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
170 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
171 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
172 SCCACHE_BUCKET: sccache-zed
173 - name: steps::clippy
174 run: ./script/clippy
175 - name: steps::show_sccache_stats
176 run: sccache --show-stats || true
177 timeout-minutes: 60
178 clippy_linux:
179 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
180 runs-on: namespace-profile-16x32-ubuntu-2204
181 env:
182 CC: clang
183 CXX: clang++
184 steps:
185 - name: steps::checkout_repo
186 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
187 with:
188 clean: false
189 - name: steps::setup_cargo_config
190 run: |
191 mkdir -p ./../.cargo
192 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
193 - name: steps::cache_rust_dependencies_namespace
194 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
195 with:
196 cache: rust
197 path: ~/.rustup
198 - name: steps::setup_linux
199 run: ./script/linux
200 - name: steps::download_wasi_sdk
201 run: ./script/download-wasi-sdk
202 - name: steps::setup_sccache
203 run: ./script/setup-sccache
204 env:
205 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
206 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
207 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
208 SCCACHE_BUCKET: sccache-zed
209 - name: steps::clippy
210 run: ./script/clippy
211 - name: steps::show_sccache_stats
212 run: sccache --show-stats || true
213 timeout-minutes: 60
214 clippy_windows:
215 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
216 runs-on: self-32vcpu-windows-2022
217 steps:
218 - name: steps::checkout_repo
219 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
220 with:
221 clean: false
222 - name: steps::setup_cargo_config
223 run: |
224 New-Item -ItemType Directory -Path "./../.cargo" -Force
225 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
226 shell: pwsh
227 - name: steps::setup_sccache
228 run: ./script/setup-sccache.ps1
229 shell: pwsh
230 env:
231 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
232 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
233 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
234 SCCACHE_BUCKET: sccache-zed
235 - name: steps::clippy
236 run: ./script/clippy.ps1
237 shell: pwsh
238 - name: steps::show_sccache_stats
239 run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
240 shell: pwsh
241 timeout-minutes: 60
242 check_scripts:
243 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
244 runs-on: namespace-profile-2x4-ubuntu-2404
245 steps:
246 - name: steps::checkout_repo
247 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
248 with:
249 clean: false
250 - name: run_tests::check_scripts::run_shellcheck
251 run: ./script/shellcheck-scripts error
252 - id: get_actionlint
253 name: run_tests::check_scripts::download_actionlint
254 run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
255 - name: run_tests::check_scripts::run_actionlint
256 run: '"$ACTIONLINT_BIN" -color'
257 env:
258 ACTIONLINT_BIN: ${{ steps.get_actionlint.outputs.executable }}
259 - name: steps::cache_rust_dependencies_namespace
260 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
261 with:
262 cache: rust
263 path: ~/.rustup
264 - name: run_tests::check_scripts::check_xtask_workflows
265 run: |
266 cargo xtask workflows
267 if ! git diff --exit-code .github; then
268 echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
269 echo "Please run 'cargo xtask workflows' locally and commit the changes"
270 exit 1
271 fi
272 timeout-minutes: 60
273 create_draft_release:
274 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
275 runs-on: namespace-profile-2x4-ubuntu-2404
276 steps:
277 - name: steps::checkout_repo
278 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
279 with:
280 clean: false
281 fetch-depth: 25
282 ref: ${{ github.ref }}
283 - name: script/determine-release-channel
284 run: script/determine-release-channel
285 - name: mkdir -p target/
286 run: mkdir -p target/
287 - name: release::create_draft_release::generate_release_notes
288 run: node --redirect-warnings=/dev/null ./script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md
289 - name: release::create_draft_release::create_release
290 run: script/create-draft-release target/release-notes.md
291 env:
292 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293 timeout-minutes: 60
294 compliance_check:
295 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
296 runs-on: namespace-profile-2x4-ubuntu-2404
297 steps:
298 - name: steps::checkout_repo
299 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
300 with:
301 clean: false
302 fetch-depth: 0
303 ref: ${{ github.ref }}
304 - name: steps::cache_rust_dependencies_namespace
305 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
306 with:
307 cache: rust
308 path: ~/.rustup
309 - id: run-compliance-check
310 name: release::add_compliance_steps::run_compliance_check
311 run: |
312 cargo xtask compliance "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
313 env:
314 GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
315 GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
316 continue-on-error: true
317 - name: '@actions/upload-artifact compliance-report-${GITHUB_REF_NAME}.md'
318 if: always()
319 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
320 with:
321 name: compliance-report-${GITHUB_REF_NAME}.md
322 path: compliance-report-${GITHUB_REF_NAME}.md
323 if-no-files-found: error
324 - name: send_compliance_slack_notification
325 if: always()
326 run: |
327 if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
328 STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
329 MESSAGE=$(printf "%s\n\nReport: %s" "$STATUS" "$ARTIFACT_URL")
330 else
331 STATUS="❌ Preliminary compliance check failed (but this can still be fixed while the builds are running!) for $COMPLIANCE_TAG"
332 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")
333 fi
334
335 curl -X POST -H 'Content-type: application/json' \
336 --data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
337 "$SLACK_WEBHOOK"
338 env:
339 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
340 COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
341 COMPLIANCE_TAG: ${{ github.ref_name }}
342 ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
343 outputs:
344 outcome: ${{ steps.run-compliance-check.outputs.outcome }}
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 350 200
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 350 200
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 - compliance_check
647 runs-on: namespace-profile-2x4-ubuntu-2404
648 steps:
649 - name: release::validate_release_assets
650 run: |
651 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"]'
652 TAG="$GITHUB_REF_NAME"
653
654 ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
655
656 MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
657
658 if [ -n "$MISSING_ASSETS" ]; then
659 echo "Error: The following assets are missing from the release:"
660 echo "$MISSING_ASSETS"
661 exit 1
662 fi
663
664 echo "All expected assets are present in the release."
665 env:
666 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
667 - name: steps::checkout_repo
668 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
669 with:
670 clean: false
671 fetch-depth: 0
672 ref: ${{ github.ref }}
673 - name: steps::cache_rust_dependencies_namespace
674 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
675 with:
676 cache: rust
677 path: ~/.rustup
678 - id: run-compliance-check
679 name: release::add_compliance_steps::run_compliance_check
680 run: |
681 cargo xtask compliance "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
682 env:
683 GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
684 GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
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: failure() || needs.compliance_check.outputs.outcome != 'success'
695 run: |
696 if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
697 STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
698 MESSAGE=$(printf "%s\n\nReport: %s" "$STATUS" "$ARTIFACT_URL")
699 else
700 STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
701 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")
702 fi
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}