release_nightly.yml

  1# Generated from xtask::workflows::release_nightly
  2# Rebuild with `cargo xtask workflows`.
  3name: release_nightly
  4env:
  5  CARGO_TERM_COLOR: always
  6  CARGO_INCREMENTAL: '0'
  7  RUST_BACKTRACE: '1'
  8  ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
  9  ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
 10  DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
 11  DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
 12on:
 13  push:
 14    tags:
 15    - nightly
 16  schedule:
 17  - cron: 0 7 * * *
 18jobs:
 19  check_style:
 20    if: github.repository_owner == 'zed-industries'
 21    runs-on: self-mini-macos
 22    steps:
 23    - name: steps::checkout_repo
 24      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 25      with:
 26        clean: false
 27        fetch-depth: 0
 28    - name: steps::cargo_fmt
 29      run: cargo fmt --all -- --check
 30      shell: bash -euxo pipefail {0}
 31    - name: ./script/clippy
 32      run: ./script/clippy
 33      shell: bash -euxo pipefail {0}
 34    timeout-minutes: 60
 35  run_tests_mac:
 36    if: github.repository_owner == 'zed-industries'
 37    runs-on: self-mini-macos
 38    steps:
 39    - name: steps::checkout_repo
 40      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 41      with:
 42        clean: false
 43    - name: steps::setup_cargo_config
 44      run: |
 45        mkdir -p ./../.cargo
 46        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
 47      shell: bash -euxo pipefail {0}
 48    - name: steps::setup_node
 49      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
 50      with:
 51        node-version: '20'
 52    - name: steps::cargo_install_nextest
 53      run: cargo install cargo-nextest --locked
 54      shell: bash -euxo pipefail {0}
 55    - name: steps::clear_target_dir_if_large
 56      run: ./script/clear-target-dir-if-larger-than 300
 57      shell: bash -euxo pipefail {0}
 58    - name: steps::cargo_nextest
 59      run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
 60      shell: bash -euxo pipefail {0}
 61    - name: steps::cleanup_cargo_config
 62      if: always()
 63      run: |
 64        rm -rf ./../.cargo
 65      shell: bash -euxo pipefail {0}
 66    timeout-minutes: 60
 67  run_tests_windows:
 68    if: github.repository_owner == 'zed-industries'
 69    runs-on: self-32vcpu-windows-2022
 70    steps:
 71    - name: steps::checkout_repo
 72      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 73      with:
 74        clean: false
 75    - name: steps::setup_cargo_config
 76      run: |
 77        New-Item -ItemType Directory -Path "./../.cargo" -Force
 78        Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
 79      shell: pwsh
 80    - name: steps::setup_node
 81      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
 82      with:
 83        node-version: '20'
 84    - name: steps::cargo_install_nextest
 85      run: cargo install cargo-nextest --locked
 86      shell: pwsh
 87    - name: steps::clear_target_dir_if_large
 88      run: ./script/clear-target-dir-if-larger-than.ps1 250
 89      shell: pwsh
 90    - name: steps::cargo_nextest
 91      run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
 92      shell: pwsh
 93    - name: steps::cleanup_cargo_config
 94      if: always()
 95      run: |
 96        Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
 97      shell: pwsh
 98    timeout-minutes: 60
 99  bundle_mac_nightly_x86_64:
