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      - test
 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      - test
 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  bundle-nix:
171    name: Build and cache Nix package
172    needs: tests
173    uses: ./.github/workflows/nix.yml
174
175  update-nightly-tag:
176    name: Update nightly tag
177    if: github.repository_owner == 'zed-industries'
178    runs-on: ubuntu-latest
179    needs:
180      - bundle-mac
181      - bundle-linux-x86
182      - bundle-linux-arm
183    steps:
184      - name: Checkout repo
185        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
186        with:
187          fetch-depth: 0
188
189      - name: Update nightly tag
190        run: |
191          if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
192            echo "Nightly tag already points to current commit. Skipping tagging."
193            exit 0
194          fi
195          git config user.name github-actions
196          git config user.email github-actions@github.com
197          git tag -f nightly
198          git push origin nightly --force