run_bundling.yml

  1# Generated from xtask::workflows::run_bundling
  2# Rebuild with `cargo xtask workflows`.
  3name: run_bundling
  4env:
  5  CARGO_TERM_COLOR: always
  6  RUST_BACKTRACE: '1'
  7on:
  8  pull_request:
  9    types:
 10    - labeled
 11    - synchronize
 12jobs:
 13  bundle_linux_aarch64:
 14    if: |-
 15      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
 16      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
 17    runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
 18    env:
 19      CARGO_INCREMENTAL: 0
 20      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
 21      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
 22      CC: clang-18
 23      CXX: clang++-18
 24    steps:
 25    - name: steps::checkout_repo
 26      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 27      with:
 28        clean: false
 29    - name: steps::setup_sentry
 30      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
 31      with:
 32        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
 33    - name: steps::setup_linux
 34      run: ./script/linux
 35    - name: steps::install_mold
 36      run: ./script/install-mold
 37    - name: steps::download_wasi_sdk
 38      run: ./script/download-wasi-sdk
 39    - name: ./script/bundle-linux
 40      run: ./script/bundle-linux
 41    - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
 42      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
 43      with:
 44        name: zed-linux-aarch64.tar.gz
 45        path: target/release/zed-linux-aarch64.tar.gz
 46        if-no-files-found: error
 47    - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
 48      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
 49      with:
 50        name: zed-remote-server-linux-aarch64.gz
 51        path: target/zed-remote-server-linux-aarch64.gz
 52        if-no-files-found: error
 53    timeout-minutes: 60
 54  bundle_linux_x86_64:
 55    if: |-
 56      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
 57      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
 58    runs-on: namespace-profile-32x64-ubuntu-2004
 59    env:
 60      CARGO_INCREMENTAL: 0
 61      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
 62      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
 63      CC: clang-18
 64      CXX: clang++-18
 65    steps:
 66    - name: steps::checkout_repo
 67      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 68      with:
 69        clean: false
 70    - name: steps::setup_sentry
 71      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
 72      with:
 73        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
 74    - name: steps::setup_linux
 75      run: ./script/linux
 76    - name: steps::install_mold
 77      run: ./script/install-mold
 78    - name: steps::download_wasi_sdk
 79      run: ./script/download-wasi-sdk
 80    - name: ./script/bundle-linux
 81      run: ./script/bundle-linux
 82    - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
 83      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
 84      with:
 85        name: zed-linux-x86_64.tar.gz
 86        path: target/release/zed-linux-x86_64.tar.gz
 87        if-no-files-found: error
 88    - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
 89      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
 90      with:
 91        name: zed-remote-server-linux-x86_64.gz
 92        path: target/zed-remote-server-linux-x86_64.gz
 93        if-no-files-found: error
 94    timeout-minutes: 60
 95  bundle_mac_aarch64:
 96    if: |-
 97      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
 98      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
 99    runs-on: namespace-profile-mac-large
