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