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