100    needs:
101    - check_style
102    - run_tests_mac
103    if: github.repository_owner == 'zed-industries'
104    runs-on: self-mini-macos
105    env:
106      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
107      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
108      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
109      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
110      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
111    steps:
112    - name: steps::checkout_repo
113      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
114      with:
115        clean: false
116    - name: steps::setup_node
117      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
118      with:
119        node-version: '20'
120    - name: steps::setup_sentry
121      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
122      with:
123        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
124    - name: steps::clear_target_dir_if_large
125      run: ./script/clear-target-dir-if-larger-than 300
126      shell: bash -euxo pipefail {0}
127    - name: release_nightly::set_release_channel_to_nightly
128      run: |
129        set -eu
130        version=$(git rev-parse --short HEAD)
131        echo "Publishing version: ${version} on release channel nightly"
132        echo "nightly" > crates/zed/RELEASE_CHANNEL
133      shell: bash -euxo pipefail {0}
134    - name: run_bundling::bundle_mac
135      run: ./script/bundle-mac x86_64-apple-darwin
136      shell: bash -euxo pipefail {0}
137    - name: release_nightly::upload_zed_nightly
138      run: script/upload-nightly macos x86_64
139      shell: bash -euxo pipefail {0}
140    timeout-minutes: 60
141  bundle_mac_nightly_aarch64:
142    needs:
143    - check_style
144    - run_tests_mac
145    if: github.repository_owner == 'zed-industries'
146    runs-on: self-mini-macos
147    env:
148      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
149      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
150      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
151      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
152      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
153    steps:
154    - name: steps::checkout_repo
155      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
156      with:
157        clean: false
158    - name: steps::setup_node
159      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
160      with:
161        node-version: '20'
162    - name: steps::setup_sentry
163      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
164      with:
165        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
166    - name: steps::clear_target_dir_if_large
167      run: ./script/clear-target-dir-if-larger-than 300
168      shell: bash -euxo pipefail {0}
169    - name: release_nightly::set_release_channel_to_nightly
170      run: |
171        set -eu
172        version=$(git rev-parse --short HEAD)
173        echo "Publishing version: ${version} on release channel nightly"
174        echo "nightly" > crates/zed/RELEASE_CHANNEL
175      shell: bash -euxo pipefail {0}
176    - name: run_bundling::bundle_mac
177      run: ./script/bundle-mac aarch64-apple-darwin
178      shell: bash -euxo pipefail {0}
179    - name: release_nightly::upload_zed_nightly
180      run: script/upload-nightly macos aarch64
181      shell: bash -euxo pipefail {0}
182    timeout-minutes: 60
183  bundle_linux_nightly_x86_64:
184    needs:
185    - check_style
186    - run_tests_mac
187    if: github.repository_owner == 'zed-industries'
188    runs-on: namespace-profile-32x64-ubuntu-2004
189    steps:
190    - name: steps::checkout_repo
191      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
192      with:
193        clean: false
194    - name: steps::setup_sentry
195      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
196      with:
197        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
198    - name: release_nightly::add_rust_to_path
199      run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
200      shell: bash -euxo pipefail {0}
201    - name: ./script/linux
202      run: ./script/linux
203      shell: bash -euxo pipefail {0}
204    - name: ./script/install-mold
205      run: ./script/install-mold
206      shell: bash -euxo pipefail {0}
207    - name: steps::clear_target_dir_if_large
208      run: ./script/clear-target-dir-if-larger-than 100
209      shell: bash -euxo pipefail {0}
210    - name: release_nightly::set_release_channel_to_nightly
211      run: |
212        set -eu
213        version=$(git rev-parse --short HEAD)
214        echo "Publishing version: ${version} on release channel nightly"
215        echo "nightly" > crates/zed/RELEASE_CHANNEL
216      shell: bash -euxo pipefail {0}
217    - name: ./script/bundle-linux
218      run: ./script/bundle-linux
219      shell: bash -euxo pipefail {0}
220    - name: release_nightly::upload_zed_nightly
221      run: script/upload-nightly linux-targz x86_64
222      shell: bash -euxo pipefail {0}
223    timeout-minutes: 60
224  bundle_linux_nightly_aarch64:
225    needs:
226    - check_style
227    - run_tests_mac
228    if: github.repository_owner == 'zed-industries'
229    runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
230    steps:
231    - name: steps::checkout_repo
232      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
233      with:
234        clean: false
235    - name: steps::setup_sentry
236      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
237      with:
238        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
239    - name: release_nightly::add_rust_to_path
240      run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
241      shell: bash -euxo pipefail {0}
242    - name: ./script/linux
243      run: ./script/linux
244      shell: bash -euxo pipefail {0}
245    - name: steps::clear_target_dir_if_large
246      run: ./script/clear-target-dir-if-larger-than 100
247      shell: bash -euxo pipefail {0}
248    - name: release_nightly::set_release_channel_to_nightly
249      run: |
250        set -eu
251        version=$(git rev-parse --short HEAD)
252        echo "Publishing version: ${version} on release channel nightly"
253        echo "nightly" > crates/zed/RELEASE_CHANNEL
254      shell: bash -euxo pipefail {0}
255    - name: ./script/bundle-linux
256      run: ./script/bundle-linux
257      shell: bash -euxo pipefail {0}
258    - name: release_nightly::upload_zed_nightly
259      run: script/upload-nightly linux-targz aarch64
260      shell: bash -euxo pipefail {0}
261    timeout-minutes: 60
262  bundle_windows_nightly_x86_64:
263    needs:
264    - check_style
265    - run_tests_windows
266    if: github.repository_owner == 'zed-industries'
267    runs-on: self-32vcpu-windows-2022
268    env:
269      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
270      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
271      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
272      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
273      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
274      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
275      FILE_DIGEST: SHA256
276      TIMESTAMP_DIGEST: SHA256
277      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
278    steps:
279    - name: steps::checkout_repo
280      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
281      with:
282        clean: false
283    - name: steps::setup_sentry
284      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
285      with:
286        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
287    - name: release_nightly::set_release_channel_to_nightly
288      run: |
289        $ErrorActionPreference = "Stop"
290        $version = git rev-parse --short HEAD
291        Write-Host "Publishing version: $version on release channel nightly"
292        "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
293      shell: pwsh
294      working-directory: ${{ env.ZED_WORKSPACE }}
295    - name: release_nightly::build_zed_installer
296      run: script/bundle-windows.ps1 -Architecture x86_64
297      shell: pwsh
298      working-directory: ${{ env.ZED_WORKSPACE }}
299    - name: release_nightly::upload_zed_nightly_windows
300      run: script/upload-nightly.ps1 -Architecture x86_64
301      shell: pwsh
302      working-directory: ${{ env.ZED_WORKSPACE }}
303    timeout-minutes: 60
304  bundle_windows_nightly_aarch64:
305    needs:
306    - check_style
307    - run_tests_windows
308    if: github.repository_owner == 'zed-industries'
309    runs-on: self-32vcpu-windows-2022
310    env:
311      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
312      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
313      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
314      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
315      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
316      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
317      FILE_DIGEST: SHA256
318      TIMESTAMP_DIGEST: SHA256
319      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
320    steps:
321    - name: steps::checkout_repo
322      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
323      with:
324        clean: false
325    - name: steps::setup_sentry
326      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
327      with:
328        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
329    - name: release_nightly::set_release_channel_to_nightly
330      run: |
331        $ErrorActionPreference = "Stop"
332        $version = git rev-parse --short HEAD
333        Write-Host "Publishing version: $version on release channel nightly"
334        "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
335      shell: pwsh
336      working-directory: ${{ env.ZED_WORKSPACE }}
337    - name: release_nightly::build_zed_installer
338      run: script/bundle-windows.ps1 -Architecture aarch64
339      shell: pwsh
340      working-directory: ${{ env.ZED_WORKSPACE }}
341    - name: release_nightly::upload_zed_nightly_windows
342      run: script/upload-nightly.ps1 -Architecture aarch64
343      shell: pwsh
344      working-directory: ${{ env.ZED_WORKSPACE }}
345    timeout-minutes: 60
346  build_nix_linux_x86_64:
347    needs:
348    - check_style
349    - run_tests_mac
350    if: github.repository_owner == 'zed-industries'
351    runs-on: namespace-profile-32x64-ubuntu-2004
352    env:
353      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
354      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
355      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
356      GIT_LFS_SKIP_SMUDGE: '1'
357    steps:
358    - name: steps::checkout_repo
359      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
360      with:
361        clean: false
362    - name: nix_build::install_nix
363      uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
364      with:
365        github_access_token: ${{ secrets.GITHUB_TOKEN }}
366    - name: nix_build::cachix_action
367      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
368      with:
369        name: zed
370        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
371        cachixArgs: -v
372    - name: nix_build::build
373      run: nix build .#default -L --accept-flake-config
374      shell: bash -euxo pipefail {0}
375    timeout-minutes: 60
376    continue-on-error: true
377  build_nix_mac_aarch64:
378    needs:
379    - check_style
380    - run_tests_mac
381    if: github.repository_owner == 'zed-industries'
382    runs-on: self-mini-macos
383    env:
384      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
385      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
386      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
387      GIT_LFS_SKIP_SMUDGE: '1'
388    steps:
389    - name: steps::checkout_repo
390      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
391      with:
392        clean: false
393    - name: nix_build::set_path
394      run: |
395        echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
396        echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH"
397      shell: bash -euxo pipefail {0}
398    - name: nix_build::cachix_action
399      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
400      with:
401        name: zed
402        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
403        cachixArgs: -v
404    - name: nix_build::build
405      run: nix build .#default -L --accept-flake-config
406      shell: bash -euxo pipefail {0}
407    - name: nix_build::limit_store
408      run: |-
409        if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then
410            nix-collect-garbage -d || true
411        fi
412      shell: bash -euxo pipefail {0}
413    timeout-minutes: 60
414    continue-on-error: true
415  update_nightly_tag:
416    needs:
417    - bundle_mac_nightly_x86_64
418    - bundle_mac_nightly_aarch64
419    - bundle_linux_nightly_x86_64
420    - bundle_linux_nightly_aarch64
421    - bundle_windows_nightly_x86_64
422    - bundle_windows_nightly_aarch64
423    if: github.repository_owner == 'zed-industries'
424    runs-on: namespace-profile-2x4-ubuntu-2404
425    steps:
426    - name: steps::checkout_repo
427      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
428      with:
429        clean: false
430        fetch-depth: 0
431    - name: release_nightly::update_nightly_tag
432      run: |
433        if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
434          echo "Nightly tag already points to current commit. Skipping tagging."
435          exit 0
436        fi
437        git config user.name github-actions
438        git config user.email github-actions@github.com
439        git tag -f nightly
440        git push origin nightly --force
441      shell: bash -euxo pipefail {0}
442    - name: release_nightly::create_sentry_release
443      uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c
444      with:
445        environment: production
446      env:
447        SENTRY_ORG: zed-dev
448        SENTRY_PROJECT: zed
449        SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
450    timeout-minutes: 60