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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
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@nextest
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::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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
70 with:
71 cache: rust
72 path: ~/.rustup
73 - name: steps::setup_linux
74 run: ./script/linux
75 - name: steps::install_mold
76 run: ./script/install-mold
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@nextest
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@11bd71901bbe5b1630ceea73d27597364c9af683
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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
197 with:
198 cache: rust
199 path: ~/.rustup
200 - name: steps::setup_linux
201 run: ./script/linux
202 - name: steps::install_mold
203 run: ./script/install-mold
204 - name: steps::download_wasi_sdk
205 run: ./script/download-wasi-sdk
206 - name: steps::setup_sccache
207 run: ./script/setup-sccache
208 env:
209 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
210 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
211 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
212 SCCACHE_BUCKET: sccache-zed
213 - name: steps::clippy
214 run: ./script/clippy
215 - name: steps::show_sccache_stats
216 run: sccache --show-stats || true
217 timeout-minutes: 60
218 clippy_windows:
219 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
220 runs-on: self-32vcpu-windows-2022
221 steps:
222 - name: steps::checkout_repo
223 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
224 with:
225 clean: false
226 - name: steps::setup_cargo_config
227 run: |
228 New-Item -ItemType Directory -Path "./../.cargo" -Force
229 Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
230 shell: pwsh
231 - name: steps::setup_sccache
232 run: ./script/setup-sccache.ps1
233 shell: pwsh
234 env:
235 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
236 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
237 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
238 SCCACHE_BUCKET: sccache-zed
239 - name: steps::clippy
240 run: ./script/clippy.ps1
241 shell: pwsh
242 - name: steps::show_sccache_stats
243 run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
244 shell: pwsh
245 timeout-minutes: 60
246 check_scripts:
247 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
248 runs-on: namespace-profile-2x4-ubuntu-2404
249 steps:
250 - name: steps::checkout_repo
251 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
252 with:
253 clean: false
254 - name: run_tests::check_scripts::run_shellcheck
255 run: ./script/shellcheck-scripts error
256 - id: get_actionlint
257 name: run_tests::check_scripts::download_actionlint
258 run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
259 - name: run_tests::check_scripts::run_actionlint
260 run: |
261 ${{ steps.get_actionlint.outputs.executable }} -color
262 - name: run_tests::check_scripts::check_xtask_workflows
263 run: |
264 cargo xtask workflows
265 if ! git diff --exit-code .github; then
266 echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
267 echo "Please run 'cargo xtask workflows' locally and commit the changes"
268 exit 1
269 fi
270 timeout-minutes: 60
271 create_draft_release:
272 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
273 runs-on: namespace-profile-2x4-ubuntu-2404
274 steps:
275 - name: steps::checkout_repo
276 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
277 with:
278 clean: false
279 fetch-depth: 25
280 ref: ${{ github.ref }}
281 - name: script/determine-release-channel
282 run: script/determine-release-channel
283 - name: mkdir -p target/
284 run: mkdir -p target/
285 - name: release::create_draft_release::generate_release_notes
286 run: node --redirect-warnings=/dev/null ./script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md
287 - name: release::create_draft_release::create_release
288 run: script/create-draft-release target/release-notes.md
289 env:
290 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
291 timeout-minutes: 60
292 bundle_linux_aarch64:
293 needs:
294 - run_tests_linux
295 - clippy_linux
296 - check_scripts
297 runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
298 env:
299 CARGO_INCREMENTAL: 0
300 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
301 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
302 CC: clang-18
303 CXX: clang++-18
304 steps:
305 - name: steps::checkout_repo
306 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
307 with:
308 clean: false
309 - name: steps::setup_sentry
310 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
311 with:
312 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
313 - name: steps::setup_linux
314 run: ./script/linux
315 - name: steps::install_mold
316 run: ./script/install-mold
317 - name: steps::download_wasi_sdk
318 run: ./script/download-wasi-sdk
319 - name: ./script/bundle-linux
320 run: ./script/bundle-linux
321 - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
322 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
323 with:
324 name: zed-linux-aarch64.tar.gz
325 path: target/release/zed-linux-aarch64.tar.gz
326 if-no-files-found: error
327 - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
328 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
329 with:
330 name: zed-remote-server-linux-aarch64.gz
331 path: target/zed-remote-server-linux-aarch64.gz
332 if-no-files-found: error
333 timeout-minutes: 60
334 bundle_linux_x86_64:
335 needs:
336 - run_tests_linux
337 - clippy_linux
338 - check_scripts
339 runs-on: namespace-profile-32x64-ubuntu-2004
340 env:
341 CARGO_INCREMENTAL: 0
342 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
343 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
344 CC: clang-18
345 CXX: clang++-18
346 steps:
347 - name: steps::checkout_repo
348 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
349 with:
350 clean: false
351 - name: steps::setup_sentry
352 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
353 with:
354 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
355 - name: steps::setup_linux
356 run: ./script/linux
357 - name: steps::install_mold
358 run: ./script/install-mold
359 - name: steps::download_wasi_sdk
360 run: ./script/download-wasi-sdk
361 - name: ./script/bundle-linux
362 run: ./script/bundle-linux
363 - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
364 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
365 with:
366 name: zed-linux-x86_64.tar.gz
367 path: target/release/zed-linux-x86_64.tar.gz
368 if-no-files-found: error
369 - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
370 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
371 with:
372 name: zed-remote-server-linux-x86_64.gz
373 path: target/zed-remote-server-linux-x86_64.gz
374 if-no-files-found: error
375 timeout-minutes: 60
376 bundle_mac_aarch64:
377 needs:
378 - run_tests_mac
379 - clippy_mac
380 - check_scripts
381 runs-on: namespace-profile-mac-large
382 env:
383 CARGO_INCREMENTAL: 0
384 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
385 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
386 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
387 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
388 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
389 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
390 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
391 steps:
392 - name: steps::checkout_repo
393 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
394 with:
395 clean: false
396 - name: steps::setup_node
397 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
398 with:
399 node-version: '20'
400 - name: steps::setup_sentry
401 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
402 with:
403 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
404 - name: steps::clear_target_dir_if_large
405 run: ./script/clear-target-dir-if-larger-than 300
406 - name: run_bundling::bundle_mac::bundle_mac
407 run: ./script/bundle-mac aarch64-apple-darwin
408 - name: '@actions/upload-artifact Zed-aarch64.dmg'
409 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
410 with:
411 name: Zed-aarch64.dmg
412 path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
413 if-no-files-found: error
414 - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
415 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
416 with:
417 name: zed-remote-server-macos-aarch64.gz
418 path: target/zed-remote-server-macos-aarch64.gz
419 if-no-files-found: error
420 timeout-minutes: 60
421 bundle_mac_x86_64:
422 needs:
423 - run_tests_mac
424 - clippy_mac
425 - check_scripts
426 runs-on: namespace-profile-mac-large
427 env:
428 CARGO_INCREMENTAL: 0
429 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
430 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
431 MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
432 MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
433 APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
434 APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
435 APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
436 steps:
437 - name: steps::checkout_repo
438 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
439 with:
440 clean: false
441 - name: steps::setup_node
442 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
443 with:
444 node-version: '20'
445 - name: steps::setup_sentry
446 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
447 with:
448 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
449 - name: steps::clear_target_dir_if_large
450 run: ./script/clear-target-dir-if-larger-than 300
451 - name: run_bundling::bundle_mac::bundle_mac
452 run: ./script/bundle-mac x86_64-apple-darwin
453 - name: '@actions/upload-artifact Zed-x86_64.dmg'
454 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
455 with:
456 name: Zed-x86_64.dmg
457 path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
458 if-no-files-found: error
459 - name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
460 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
461 with:
462 name: zed-remote-server-macos-x86_64.gz
463 path: target/zed-remote-server-macos-x86_64.gz
464 if-no-files-found: error
465 timeout-minutes: 60
466 bundle_windows_aarch64:
467 needs:
468 - run_tests_windows
469 - clippy_windows
470 - check_scripts
471 runs-on: self-32vcpu-windows-2022
472 env:
473 CARGO_INCREMENTAL: 0
474 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
475 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
476 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
477 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
478 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
479 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
480 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
481 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
482 FILE_DIGEST: SHA256
483 TIMESTAMP_DIGEST: SHA256
484 TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
485 steps:
486 - name: steps::checkout_repo
487 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
488 with:
489 clean: false
490 - name: steps::setup_sentry
491 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
492 with:
493 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
494 - name: run_bundling::bundle_windows::bundle_windows
495 run: script/bundle-windows.ps1 -Architecture aarch64
496 shell: pwsh
497 working-directory: ${{ env.ZED_WORKSPACE }}
498 - name: '@actions/upload-artifact Zed-aarch64.exe'
499 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
500 with:
501 name: Zed-aarch64.exe
502 path: target/Zed-aarch64.exe
503 if-no-files-found: error
504 - name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
505 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
506 with:
507 name: zed-remote-server-windows-aarch64.zip
508 path: target/zed-remote-server-windows-aarch64.zip
509 if-no-files-found: error
510 timeout-minutes: 60
511 bundle_windows_x86_64:
512 needs:
513 - run_tests_windows
514 - clippy_windows
515 - check_scripts
516 runs-on: self-32vcpu-windows-2022
517 env:
518 CARGO_INCREMENTAL: 0
519 ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
520 ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
521 AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
522 AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
523 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
524 ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
525 CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
526 ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
527 FILE_DIGEST: SHA256
528 TIMESTAMP_DIGEST: SHA256
529 TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
530 steps:
531 - name: steps::checkout_repo
532 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
533 with:
534 clean: false
535 - name: steps::setup_sentry
536 uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
537 with:
538 token: ${{ secrets.SENTRY_AUTH_TOKEN }}
539 - name: run_bundling::bundle_windows::bundle_windows
540 run: script/bundle-windows.ps1 -Architecture x86_64
541 shell: pwsh
542 working-directory: ${{ env.ZED_WORKSPACE }}
543 - name: '@actions/upload-artifact Zed-x86_64.exe'
544 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
545 with:
546 name: Zed-x86_64.exe
547 path: target/Zed-x86_64.exe
548 if-no-files-found: error
549 - name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
550 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
551 with:
552 name: zed-remote-server-windows-x86_64.zip
553 path: target/zed-remote-server-windows-x86_64.zip
554 if-no-files-found: error
555 timeout-minutes: 60
556 upload_release_assets:
557 needs:
558 - create_draft_release
559 - bundle_linux_aarch64
560 - bundle_linux_x86_64
561 - bundle_mac_aarch64
562 - bundle_mac_x86_64
563 - bundle_windows_aarch64
564 - bundle_windows_x86_64
565 runs-on: namespace-profile-4x8-ubuntu-2204
566 steps:
567 - name: release::download_workflow_artifacts
568 uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
569 with:
570 path: ./artifacts/
571 - name: ls -lR ./artifacts
572 run: ls -lR ./artifacts
573 - name: release::prep_release_artifacts
574 run: |-
575 mkdir -p release-artifacts/
576
577 mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
578 mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
579 mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
580 mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
581 mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
582 mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
583 mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
584 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
585 mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
586 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
587 mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
588 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
589 - name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
590 run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
591 env:
592 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
593 validate_release_assets:
594 needs:
595 - upload_release_assets
596 runs-on: namespace-profile-2x4-ubuntu-2404
597 steps:
598 - name: release::validate_release_assets
599 run: |
600 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"]'
601 TAG="$GITHUB_REF_NAME"
602
603 ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
604
605 MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
606
607 if [ -n "$MISSING_ASSETS" ]; then
608 echo "Error: The following assets are missing from the release:"
609 echo "$MISSING_ASSETS"
610 exit 1
611 fi
612
613 echo "All expected assets are present in the release."
614 env:
615 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
616 auto_release_preview:
617 needs:
618 - validate_release_assets
619 if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre')
620 runs-on: namespace-profile-2x4-ubuntu-2404
621 steps:
622 - id: get-app-token
623 name: steps::authenticate_as_zippy
624 uses: actions/create-github-app-token@bef1eaf1c0ac2b148ee2a0a74c65fbe6db0631f1
625 with:
626 app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
627 private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
628 - name: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
629 run: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
630 env:
631 GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
632 push_release_update_notification:
633 needs:
634 - create_draft_release
635 - upload_release_assets
636 - validate_release_assets
637 - auto_release_preview
638 - run_tests_mac
639 - run_tests_linux
640 - run_tests_windows
641 - clippy_mac
642 - clippy_linux
643 - clippy_windows
644 - check_scripts
645 - bundle_linux_aarch64
646 - bundle_linux_x86_64
647 - bundle_mac_aarch64
648 - bundle_mac_x86_64
649 - bundle_windows_aarch64
650 - bundle_windows_x86_64
651 if: always()
652 runs-on: namespace-profile-2x4-ubuntu-2404
653 steps:
654 - id: generate-webhook-message
655 name: release::generate_slack_message
656 run: |
657 MESSAGE=$(DRAFT_RESULT="${{ needs.create_draft_release.result }}"
658 UPLOAD_RESULT="${{ needs.upload_release_assets.result }}"
659 VALIDATE_RESULT="${{ needs.validate_release_assets.result }}"
660 AUTO_RELEASE_RESULT="${{ needs.auto_release_preview.result }}"
661 TAG="$GITHUB_REF_NAME"
662 RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
663
664 if [ "$DRAFT_RESULT" == "failure" ]; then
665 echo "❌ Draft release creation failed for $TAG: $RUN_URL"
666 else
667 RELEASE_URL=$(gh release view "$TAG" --repo=zed-industries/zed --json url -q '.url')
668 if [ "$UPLOAD_RESULT" == "failure" ]; then
669 echo "❌ Release asset upload failed for $TAG: $RELEASE_URL"
670 elif [ "$UPLOAD_RESULT" == "cancelled" ] || [ "$UPLOAD_RESULT" == "skipped" ]; then
671 FAILED_JOBS=""
672 if [ "${{ needs.run_tests_mac.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_mac"; fi
673 if [ "${{ needs.run_tests_linux.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_linux"; fi
674 if [ "${{ needs.run_tests_windows.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_windows"; fi
675 if [ "${{ needs.clippy_mac.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_mac"; fi
676 if [ "${{ needs.clippy_linux.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_linux"; fi
677 if [ "${{ needs.clippy_windows.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_windows"; fi
678 if [ "${{ needs.check_scripts.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS check_scripts"; fi
679 if [ "${{ needs.bundle_linux_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_aarch64"; fi
680 if [ "${{ needs.bundle_linux_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_x86_64"; fi
681 if [ "${{ needs.bundle_mac_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_aarch64"; fi
682 if [ "${{ needs.bundle_mac_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_x86_64"; fi
683 if [ "${{ needs.bundle_windows_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_aarch64"; fi
684 if [ "${{ needs.bundle_windows_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_x86_64"; fi
685 FAILED_JOBS=$(echo "$FAILED_JOBS" | xargs)
686 if [ "$UPLOAD_RESULT" == "cancelled" ]; then
687 if [ -n "$FAILED_JOBS" ]; then
688 echo "❌ Release job for $TAG was cancelled, most likely because tests \`$FAILED_JOBS\` failed: $RUN_URL"
689 else
690 echo "❌ Release job for $TAG was cancelled: $RUN_URL"
691 fi
692 else
693 if [ -n "$FAILED_JOBS" ]; then
694 echo "❌ Tests \`$FAILED_JOBS\` for $TAG failed: $RUN_URL"
695 else
696 echo "❌ Tests for $TAG failed: $RUN_URL"
697 fi
698 fi
699 elif [ "$VALIDATE_RESULT" == "failure" ]; then
700 echo "❌ Release asset validation failed for $TAG (missing assets): $RUN_URL"
701 elif [ "$AUTO_RELEASE_RESULT" == "success" ]; then
702 echo "✅ Release $TAG was auto-released successfully: $RELEASE_URL"
703 elif [ "$AUTO_RELEASE_RESULT" == "failure" ]; then
704 echo "❌ Auto release failed for $TAG: $RUN_URL"
705 else
706 echo "👀 Release $TAG sitting freshly baked in the oven and waiting to be published: $RELEASE_URL"
707 fi
708 fi
709 )
710 echo "message=$MESSAGE" >> "$GITHUB_OUTPUT"
711 env:
712 GH_TOKEN: ${{ github.token }}
713 - name: release::send_slack_message
714 run: |
715 curl -X POST -H 'Content-type: application/json'\
716 --data '{"text":"${{ steps.generate-webhook-message.outputs.message }}"}' "$SLACK_WEBHOOK"
717 env:
718 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
719concurrency:
720 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
721 cancel-in-progress: true
722defaults:
723 run:
724 shell: bash -euxo pipefail {0}