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