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        REPORT_CONTENT=""
329        if [ -f "target/compliance-report.md" ]; then
330            REPORT_CONTENT=$(cat "target/compliance-report.md")
331        fi
332
333        if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
334            STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
335        else
336            STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
337        fi
338
339        MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s\n\n%s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22" "$REPORT_CONTENT")
340
341        curl -X POST -H 'Content-type: application/json' \
342            --data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
343            "$SLACK_WEBHOOK"
344      env:
345        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
346        COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
347        COMPLIANCE_TAG: ${{ github.ref_name }}
348        ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
349    timeout-minutes: 60
350  bundle_linux_aarch64:
351    needs:
352    - run_tests_linux
353    - clippy_linux
354    - check_scripts
355    runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
356    env:
357      CARGO_INCREMENTAL: 0
358      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
359      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
360      CC: clang-18
361      CXX: clang++-18
362    steps:
363    - name: steps::checkout_repo
364      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
365      with:
366        clean: false
367    - name: steps::setup_sentry
368      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
369      with:
370        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
371    - name: steps::setup_linux
372      run: ./script/linux
373    - name: steps::download_wasi_sdk
374      run: ./script/download-wasi-sdk
375    - name: ./script/bundle-linux
376      run: ./script/bundle-linux
377    - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
378      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
379      with:
380        name: zed-linux-aarch64.tar.gz
381        path: target/release/zed-linux-aarch64.tar.gz
382        if-no-files-found: error
383    - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
384      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
385      with:
386        name: zed-remote-server-linux-aarch64.gz
387        path: target/zed-remote-server-linux-aarch64.gz
388        if-no-files-found: error
389    timeout-minutes: 60
390  bundle_linux_x86_64:
391    needs:
392    - run_tests_linux
393    - clippy_linux
394    - check_scripts
395    runs-on: namespace-profile-32x64-ubuntu-2004
396    env:
397      CARGO_INCREMENTAL: 0
398      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
399      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
400      CC: clang-18
401      CXX: clang++-18
402    steps:
403    - name: steps::checkout_repo
404      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
405      with:
406        clean: false
407    - name: steps::setup_sentry
408      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
409      with:
410        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
411    - name: steps::setup_linux
412      run: ./script/linux
413    - name: steps::download_wasi_sdk
414      run: ./script/download-wasi-sdk
415    - name: ./script/bundle-linux
416      run: ./script/bundle-linux
417    - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
418      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
419      with:
420        name: zed-linux-x86_64.tar.gz
421        path: target/release/zed-linux-x86_64.tar.gz
422        if-no-files-found: error
423    - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
424      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
425      with:
426        name: zed-remote-server-linux-x86_64.gz
427        path: target/zed-remote-server-linux-x86_64.gz
428        if-no-files-found: error
429    timeout-minutes: 60
430  bundle_mac_aarch64:
431    needs:
432    - run_tests_mac
433    - clippy_mac
434    - check_scripts
435    runs-on: namespace-profile-mac-large
436    env:
437      CARGO_INCREMENTAL: 0
438      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
439      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
440      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
441      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
442      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
443      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
444      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
445    steps:
446    - name: steps::checkout_repo
447      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
448      with:
449        clean: false
450    - name: steps::setup_node
451      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
452      with:
453        node-version: '20'
454    - name: steps::setup_sentry
455      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
456      with:
457        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
458    - name: steps::clear_target_dir_if_large
459      run: ./script/clear-target-dir-if-larger-than 300
460    - name: run_bundling::bundle_mac::bundle_mac
461      run: ./script/bundle-mac aarch64-apple-darwin
462    - name: '@actions/upload-artifact Zed-aarch64.dmg'
463      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
464      with:
465        name: Zed-aarch64.dmg
466        path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
467        if-no-files-found: error
468    - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
469      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
470      with:
471        name: zed-remote-server-macos-aarch64.gz
472        path: target/zed-remote-server-macos-aarch64.gz
473        if-no-files-found: error
474    timeout-minutes: 60
475  bundle_mac_x86_64:
476    needs:
477    - run_tests_mac
478    - clippy_mac
479    - check_scripts
480    runs-on: namespace-profile-mac-large
481    env:
482      CARGO_INCREMENTAL: 0
483      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
484      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
485      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
486      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
487      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
488      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
489      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
490    steps:
491    - name: steps::checkout_repo
492      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
493      with:
494        clean: false
495    - name: steps::setup_node
496      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
497      with:
498        node-version: '20'
499    - name: steps::setup_sentry
500      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
501      with:
502        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
503    - name: steps::clear_target_dir_if_large
504      run: ./script/clear-target-dir-if-larger-than 300
505    - name: run_bundling::bundle_mac::bundle_mac
506      run: ./script/bundle-mac x86_64-apple-darwin
507    - name: '@actions/upload-artifact Zed-x86_64.dmg'
508      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
509      with:
510        name: Zed-x86_64.dmg
511        path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
512        if-no-files-found: error
513    - name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
514      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
515      with:
516        name: zed-remote-server-macos-x86_64.gz
517        path: target/zed-remote-server-macos-x86_64.gz
518        if-no-files-found: error
519    timeout-minutes: 60
520  bundle_windows_aarch64:
521    needs:
522    - run_tests_windows
523    - clippy_windows
524    - check_scripts
525    runs-on: self-32vcpu-windows-2022
526    env:
527      CARGO_INCREMENTAL: 0
528      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
529      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
530      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
531      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
532      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
533      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
534      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
535      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
536      FILE_DIGEST: SHA256
537      TIMESTAMP_DIGEST: SHA256
538      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
539    steps:
540    - name: steps::checkout_repo
541      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
542      with:
543        clean: false
544    - name: steps::setup_sentry
545      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
546      with:
547        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
548    - name: run_bundling::bundle_windows::bundle_windows
549      run: script/bundle-windows.ps1 -Architecture aarch64
550      shell: pwsh
551      working-directory: ${{ env.ZED_WORKSPACE }}
552    - name: '@actions/upload-artifact Zed-aarch64.exe'
553      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
554      with:
555        name: Zed-aarch64.exe
556        path: target/Zed-aarch64.exe
557        if-no-files-found: error
558    - name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
559      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
560      with:
561        name: zed-remote-server-windows-aarch64.zip
562        path: target/zed-remote-server-windows-aarch64.zip
563        if-no-files-found: error
564    timeout-minutes: 60
565  bundle_windows_x86_64:
566    needs:
567    - run_tests_windows
568    - clippy_windows
569    - check_scripts
570    runs-on: self-32vcpu-windows-2022
571    env:
572      CARGO_INCREMENTAL: 0
573      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
574      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
575      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
576      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
577      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
578      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
579      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
580      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
581      FILE_DIGEST: SHA256
582      TIMESTAMP_DIGEST: SHA256
583      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
584    steps:
585    - name: steps::checkout_repo
586      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
587      with:
588        clean: false
589    - name: steps::setup_sentry
590      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
591      with:
592        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
593    - name: run_bundling::bundle_windows::bundle_windows
594      run: script/bundle-windows.ps1 -Architecture x86_64
595      shell: pwsh
596      working-directory: ${{ env.ZED_WORKSPACE }}
597    - name: '@actions/upload-artifact Zed-x86_64.exe'
598      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
599      with:
600        name: Zed-x86_64.exe
601        path: target/Zed-x86_64.exe
602        if-no-files-found: error
603    - name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
604      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
605      with:
606        name: zed-remote-server-windows-x86_64.zip
607        path: target/zed-remote-server-windows-x86_64.zip
608        if-no-files-found: error
609    timeout-minutes: 60
610  upload_release_assets:
611    needs:
612    - create_draft_release
613    - bundle_linux_aarch64
614    - bundle_linux_x86_64
615    - bundle_mac_aarch64
616    - bundle_mac_x86_64
617    - bundle_windows_aarch64
618    - bundle_windows_x86_64
619    runs-on: namespace-profile-4x8-ubuntu-2204
620    steps:
621    - name: release::download_workflow_artifacts
622      uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
623      with:
624        path: ./artifacts/
625    - name: ls -lR ./artifacts
626      run: ls -lR ./artifacts
627    - name: release::prep_release_artifacts
628      run: |-
629        mkdir -p release-artifacts/
630
631        mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
632        mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
633        mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
634        mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
635        mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
636        mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
637        mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
638        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
639        mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
640        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
641        mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
642        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
643    - name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
644      run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
645      env:
646        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
647  validate_release_assets:
648    needs:
649    - upload_release_assets
650    runs-on: namespace-profile-2x4-ubuntu-2404
651    steps:
652    - name: release::validate_release_assets
653      run: |
654        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"]'
655        TAG="$GITHUB_REF_NAME"
656
657        ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
658
659        MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
660
661        if [ -n "$MISSING_ASSETS" ]; then
662            echo "Error: The following assets are missing from the release:"
663            echo "$MISSING_ASSETS"
664            exit 1
665        fi
666
667        echo "All expected assets are present in the release."
668      env:
669        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
670    - name: steps::checkout_repo
671      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
672      with:
673        clean: false
674        fetch-depth: 0
675        ref: ${{ github.ref }}
676    - name: steps::cache_rust_dependencies_namespace
677      uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
678      with:
679        cache: rust
680        path: ~/.rustup
681    - id: run-post-upload-compliance-check
682      name: release::validate_release_assets::run_post_upload_compliance_check
683      run: |
684        cargo xtask compliance "$GITHUB_REF_NAME" --report-path compliance-report
685      env:
686        GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
687        GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
688    - name: '@actions/upload-artifact compliance-report.md'
689      if: always()
690      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
691      with:
692        name: compliance-report.md
693        path: target/compliance-report.md
694        if-no-files-found: error
695    - name: send_compliance_slack_notification
696      if: always()
697      run: |
698        REPORT_CONTENT=""
699        if [ -f "target/compliance-report.md" ]; then
700            REPORT_CONTENT=$(cat "target/compliance-report.md")
701        fi
702
703        if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
704            STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
705        else
706            STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
707        fi
708
709        MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s\n\n%s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22" "$REPORT_CONTENT")
710
711        curl -X POST -H 'Content-type: application/json' \
712            --data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
713            "$SLACK_WEBHOOK"
714      env:
715        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
716        COMPLIANCE_OUTCOME: ${{ steps.run-post-upload-compliance-check.outcome }}
717        COMPLIANCE_TAG: ${{ github.ref_name }}
718        ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
719  auto_release_preview:
720    needs:
721    - validate_release_assets
722    if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre')
723    runs-on: namespace-profile-2x4-ubuntu-2404
724    steps:
725    - id: generate-token
726      name: steps::authenticate_as_zippy
727      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
728      with:
729        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
730        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
731    - name: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
732      run: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
733      env:
734        GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
735  push_release_update_notification:
736    needs:
737    - create_draft_release
738    - upload_release_assets
739    - validate_release_assets
740    - auto_release_preview
741    - run_tests_mac
742    - run_tests_linux
743    - run_tests_windows
744    - clippy_mac
745    - clippy_linux
746    - clippy_windows
747    - check_scripts
748    - bundle_linux_aarch64
749    - bundle_linux_x86_64
750    - bundle_mac_aarch64
751    - bundle_mac_x86_64
752    - bundle_windows_aarch64
753    - bundle_windows_x86_64
754    if: always()
755    runs-on: namespace-profile-2x4-ubuntu-2404
756    steps:
757    - id: generate-webhook-message
758      name: release::generate_slack_message
759      run: |
760        MESSAGE=$(TAG="$GITHUB_REF_NAME"
761
762        if [ "$DRAFT_RESULT" == "failure" ]; then
763            echo "❌ Draft release creation failed for $TAG: $RUN_URL"
764        else
765            RELEASE_URL=$(gh release view "$TAG" --repo=zed-industries/zed --json url -q '.url')
766            if [ "$UPLOAD_RESULT" == "failure" ]; then
767                echo "❌ Release asset upload failed for $TAG: $RELEASE_URL"
768            elif [ "$UPLOAD_RESULT" == "cancelled" ] || [ "$UPLOAD_RESULT" == "skipped" ]; then
769                FAILED_JOBS=""
770                if [ "$RESULT_RUN_TESTS_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_mac"; fi
771                if [ "$RESULT_RUN_TESTS_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_linux"; fi
772                if [ "$RESULT_RUN_TESTS_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_windows"; fi
773                if [ "$RESULT_CLIPPY_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_mac"; fi
774                if [ "$RESULT_CLIPPY_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_linux"; fi
775                if [ "$RESULT_CLIPPY_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_windows"; fi
776                if [ "$RESULT_CHECK_SCRIPTS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS check_scripts"; fi
777                if [ "$RESULT_BUNDLE_LINUX_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_aarch64"; fi
778                if [ "$RESULT_BUNDLE_LINUX_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_x86_64"; fi
779                if [ "$RESULT_BUNDLE_MAC_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_aarch64"; fi
780                if [ "$RESULT_BUNDLE_MAC_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_x86_64"; fi
781                if [ "$RESULT_BUNDLE_WINDOWS_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_aarch64"; fi
782                if [ "$RESULT_BUNDLE_WINDOWS_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_x86_64"; fi
783                FAILED_JOBS=$(echo "$FAILED_JOBS" | xargs)
784                if [ "$UPLOAD_RESULT" == "cancelled" ]; then
785                    if [ -n "$FAILED_JOBS" ]; then
786                        echo "❌ Release job for $TAG was cancelled, most likely because tests \`$FAILED_JOBS\` failed: $RUN_URL"
787                    else
788                        echo "❌ Release job for $TAG was cancelled: $RUN_URL"
789                    fi
790                else
791                    if [ -n "$FAILED_JOBS" ]; then
792                        echo "❌ Tests \`$FAILED_JOBS\` for $TAG failed: $RUN_URL"
793                    else
794                        echo "❌ Tests for $TAG failed: $RUN_URL"
795                    fi
796                fi
797            elif [ "$VALIDATE_RESULT" == "failure" ]; then
798                echo "❌ Release asset validation failed for $TAG (missing assets): $RUN_URL"
799            elif [ "$AUTO_RELEASE_RESULT" == "success" ]; then
800                echo "✅ Release $TAG was auto-released successfully: $RELEASE_URL"
801            elif [ "$AUTO_RELEASE_RESULT" == "failure" ]; then
802                echo "❌ Auto release failed for $TAG: $RUN_URL"
803            else
804                echo "👀 Release $TAG sitting freshly baked in the oven and waiting to be published: $RELEASE_URL"
805            fi
806        fi
807        )
808        echo "message=$MESSAGE" >> "$GITHUB_OUTPUT"
809      env:
810        GH_TOKEN: ${{ github.token }}
811        DRAFT_RESULT: ${{ needs.create_draft_release.result }}
812        UPLOAD_RESULT: ${{ needs.upload_release_assets.result }}
813        VALIDATE_RESULT: ${{ needs.validate_release_assets.result }}
814        AUTO_RELEASE_RESULT: ${{ needs.auto_release_preview.result }}
815        RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
816        RESULT_RUN_TESTS_MAC: ${{ needs.run_tests_mac.result }}
817        RESULT_RUN_TESTS_LINUX: ${{ needs.run_tests_linux.result }}
818        RESULT_RUN_TESTS_WINDOWS: ${{ needs.run_tests_windows.result }}
819        RESULT_CLIPPY_MAC: ${{ needs.clippy_mac.result }}
820        RESULT_CLIPPY_LINUX: ${{ needs.clippy_linux.result }}
821        RESULT_CLIPPY_WINDOWS: ${{ needs.clippy_windows.result }}
822        RESULT_CHECK_SCRIPTS: ${{ needs.check_scripts.result }}
823        RESULT_BUNDLE_LINUX_AARCH64: ${{ needs.bundle_linux_aarch64.result }}
824        RESULT_BUNDLE_LINUX_X86_64: ${{ needs.bundle_linux_x86_64.result }}
825        RESULT_BUNDLE_MAC_AARCH64: ${{ needs.bundle_mac_aarch64.result }}
826        RESULT_BUNDLE_MAC_X86_64: ${{ needs.bundle_mac_x86_64.result }}
827        RESULT_BUNDLE_WINDOWS_AARCH64: ${{ needs.bundle_windows_aarch64.result }}
828        RESULT_BUNDLE_WINDOWS_X86_64: ${{ needs.bundle_windows_x86_64.result }}
829    - name: release::send_slack_message
830      run: 'curl -X POST -H ''Content-type: application/json'' --data "$(jq -n --arg text "$SLACK_MESSAGE" ''{"text": $text}'')" "$SLACK_WEBHOOK"'
831      env:
832        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
833        SLACK_MESSAGE: ${{ steps.generate-webhook-message.outputs.message }}
834concurrency:
835  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
836  cancel-in-progress: true
837defaults:
838  run:
839    shell: bash -euxo pipefail {0}