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