release_nightly.yml

  1name: Release Nightly
  2
  3on:
  4  schedule:
  5    # Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)
  6    - cron: "0 7 * * *"
  7  push:
  8    tags:
  9      - "nightly"
 10
 11env:
 12  CARGO_TERM_COLOR: always
 13  CARGO_INCREMENTAL: 0
 14  RUST_BACKTRACE: 1
 15  ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
 16  ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
 17  DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
 18  DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
 19
 20jobs:
 21  style:
 22    timeout-minutes: 60
 23    name: Check formatting and Clippy lints
 24    if: github.repository_owner == 'zed-industries'
 25    runs-on:
 26      - self-hosted
 27      - macOS
 28    steps:
 29      - name: Checkout repo
 30        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 31        with:
 32          clean: false
 33          fetch-depth: 0
 34
 35      - name: Run style checks
 36        uses: ./.github/actions/check_style
 37
 38      - name: Run clippy
 39        run: ./script/clippy
 40
 41  tests:
 42    timeout-minutes: 60
 43    name: Run tests
 44    if: github.repository_owner == 'zed-industries'
 45    runs-on:
 46      - self-hosted
 47      - macOS
 48    needs: style
 49    steps:
 50      - name: Checkout repo
 51        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 52        with:
 53          clean: false
 54
 55      - name: Run tests
 56        uses: ./.github/actions/run_tests
 57
 58  windows-tests:
 59    timeout-minutes: 60
 60    name: Run tests on Windows
 61    if: github.repository_owner == 'zed-industries'
 62    runs-on: [self-32vcpu-windows-2022]
 63    steps:
 64      - name: Checkout repo
 65        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 66        with:
 67          clean: false
 68
 69      - name: Configure CI
 70        run: |
 71          New-Item -ItemType Directory -Path "./../.cargo" -Force
 72          Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
 73
 74      - name: Run tests
 75        uses: ./.github/actions/run_tests_windows
 76
 77      - name: Limit target directory size
 78        run: ./script/clear-target-dir-if-larger-than.ps1 1024
 79
 80      - name: Clean CI config file
 81        if: always()
 82        run: Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
 83
 84  bundle-mac:
 85    timeout-minutes: 60
 86    name: Create a macOS bundle
 87    if: github.repository_owner == 'zed-industries'
 88    runs-on:
 89      - self-mini-macos
 90    needs: tests
 91    env:
 92      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
 93      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
 94      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
 95      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
 96      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
 97    steps:
 98      - name: Install Node
 99        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
