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