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-hosted
 89      - bundle
 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: Create macOS app bundle
116        run: script/bundle-mac
117
118      - name: Upload Zed Nightly
119        run: script/upload-nightly macos
120
121  bundle-linux-x86:
122    timeout-minutes: 60
123    name: Create a Linux *.tar.gz bundle for x86
124    if: github.repository_owner == 'zed-industries'
125    runs-on:
126      - buildjet-16vcpu-ubuntu-2004
127    needs: tests
128    steps:
129      - name: Checkout repo
130        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
131        with:
132          clean: false
133
134      - name: Add Rust to the PATH
135        run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
136
137      - name: Install Linux dependencies
138        run: ./script/linux && ./script/install-mold 2.34.0
139
140      - name: Limit target directory size
141        run: script/clear-target-dir-if-larger-than 100
142
143      - name: Set release channel to nightly
144        run: |
145          set -euo pipefail
146          version=$(git rev-parse --short HEAD)
147          echo "Publishing version: ${version} on release channel nightly"
148          echo "nightly" > crates/zed/RELEASE_CHANNEL
149
150      - name: Create Linux .tar.gz bundle
151        run: script/bundle-linux
152
153      - name: Upload Zed Nightly
154        run: script/upload-nightly linux-targz
155
156  bundle-linux-arm:
157    timeout-minutes: 60
158    name: Create a Linux *.tar.gz bundle for ARM
159    if: github.repository_owner == 'zed-industries'
160    runs-on:
161      - buildjet-16vcpu-ubuntu-2204-arm
162    needs: tests
163    steps:
164      - name: Checkout repo
165        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
166        with:
167          clean: false
168
169      - name: Install Linux dependencies
170        run: ./script/linux
171
172      - name: Limit target directory size
173        run: script/clear-target-dir-if-larger-than 100
174
175      - name: Set release channel to nightly
176        run: |
177          set -euo pipefail
178          version=$(git rev-parse --short HEAD)
179          echo "Publishing version: ${version} on release channel nightly"
180          echo "nightly" > crates/zed/RELEASE_CHANNEL
181
182      - name: Create Linux .tar.gz bundle
183        run: script/bundle-linux
184
185      - name: Upload Zed Nightly
186        run: script/upload-nightly linux-targz
187
188  freebsd:
189    timeout-minutes: 60
190    if: false && github.repository_owner == 'zed-industries'
191    runs-on: github-8vcpu-ubuntu-2404
192    needs: tests
193    name: Build Zed on FreeBSD
194    # env:
195    #   MYTOKEN : ${{ secrets.MYTOKEN }}
196    #   MYTOKEN2: "value2"
197    steps:
198      - uses: actions/checkout@v4
199      - name: Build FreeBSD remote-server
200        id: freebsd-build
201        uses: vmactions/freebsd-vm@c3ae29a132c8ef1924775414107a97cac042aad5 # v1.2.0
202        with:
203          # envs: "MYTOKEN MYTOKEN2"
204          usesh: true
205          release: 13.5
206          copyback: true
207          prepare: |
208            pkg install -y \
209              bash curl jq git \
210              rustup-init cmake-core llvm-devel-lite pkgconf protobuf # ibx11 alsa-lib rust-bindgen-cli
211          run: |
212            freebsd-version
213            sysctl hw.model
214            sysctl hw.ncpu
215            sysctl hw.physmem
216            sysctl hw.usermem
217            git config --global --add safe.directory /home/runner/work/zed/zed
218            rustup-init --profile minimal --default-toolchain none -y
219            . "$HOME/.cargo/env"
220            ./script/bundle-freebsd
221            mkdir -p out/
222            mv "target/zed-remote-server-freebsd-x86_64.gz" out/
223            rm -rf target/
224            cargo clean
225
226      - name: Upload Zed Nightly
227        run: script/upload-nightly freebsd
228
229  bundle-nix:
230    name: Build and cache Nix package
231    if: false
232    needs: tests
233    secrets: inherit
234    uses: ./.github/workflows/nix.yml
235
236  bundle-windows-x64:
237    timeout-minutes: 60
238    name: Create a Windows installer
239    if: github.repository_owner == 'zed-industries'
240    runs-on: [self-hosted, Windows, X64]
241    needs: windows-tests
242    env:
243      AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
244      AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
245      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
246      ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
247      CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
248      ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
249      FILE_DIGEST: SHA256
250      TIMESTAMP_DIGEST: SHA256
251      TIMESTAMP_SERVER: "http://timestamp.acs.microsoft.com"
252    steps:
253      - name: Checkout repo
254        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
255        with:
256          clean: false
257
258      - name: Set release channel to nightly
259        working-directory: ${{ env.ZED_WORKSPACE }}
260        run: |
261          $ErrorActionPreference = "Stop"
262          $version = git rev-parse --short HEAD
263          Write-Host "Publishing version: $version on release channel nightly"
264          "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
265
266      - name: Build Zed installer
267        working-directory: ${{ env.ZED_WORKSPACE }}
268        run: script/bundle-windows.ps1
269
270      - name: Upload Zed Nightly
271        working-directory: ${{ env.ZED_WORKSPACE }}
272        run: script/upload-nightly.ps1 windows
273
274  update-nightly-tag:
275    name: Update nightly tag
276    if: github.repository_owner == 'zed-industries'
277    runs-on: ubuntu-latest
278    needs:
279      - bundle-mac
280      - bundle-linux-x86
281      - bundle-linux-arm
282      - bundle-windows-x64
283    steps:
284      - name: Checkout repo
285        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
286        with:
287          fetch-depth: 0
288
289      - name: Update nightly tag
290        run: |
291          if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
292            echo "Nightly tag already points to current commit. Skipping tagging."
293            exit 0
294          fi
295          git config user.name github-actions
296          git config user.email github-actions@github.com
297          git tag -f nightly
298          git push origin nightly --force