100        with:
101          node-version: "18"
102
103      - name: Checkout repo
104        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
105        with:
106          clean: false
107
108      - name: Set release channel to nightly
109        run: |
110          set -eu
111          version=$(git rev-parse --short HEAD)
112          echo "Publishing version: ${version} on release channel nightly"
113          echo "nightly" > crates/zed/RELEASE_CHANNEL
114
115      - name: Setup Sentry CLI
116        uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b #v2
117        with:
118          token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
119
120      - name: Create macOS app bundle
121        run: script/bundle-mac
122
123      - name: Upload Zed Nightly
124        run: script/upload-nightly macos
125
126  bundle-linux-x86:
127    timeout-minutes: 60
128    name: Create a Linux *.tar.gz bundle for x86
129    if: github.repository_owner == 'zed-industries'
130    runs-on:
131      - namespace-profile-16x32-ubuntu-2004 # ubuntu 20.04 for minimal glibc
132    needs: tests
133    steps:
134      - name: Checkout repo
135        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
136        with:
137          clean: false
138
139      - name: Add Rust to the PATH
140        run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
141
142      - name: Install Linux dependencies
143        run: ./script/linux && ./script/install-mold 2.34.0
144
145      - name: Setup Sentry CLI
146        uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b #v2
147        with:
148          token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
149
150      - name: Limit target directory size
151        run: script/clear-target-dir-if-larger-than 100
152
153      - name: Set release channel to nightly
154        run: |
155          set -euo pipefail
156          version=$(git rev-parse --short HEAD)
157          echo "Publishing version: ${version} on release channel nightly"
158          echo "nightly" > crates/zed/RELEASE_CHANNEL
159
160      - name: Create Linux .tar.gz bundle
161        run: script/bundle-linux
162
163      - name: Upload Zed Nightly
164        run: script/upload-nightly linux-targz
165
166  bundle-linux-arm:
167    timeout-minutes: 60
168    name: Create a Linux *.tar.gz bundle for ARM
169    if: github.repository_owner == 'zed-industries'
170    runs-on:
171      - namespace-profile-8x32-ubuntu-2004-arm-m4 # ubuntu 20.04 for minimal glibc
172    needs: tests
173    steps:
174      - name: Checkout repo
175        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
176        with:
177          clean: false
178
179      - name: Install Linux dependencies
180        run: ./script/linux
181
182      - name: Setup Sentry CLI
183        uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b #v2
184        with:
185          token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
186
187      - name: Limit target directory size
188        run: script/clear-target-dir-if-larger-than 100
189
190      - name: Set release channel to nightly
191        run: |
192          set -euo pipefail
193          version=$(git rev-parse --short HEAD)
194          echo "Publishing version: ${version} on release channel nightly"
195          echo "nightly" > crates/zed/RELEASE_CHANNEL
196
197      - name: Create Linux .tar.gz bundle
198        run: script/bundle-linux
199
200      - name: Upload Zed Nightly
201        run: script/upload-nightly linux-targz
202
203  freebsd:
204    timeout-minutes: 60
205    if: false && github.repository_owner == 'zed-industries'
206    runs-on: github-8vcpu-ubuntu-2404
207    needs: tests
208    name: Build Zed on FreeBSD
209    steps:
210      - uses: actions/checkout@v4
211      - name: Build FreeBSD remote-server
212        id: freebsd-build
213        uses: vmactions/freebsd-vm@c3ae29a132c8ef1924775414107a97cac042aad5 # v1.2.0
214        with:
215          # envs: "MYTOKEN MYTOKEN2"
216          usesh: true
217          release: 13.5
218          copyback: true
219          prepare: |
220            pkg install -y \
221              bash curl jq git \
222              rustup-init cmake-core llvm-devel-lite pkgconf protobuf # ibx11 alsa-lib rust-bindgen-cli
223          run: |
224            freebsd-version
225            sysctl hw.model
226            sysctl hw.ncpu
227            sysctl hw.physmem
228            sysctl hw.usermem
229            git config --global --add safe.directory /home/runner/work/zed/zed
230            rustup-init --profile minimal --default-toolchain none -y
231            . "$HOME/.cargo/env"
232            ./script/bundle-freebsd
233            mkdir -p out/
234            mv "target/zed-remote-server-freebsd-x86_64.gz" out/
235            rm -rf target/
236            cargo clean
237
238      - name: Upload Zed Nightly
239        run: script/upload-nightly freebsd
240
241  bundle-nix:
242    name: Build and cache Nix package
243    needs: tests
244    secrets: inherit
245    uses: ./.github/workflows/nix_build.yml
246
247  bundle-windows-x64:
248    timeout-minutes: 60
249    name: Create a Windows installer for x86_64
250    if: github.repository_owner == 'zed-industries'
251    runs-on: [self-32vcpu-windows-2022]
252    needs: windows-tests
253    env:
254      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
255      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
256      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
257      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
258      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
259      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
260      FILE_DIGEST: SHA256
261      TIMESTAMP_DIGEST: SHA256
262      TIMESTAMP_SERVER: "http://timestamp.acs.microsoft.com"
263    steps:
264      - name: Checkout repo
265        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
266        with:
267          clean: false
268
269      - name: Set release channel to nightly
270        working-directory: ${{ env.ZED_WORKSPACE }}
271        run: |
272          $ErrorActionPreference = "Stop"
273          $version = git rev-parse --short HEAD
274          Write-Host "Publishing version: $version on release channel nightly"
275          "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
276
277      - name: Setup Sentry CLI
278        uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b #v2
279        with:
280          token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
281
282      - name: Build Zed installer
283        working-directory: ${{ env.ZED_WORKSPACE }}
284        run: script/bundle-windows.ps1 -Architecture x86_64
285
286      - name: Upload Zed Nightly
287        working-directory: ${{ env.ZED_WORKSPACE }}
288        run: script/upload-nightly.ps1 -Architecture x86_64
289
290  bundle-windows-arm64:
291    timeout-minutes: 60
292    name: Create a Windows installer for aarch64
293    if: github.repository_owner == 'zed-industries'
294    runs-on: [self-32vcpu-windows-2022]
295    needs: windows-tests
296    env:
297      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
298      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
299      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
300      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
301      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
302      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
303      FILE_DIGEST: SHA256
304      TIMESTAMP_DIGEST: SHA256
305      TIMESTAMP_SERVER: "http://timestamp.acs.microsoft.com"
306    steps:
307      - name: Checkout repo
308        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
309        with:
310          clean: false
311
312      - name: Set release channel to nightly
313        working-directory: ${{ env.ZED_WORKSPACE }}
314        run: |
315          $ErrorActionPreference = "Stop"
316          $version = git rev-parse --short HEAD
317          Write-Host "Publishing version: $version on release channel nightly"
318          "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
319
320      - name: Setup Sentry CLI
321        uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b #v2
322        with:
323          token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
324
325      - name: Build Zed installer
326        working-directory: ${{ env.ZED_WORKSPACE }}
327        run: script/bundle-windows.ps1 -Architecture aarch64
328
329      - name: Upload Zed Nightly
330        working-directory: ${{ env.ZED_WORKSPACE }}
331        run: script/upload-nightly.ps1 -Architecture aarch64
332
333  update-nightly-tag:
334    name: Update nightly tag
335    if: github.repository_owner == 'zed-industries'
336    runs-on: namespace-profile-2x4-ubuntu-2404
337    needs:
338      - bundle-mac
339      - bundle-linux-x86
340      - bundle-linux-arm
341      - bundle-windows-x64
342      - bundle-windows-arm64
343    steps:
344      - name: Checkout repo
345        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
346        with:
347          fetch-depth: 0
348
349      - name: Update nightly tag
350        run: |
351          if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
352            echo "Nightly tag already points to current commit. Skipping tagging."
353            exit 0
354          fi
355          git config user.name github-actions
356          git config user.email github-actions@github.com
357          git tag -f nightly
358          git push origin nightly --force
359
360      - name: Create Sentry release
361        uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c # v3
362        env:
363          SENTRY_ORG: zed-dev
364          SENTRY_PROJECT: zed
365          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
366        with:
367          environment: production