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