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