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
 16jobs:
 17  style:
 18    timeout-minutes: 60
 19    name: Check formatting and Clippy lints
 20    if: github.repository_owner == 'zed-industries'
 21    runs-on:
 22      - self-hosted
 23      - macOS
 24    steps:
 25      - name: Checkout repo
 26        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 27        with:
 28          clean: false
 29          fetch-depth: 0
 30
 31      - name: Run style checks
 32        uses: ./.github/actions/check_style
 33
 34      - name: Run clippy
 35        run: ./script/clippy
 36
 37  tests:
 38    timeout-minutes: 60
 39    name: Run tests
 40    if: github.repository_owner == 'zed-industries'
 41    runs-on:
 42      - self-hosted
 43      - macOS
 44    needs: style
 45    steps:
 46      - name: Checkout repo
 47        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 48        with:
 49          clean: false
 50
 51      - name: Run tests
 52        uses: ./.github/actions/run_tests
 53
 54  bundle-mac:
 55    timeout-minutes: 60
 56    name: Create a macOS bundle
 57    if: github.repository_owner == 'zed-industries'
 58    runs-on:
 59      - self-hosted
 60      - bundle
 61    needs: tests
 62    env:
 63      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
 64      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
 65      APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
 66      APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
 67      APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
 68      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
 69      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
 70      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
 71    steps:
 72      - name: Install Node
 73        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
 74        with:
 75          node-version: "18"
 76
 77      - name: Checkout repo
 78        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 79        with:
 80          clean: false
 81
 82      - name: Set release channel to nightly
 83        run: |
 84          set -eu
 85          version=$(git rev-parse --short HEAD)
 86          echo "Publishing version: ${version} on release channel nightly"
 87          echo "nightly" > crates/zed/RELEASE_CHANNEL
 88
 89      - name: Create macOS app bundle
 90        run: script/bundle-mac
 91
 92      - name: Upload Zed Nightly
 93        run: script/upload-nightly macos
 94
 95  bundle-linux-x86:
 96    timeout-minutes: 60
 97    name: Create a Linux *.tar.gz bundle for x86
 98    if: github.repository_owner == 'zed-industries'
 99    runs-on:
100      - buildjet-16vcpu-ubuntu-2004
101    needs: tests
102    env:
103      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
104      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
105      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
106    steps:
107      - name: Checkout repo
108        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
109        with:
110          clean: false
111
112      - name: Add Rust to the PATH
113        run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
114
115      - name: Install Linux dependencies
116        run: ./script/linux && ./script/install-mold 2.34.0
117
118      - name: Limit target directory size
119        run: script/clear-target-dir-if-larger-than 100
120
121      - name: Set release channel to nightly
122        run: |
123          set -euo pipefail
124          version=$(git rev-parse --short HEAD)
125          echo "Publishing version: ${version} on release channel nightly"
126          echo "nightly" > crates/zed/RELEASE_CHANNEL
127
128      - name: Create Linux .tar.gz bundle
129        run: script/bundle-linux
130
131      - name: Upload Zed Nightly
132        run: script/upload-nightly linux-targz
133
134  bundle-linux-arm:
135    timeout-minutes: 60
136    name: Create a Linux *.tar.gz bundle for ARM
137    if: github.repository_owner == 'zed-industries'
138    runs-on:
139      - buildjet-16vcpu-ubuntu-2204-arm
140    needs: tests
141    env:
142      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
143      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
144      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
145    steps:
146      - name: Checkout repo
147        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
148        with:
149          clean: false
150
151      - name: Install Linux dependencies
152        run: ./script/linux
153
154      - name: Limit target directory size
155        run: script/clear-target-dir-if-larger-than 100
156
157      - name: Set release channel to nightly
158        run: |
159          set -euo pipefail
160          version=$(git rev-parse --short HEAD)
161          echo "Publishing version: ${version} on release channel nightly"
162          echo "nightly" > crates/zed/RELEASE_CHANNEL
163
164      - name: Create Linux .tar.gz bundle
165        run: script/bundle-linux
166
167      - name: Upload Zed Nightly
168        run: script/upload-nightly linux-targz
169
170  freebsd:
171    timeout-minutes: 60
172    if: github.repository_owner == 'zed-industries'
173    runs-on: github-8vcpu-ubuntu-2404
174    needs: tests
175    env:
176      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
177      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
178    name: Build Zed on FreeBSD
179    # env:
180    #   MYTOKEN : ${{ secrets.MYTOKEN }}
181    #   MYTOKEN2: "value2"
182    steps:
183      - uses: actions/checkout@v4
184      - name: Build FreeBSD remote-server
185        id: freebsd-build
186        uses: vmactions/freebsd-vm@c3ae29a132c8ef1924775414107a97cac042aad5 # v1.2.0
187        with:
188          # envs: "MYTOKEN MYTOKEN2"
189          usesh: true
190          release: 13.5
191          copyback: true
192          prepare: |
193            pkg install -y \
194              bash curl jq git \
195              rustup-init cmake-core llvm-devel-lite pkgconf protobuf # ibx11 alsa-lib rust-bindgen-cli
196          run: |
197            freebsd-version
198            sysctl hw.model
199            sysctl hw.ncpu
200            sysctl hw.physmem
201            sysctl hw.usermem
202            git config --global --add safe.directory /home/runner/work/zed/zed
203            rustup-init --profile minimal --default-toolchain none -y
204            . "$HOME/.cargo/env"
205            ./script/bundle-freebsd
206            mkdir -p out/
207            mv "target/zed-remote-server-freebsd-x86_64.gz" out/
208            rm -rf target/
209            cargo clean
210
211      - name: Upload Zed Nightly
212        run: script/upload-nightly freebsd
213
214  bundle-nix:
215    name: Build and cache Nix package
216    needs: tests
217    secrets: inherit
218    uses: ./.github/workflows/nix.yml
219
220  update-nightly-tag:
221    name: Update nightly tag
222    if: github.repository_owner == 'zed-industries'
223    runs-on: ubuntu-latest
224    needs:
225      - bundle-mac
226      - bundle-linux-x86
227      - bundle-linux-arm
228    steps:
229      - name: Checkout repo
230        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
231        with:
232          fetch-depth: 0
233
234      - name: Update nightly tag
235        run: |
236          if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
237            echo "Nightly tag already points to current commit. Skipping tagging."
238            exit 0
239          fi
240          git config user.name github-actions
241          git config user.email github-actions@github.com
242          git tag -f nightly
243          git push origin nightly --force