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@11bd71901bbe5b1630ceea73d27597364c9af683
 18      with:
 19        clean: false
 20    - name: steps::setup_cargo_config
 21      run: |
 22        mkdir -p ./../.cargo
 23        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
 24    - name: steps::cache_rust_dependencies_namespace
 25      uses: namespacelabs/nscloud-cache-action@v1
 26      with:
 27        cache: rust
 28        path: ~/.rustup
 29    - name: steps::setup_node
 30      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
 31      with:
 32        node-version: '20'
 33    - name: steps::cargo_install_nextest
 34      uses: taiki-e/install-action@nextest
 35    - name: steps::clear_target_dir_if_large
 36      run: ./script/clear-target-dir-if-larger-than 300
 37    - name: steps::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::show_sccache_stats
 47      run: sccache --show-stats || true
 48    - name: steps::cleanup_cargo_config
 49      if: always()
 50      run: |
 51        rm -rf ./../.cargo
 52    timeout-minutes: 60
 53  run_tests_linux:
 54    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
 55    runs-on: namespace-profile-16x32-ubuntu-2204
 56    env:
 57      CC: clang
 58      CXX: clang++
 59    steps:
 60    - name: steps::checkout_repo
 61      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 62      with:
 63        clean: false
 64    - name: steps::setup_cargo_config
 65      run: |
 66        mkdir -p ./../.cargo
 67        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
 68    - name: steps::cache_rust_dependencies_namespace
 69      uses: namespacelabs/nscloud-cache-action@v1
 70      with:
 71        cache: rust
 72        path: ~/.rustup
 73    - name: steps::setup_linux
 74      run: ./script/linux
 75    - name: steps::install_mold
 76      run: ./script/install-mold
 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@nextest
 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@11bd71901bbe5b1630ceea73d27597364c9af683
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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
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@11bd71901bbe5b1630ceea73d27597364c9af683
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@v1
197      with:
198        cache: rust
199        path: ~/.rustup
200    - name: steps::setup_linux
201      run: ./script/linux
202    - name: steps::install_mold
203      run: ./script/install-mold
204    - name: steps::download_wasi_sdk
205      run: ./script/download-wasi-sdk
206    - name: steps::setup_sccache
207      run: ./script/setup-sccache
208      env:
209        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
210        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
211        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
212        SCCACHE_BUCKET: sccache-zed
213    - name: steps::clippy
214      run: ./script/clippy
215    - name: steps::show_sccache_stats
216      run: sccache --show-stats || true
217    timeout-minutes: 60
218  clippy_windows:
219    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
220    runs-on: self-32vcpu-windows-2022
221    steps:
222    - name: steps::checkout_repo
223      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
224      with:
225        clean: false
226    - name: steps::setup_cargo_config
227      run: |
228        New-Item -ItemType Directory -Path "./../.cargo" -Force
229        Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
230      shell: pwsh
231    - name: steps::setup_sccache
232      run: ./script/setup-sccache.ps1
233      shell: pwsh
234      env:
235        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
236        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
237        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
238        SCCACHE_BUCKET: sccache-zed
239    - name: steps::clippy
240      run: ./script/clippy.ps1
241      shell: pwsh
242    - name: steps::show_sccache_stats
243      run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
244      shell: pwsh
245    timeout-minutes: 60
246  check_scripts:
247    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
248    runs-on: namespace-profile-2x4-ubuntu-2404
249    steps:
250    - name: steps::checkout_repo
251      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
252      with:
253        clean: false
254    - name: run_tests::check_scripts::run_shellcheck
255      run: ./script/shellcheck-scripts error
256    - id: get_actionlint
257      name: run_tests::check_scripts::download_actionlint
258      run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
259    - name: run_tests::check_scripts::run_actionlint
260      run: |
261        ${{ steps.get_actionlint.outputs.executable }} -color
262    - name: run_tests::check_scripts::check_xtask_workflows
263      run: |
264        cargo xtask workflows
265        if ! git diff --exit-code .github; then
266          echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
267          echo "Please run 'cargo xtask workflows' locally and commit the changes"
268          exit 1
269        fi
270    timeout-minutes: 60
271  create_draft_release:
272    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
273    runs-on: namespace-profile-2x4-ubuntu-2404
274    steps:
275    - name: steps::checkout_repo
276      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
277      with:
278        clean: false
279        fetch-depth: 25
280        ref: ${{ github.ref }}
281    - name: script/determine-release-channel
282      run: script/determine-release-channel
283    - name: mkdir -p target/
284      run: mkdir -p target/
285    - name: release::create_draft_release::generate_release_notes
286      run: node --redirect-warnings=/dev/null ./script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md
287    - name: release::create_draft_release::create_release
288      run: script/create-draft-release target/release-notes.md
289      env:
290        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
291    timeout-minutes: 60
292  bundle_linux_aarch64:
293    needs:
294    - run_tests_linux
295    - clippy_linux
296    - check_scripts
297    runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
298    env:
299      CARGO_INCREMENTAL: 0
300      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
301      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
302    steps:
303    - name: steps::checkout_repo
304      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
305      with:
306        clean: false
307    - name: steps::setup_sentry
308      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
309      with:
310        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
311    - name: steps::setup_linux
312      run: ./script/linux
313    - name: steps::install_mold
314      run: ./script/install-mold
315    - name: steps::download_wasi_sdk
316      run: ./script/download-wasi-sdk
317    - name: ./script/bundle-linux
318      run: ./script/bundle-linux
319    - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
320      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
321      with:
322        name: zed-linux-aarch64.tar.gz
323        path: target/release/zed-linux-aarch64.tar.gz
324        if-no-files-found: error
325    - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
326      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
327      with:
328        name: zed-remote-server-linux-aarch64.gz
329        path: target/zed-remote-server-linux-aarch64.gz
330        if-no-files-found: error
331    timeout-minutes: 60
332  bundle_linux_x86_64:
333    needs:
334    - run_tests_linux
335    - clippy_linux
336    - check_scripts
337    runs-on: namespace-profile-32x64-ubuntu-2004
338    env:
339      CARGO_INCREMENTAL: 0
340      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
341      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
342    steps:
343    - name: steps::checkout_repo
344      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
345      with:
346        clean: false
347    - name: steps::setup_sentry
348      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
349      with:
350        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
351    - name: steps::setup_linux
352      run: ./script/linux
353    - name: steps::install_mold
354      run: ./script/install-mold
355    - name: steps::download_wasi_sdk
356      run: ./script/download-wasi-sdk
357    - name: ./script/bundle-linux
358      run: ./script/bundle-linux
359    - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
360      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
361      with:
362        name: zed-linux-x86_64.tar.gz
363        path: target/release/zed-linux-x86_64.tar.gz
364        if-no-files-found: error
365    - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
366      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
367      with:
368        name: zed-remote-server-linux-x86_64.gz
369        path: target/zed-remote-server-linux-x86_64.gz
370        if-no-files-found: error
371    timeout-minutes: 60
372  bundle_mac_aarch64:
373    needs:
374    - run_tests_mac
375    - clippy_mac
376    - check_scripts
377    runs-on: namespace-profile-mac-large
378    env:
379      CARGO_INCREMENTAL: 0
380      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
381      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
382      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
383      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
384      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
385      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
386      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
387    steps:
388    - name: steps::checkout_repo
389      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
390      with:
391        clean: false
392    - name: steps::setup_node
393      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
394      with:
395        node-version: '20'
396    - name: steps::setup_sentry
397      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
398      with:
399        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
400    - name: steps::clear_target_dir_if_large
401      run: ./script/clear-target-dir-if-larger-than 300
402    - name: run_bundling::bundle_mac::bundle_mac
403      run: ./script/bundle-mac aarch64-apple-darwin
404    - name: '@actions/upload-artifact Zed-aarch64.dmg'
405      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
406      with:
407        name: Zed-aarch64.dmg
408        path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
409        if-no-files-found: error
410    - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
411      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
412      with:
413        name: zed-remote-server-macos-aarch64.gz
414        path: target/zed-remote-server-macos-aarch64.gz
415        if-no-files-found: error
416    timeout-minutes: 60
417  bundle_mac_x86_64:
418    needs:
419    - run_tests_mac
420    - clippy_mac
421    - check_scripts
422    runs-on: namespace-profile-mac-large
423    env:
424      CARGO_INCREMENTAL: 0
425      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
426      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
427      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
428      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
429      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
430      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
431      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
432    steps:
433    - name: steps::checkout_repo
434      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
435      with:
436        clean: false
437    - name: steps::setup_node
438      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
439      with:
440        node-version: '20'
441    - name: steps::setup_sentry
442      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
443      with:
444        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
445    - name: steps::clear_target_dir_if_large
446      run: ./script/clear-target-dir-if-larger-than 300
447    - name: run_bundling::bundle_mac::bundle_mac
448      run: ./script/bundle-mac x86_64-apple-darwin
449    - name: '@actions/upload-artifact Zed-x86_64.dmg'
450      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
451      with:
452        name: Zed-x86_64.dmg
453        path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
454        if-no-files-found: error
455    - name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
456      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
457      with:
458        name: zed-remote-server-macos-x86_64.gz
459        path: target/zed-remote-server-macos-x86_64.gz
460        if-no-files-found: error
461    timeout-minutes: 60
462  bundle_windows_aarch64:
463    needs:
464    - run_tests_windows
465    - clippy_windows
466    - check_scripts
467    runs-on: self-32vcpu-windows-2022
468    env:
469      CARGO_INCREMENTAL: 0
470      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
471      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
472      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
473      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
474      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
475      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
476      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
477      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
478      FILE_DIGEST: SHA256
479      TIMESTAMP_DIGEST: SHA256
480      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
481    steps:
482    - name: steps::checkout_repo
483      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
484      with:
485        clean: false
486    - name: steps::setup_sentry
487      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
488      with:
489        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
490    - name: run_bundling::bundle_windows::bundle_windows
491      run: script/bundle-windows.ps1 -Architecture aarch64
492      shell: pwsh
493      working-directory: ${{ env.ZED_WORKSPACE }}
494    - name: '@actions/upload-artifact Zed-aarch64.exe'
495      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
496      with:
497        name: Zed-aarch64.exe
498        path: target/Zed-aarch64.exe
499        if-no-files-found: error
500    - name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
501      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
502      with:
503        name: zed-remote-server-windows-aarch64.zip
504        path: target/zed-remote-server-windows-aarch64.zip
505        if-no-files-found: error
506    timeout-minutes: 60
507  bundle_windows_x86_64:
508    needs:
509    - run_tests_windows
510    - clippy_windows
511    - check_scripts
512    runs-on: self-32vcpu-windows-2022
513    env:
514      CARGO_INCREMENTAL: 0
515      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
516      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
517      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
518      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
519      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
520      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
521      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
522      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
523      FILE_DIGEST: SHA256
524      TIMESTAMP_DIGEST: SHA256
525      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
526    steps:
527    - name: steps::checkout_repo
528      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
529      with:
530        clean: false
531    - name: steps::setup_sentry
532      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
533      with:
534        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
535    - name: run_bundling::bundle_windows::bundle_windows
536      run: script/bundle-windows.ps1 -Architecture x86_64
537      shell: pwsh
538      working-directory: ${{ env.ZED_WORKSPACE }}
539    - name: '@actions/upload-artifact Zed-x86_64.exe'
540      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
541      with:
542        name: Zed-x86_64.exe
543        path: target/Zed-x86_64.exe
544        if-no-files-found: error
545    - name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
546      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
547      with:
548        name: zed-remote-server-windows-x86_64.zip
549        path: target/zed-remote-server-windows-x86_64.zip
550        if-no-files-found: error
551    timeout-minutes: 60
552  upload_release_assets:
553    needs:
554    - create_draft_release
555    - bundle_linux_aarch64
556    - bundle_linux_x86_64
557    - bundle_mac_aarch64
558    - bundle_mac_x86_64
559    - bundle_windows_aarch64
560    - bundle_windows_x86_64
561    runs-on: namespace-profile-4x8-ubuntu-2204
562    steps:
563    - name: release::download_workflow_artifacts
564      uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
565      with:
566        path: ./artifacts/
567    - name: ls -lR ./artifacts
568      run: ls -lR ./artifacts
569    - name: release::prep_release_artifacts
570      run: |-
571        mkdir -p release-artifacts/
572
573        mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
574        mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
575        mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
576        mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
577        mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
578        mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
579        mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
580        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
581        mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
582        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
583        mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
584        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
585    - name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
586      run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
587      env:
588        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
589  validate_release_assets:
590    needs:
591    - upload_release_assets
592    runs-on: namespace-profile-2x4-ubuntu-2404
593    steps:
594    - name: release::validate_release_assets
595      run: |
596        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"]'
597        TAG="$GITHUB_REF_NAME"
598
599        ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
600
601        MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
602
603        if [ -n "$MISSING_ASSETS" ]; then
604            echo "Error: The following assets are missing from the release:"
605            echo "$MISSING_ASSETS"
606            exit 1
607        fi
608
609        echo "All expected assets are present in the release."
610      env:
611        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
612  auto_release_preview:
613    needs:
614    - validate_release_assets
615    if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre')
616    runs-on: namespace-profile-2x4-ubuntu-2404
617    steps:
618    - id: get-app-token
619      name: steps::authenticate_as_zippy
620      uses: actions/create-github-app-token@bef1eaf1c0ac2b148ee2a0a74c65fbe6db0631f1
621      with:
622        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
623        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
624    - name: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
625      run: gh release edit "$GITHUB_REF_NAME" --repo=zed-industries/zed --draft=false
626      env:
627        GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
628  push_release_update_notification:
629    needs:
630    - create_draft_release
631    - upload_release_assets
632    - validate_release_assets
633    - auto_release_preview
634    - run_tests_mac
635    - run_tests_linux
636    - run_tests_windows
637    - clippy_mac
638    - clippy_linux
639    - clippy_windows
640    - check_scripts
641    - bundle_linux_aarch64
642    - bundle_linux_x86_64
643    - bundle_mac_aarch64
644    - bundle_mac_x86_64
645    - bundle_windows_aarch64
646    - bundle_windows_x86_64
647    if: always()
648    runs-on: namespace-profile-2x4-ubuntu-2404
649    steps:
650    - id: generate-webhook-message
651      name: release::generate_slack_message
652      run: |
653        MESSAGE=$(DRAFT_RESULT="${{ needs.create_draft_release.result }}"
654        UPLOAD_RESULT="${{ needs.upload_release_assets.result }}"
655        VALIDATE_RESULT="${{ needs.validate_release_assets.result }}"
656        AUTO_RELEASE_RESULT="${{ needs.auto_release_preview.result }}"
657        TAG="$GITHUB_REF_NAME"
658        RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
659
660        if [ "$DRAFT_RESULT" == "failure" ]; then
661            echo "❌ Draft release creation failed for $TAG: $RUN_URL"
662        else
663            RELEASE_URL=$(gh release view "$TAG" --repo=zed-industries/zed --json url -q '.url')
664            if [ "$UPLOAD_RESULT" == "failure" ]; then
665                echo "❌ Release asset upload failed for $TAG: $RELEASE_URL"
666            elif [ "$UPLOAD_RESULT" == "cancelled" ] || [ "$UPLOAD_RESULT" == "skipped" ]; then
667                FAILED_JOBS=""
668                if [ "${{ needs.run_tests_mac.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_mac"; fi
669                if [ "${{ needs.run_tests_linux.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_linux"; fi
670                if [ "${{ needs.run_tests_windows.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_windows"; fi
671                if [ "${{ needs.clippy_mac.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_mac"; fi
672                if [ "${{ needs.clippy_linux.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_linux"; fi
673                if [ "${{ needs.clippy_windows.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_windows"; fi
674                if [ "${{ needs.check_scripts.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS check_scripts"; fi
675                if [ "${{ needs.bundle_linux_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_aarch64"; fi
676                if [ "${{ needs.bundle_linux_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_x86_64"; fi
677                if [ "${{ needs.bundle_mac_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_aarch64"; fi
678                if [ "${{ needs.bundle_mac_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_x86_64"; fi
679                if [ "${{ needs.bundle_windows_aarch64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_aarch64"; fi
680                if [ "${{ needs.bundle_windows_x86_64.result }}" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_x86_64"; fi
681                FAILED_JOBS=$(echo "$FAILED_JOBS" | xargs)
682                if [ "$UPLOAD_RESULT" == "cancelled" ]; then
683                    if [ -n "$FAILED_JOBS" ]; then
684                        echo "❌ Release job for $TAG was cancelled, most likely because tests \`$FAILED_JOBS\` failed: $RUN_URL"
685                    else
686                        echo "❌ Release job for $TAG was cancelled: $RUN_URL"
687                    fi
688                else
689                    if [ -n "$FAILED_JOBS" ]; then
690                        echo "❌ Tests \`$FAILED_JOBS\` for $TAG failed: $RUN_URL"
691                    else
692                        echo "❌ Tests for $TAG failed: $RUN_URL"
693                    fi
694                fi
695            elif [ "$VALIDATE_RESULT" == "failure" ]; then
696                echo "❌ Release asset validation failed for $TAG (missing assets): $RUN_URL"
697            elif [ "$AUTO_RELEASE_RESULT" == "success" ]; then
698                echo "✅ Release $TAG was auto-released successfully: $RELEASE_URL"
699            elif [ "$AUTO_RELEASE_RESULT" == "failure" ]; then
700                echo "❌ Auto release failed for $TAG: $RUN_URL"
701            else
702                echo "👀 Release $TAG sitting freshly baked in the oven and waiting to be published: $RELEASE_URL"
703            fi
704        fi
705        )
706        echo "message=$MESSAGE" >> "$GITHUB_OUTPUT"
707      env:
708        GH_TOKEN: ${{ github.token }}
709    - name: release::send_slack_message
710      run: |
711        curl -X POST -H 'Content-type: application/json'\
712         --data '{"text":"${{ steps.generate-webhook-message.outputs.message }}"}' "$SLACK_WEBHOOK"
713      env:
714        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
715concurrency:
716  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
717  cancel-in-progress: true
718defaults:
719  run:
720    shell: bash -euxo pipefail {0}