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