release.yml

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