100    env:
101      CARGO_INCREMENTAL: 0
102      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
103      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
104      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
105      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
106      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
107      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
108      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
109    steps:
110    - name: steps::checkout_repo
111      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
112      with:
113        clean: false
114    - name: steps::setup_node
115      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
116      with:
117        node-version: '20'
118    - name: steps::setup_sentry
119      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
120      with:
121        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
122    - name: steps::clear_target_dir_if_large
123      run: ./script/clear-target-dir-if-larger-than 300
124    - name: run_bundling::bundle_mac::bundle_mac
125      run: ./script/bundle-mac aarch64-apple-darwin
126    - name: '@actions/upload-artifact Zed-aarch64.dmg'
127      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
128      with:
129        name: Zed-aarch64.dmg
130        path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
131        if-no-files-found: error
132    - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
133      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
134      with:
135        name: zed-remote-server-macos-aarch64.gz
136        path: target/zed-remote-server-macos-aarch64.gz
137        if-no-files-found: error
138    timeout-minutes: 60
139  bundle_mac_x86_64:
140    if: |-
141      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
142      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
143    runs-on: namespace-profile-mac-large
144    env:
145      CARGO_INCREMENTAL: 0
146      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
147      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
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    - name: run_bundling::bundle_mac::bundle_mac
169      run: ./script/bundle-mac x86_64-apple-darwin
170    - name: '@actions/upload-artifact Zed-x86_64.dmg'
171      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
172      with:
173        name: Zed-x86_64.dmg
174        path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
175        if-no-files-found: error
176    - name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
177      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
178      with:
179        name: zed-remote-server-macos-x86_64.gz
180        path: target/zed-remote-server-macos-x86_64.gz
181        if-no-files-found: error
182    timeout-minutes: 60
183  bundle_windows_aarch64:
184    if: |-
185      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
186      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
187    runs-on: self-32vcpu-windows-2022
188    env:
189      CARGO_INCREMENTAL: 0
190      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
191      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
192      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
193      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
194      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
195      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
196      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
197      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
198      FILE_DIGEST: SHA256
199      TIMESTAMP_DIGEST: SHA256
200      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
201    steps:
202    - name: steps::checkout_repo
203      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
204      with:
205        clean: false
206    - name: steps::setup_sentry
207      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
208      with:
209        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
210    - name: run_bundling::bundle_windows::bundle_windows
211      run: script/bundle-windows.ps1 -Architecture aarch64
212      shell: pwsh
213      working-directory: ${{ env.ZED_WORKSPACE }}
214    - name: '@actions/upload-artifact Zed-aarch64.exe'
215      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
216      with:
217        name: Zed-aarch64.exe
218        path: target/Zed-aarch64.exe
219        if-no-files-found: error
220    - name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
221      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
222      with:
223        name: zed-remote-server-windows-aarch64.zip
224        path: target/zed-remote-server-windows-aarch64.zip
225        if-no-files-found: error
226    timeout-minutes: 60
227  bundle_windows_x86_64:
228    if: |-
229      (github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
230      (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
231    runs-on: self-32vcpu-windows-2022
232    env:
233      CARGO_INCREMENTAL: 0
234      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
235      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
236      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
237      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
238      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
239      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
240      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
241      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
242      FILE_DIGEST: SHA256
243      TIMESTAMP_DIGEST: SHA256
244      TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
245    steps:
246    - name: steps::checkout_repo
247      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
248      with:
249        clean: false
250    - name: steps::setup_sentry
251      uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
252      with:
253        token: ${{ secrets.SENTRY_AUTH_TOKEN }}
254    - name: run_bundling::bundle_windows::bundle_windows
255      run: script/bundle-windows.ps1 -Architecture x86_64
256      shell: pwsh
257      working-directory: ${{ env.ZED_WORKSPACE }}
258    - name: '@actions/upload-artifact Zed-x86_64.exe'
259      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
260      with:
261        name: Zed-x86_64.exe
262        path: target/Zed-x86_64.exe
263        if-no-files-found: error
264    - name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
265      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
266      with:
267        name: zed-remote-server-windows-x86_64.zip
268        path: target/zed-remote-server-windows-x86_64.zip
269        if-no-files-found: error
270    timeout-minutes: 60
271  build_nix_linux_x86_64:
272    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && github.event.label.name == 'run-bundling') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling')))
273    runs-on: namespace-profile-32x64-ubuntu-2004
274    env:
275      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
276      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
277      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
278      GIT_LFS_SKIP_SMUDGE: '1'
279    steps:
280    - name: steps::checkout_repo
281      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
282      with:
283        clean: false
284    - name: steps::cache_nix_dependencies_namespace
285      uses: namespacelabs/nscloud-cache-action@v1
286      with:
287        cache: nix
288    - name: nix_build::build_nix::install_nix
289      uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
290      with:
291        github_access_token: ${{ secrets.GITHUB_TOKEN }}
292    - name: nix_build::build_nix::cachix_action
293      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
294      with:
295        name: zed
296        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
297        cachixArgs: -v
298        pushFilter: -zed-editor-[0-9.]*
299    - name: nix_build::build_nix::build
300      run: nix build .#default -L --accept-flake-config
301    timeout-minutes: 60
302    continue-on-error: true
303  build_nix_mac_aarch64:
304    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && github.event.label.name == 'run-bundling') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling')))
305    runs-on: namespace-profile-mac-large
306    env:
307      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
308      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
309      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
310      GIT_LFS_SKIP_SMUDGE: '1'
311    steps:
312    - name: steps::checkout_repo
313      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
314      with:
315        clean: false
316    - name: steps::cache_nix_store_macos
317      uses: namespacelabs/nscloud-cache-action@v1
318      with:
319        path: ~/nix-cache
320    - name: nix_build::build_nix::install_nix
321      uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
322      with:
323        github_access_token: ${{ secrets.GITHUB_TOKEN }}
324    - name: nix_build::build_nix::configure_local_nix_cache
325      run: |
326        mkdir -p ~/nix-cache
327        echo "extra-substituters = file://$HOME/nix-cache?priority=10" | sudo tee -a /etc/nix/nix.conf
328        echo "require-sigs = false" | sudo tee -a /etc/nix/nix.conf
329        sudo launchctl kickstart -k system/org.nixos.nix-daemon
330    - name: nix_build::build_nix::cachix_action
331      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
332      with:
333        name: zed
334        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
335        cachixArgs: -v
336        pushFilter: -zed-editor-[0-9.]*
337    - name: nix_build::build_nix::build
338      run: nix build .#default -L --accept-flake-config
339    - name: nix_build::build_nix::export_to_local_nix_cache
340      if: always()
341      run: |
342        if [ -L result ]; then
343          echo "Copying build closure to local binary cache..."
344          nix copy --to "file://$HOME/nix-cache" ./result || echo "Warning: nix copy to local cache failed"
345        else
346          echo "No build result found, skipping cache export."
347        fi
348    timeout-minutes: 60
349    continue-on-error: true
350concurrency:
351  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
352  cancel-in-progress: true
353defaults:
354  run:
355    shell: bash -euxo pipefail {0}