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      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
 72    steps:
 73      - name: Install Node
 74        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
 75        with:
 76          node-version: "18"
 77
 78      - name: Checkout repo
 79        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 80        with:
 81          clean: false
 82
 83      - name: Set release channel to nightly
 84        run: |
 85          set -eu
 86          version=$(git rev-parse --short HEAD)
 87          echo "Publishing version: ${version} on release channel nightly"
 88          echo "nightly" > crates/zed/RELEASE_CHANNEL
 89
 90      - name: Create macOS app bundle
 91        run: script/bundle-mac
 92
 93      - name: Upload Zed Nightly
 94        run: script/upload-nightly macos
 95
 96  bundle-linux-x86:
 97    timeout-minutes: 60
 98    name: Create a Linux *.tar.gz bundle for x86
 99    if: github.repository_owner == 'zed-industries'
100    runs-on:
101      - buildjet-16vcpu-ubuntu-2004
102    needs: tests
103    env:
104      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
105      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
106      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
107      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
108    steps:
109      - name: Checkout repo
110        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
111        with:
112          clean: false
113
114      - name: Add Rust to the PATH
115        run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
116
117      - name: Install Linux dependencies
118        run: ./script/linux && ./script/install-mold 2.34.0
119
120      - name: Limit target directory size
121        run: script/clear-target-dir-if-larger-than 100
122
123      - name: Set release channel to nightly
124        run: |
125          set -euo pipefail
126          version=$(git rev-parse --short HEAD)
127          echo "Publishing version: ${version} on release channel nightly"
128          echo "nightly" > crates/zed/RELEASE_CHANNEL
129
130      - name: Create Linux .tar.gz bundle
131        run: script/bundle-linux
132
133      - name: Upload Zed Nightly
134        run: script/upload-nightly linux-targz
135
136  bundle-linux-arm:
137    timeout-minutes: 60
138    name: Create a Linux *.tar.gz bundle for ARM
139    if: github.repository_owner == 'zed-industries'
140    runs-on:
141      - buildjet-16vcpu-ubuntu-2204-arm
142    needs: tests
143    env:
144      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
145      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
146      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
147      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
148    steps:
149      - name: Checkout repo
150        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
151        with:
152          clean: false
153
154      - name: Install Linux dependencies
155        run: ./script/linux
156
157      - name: Limit target directory size
158        run: script/clear-target-dir-if-larger-than 100
159
160      - name: Set release channel to nightly
161        run: |
162          set -euo pipefail
163          version=$(git rev-parse --short HEAD)
164          echo "Publishing version: ${version} on release channel nightly"
165          echo "nightly" > crates/zed/RELEASE_CHANNEL
166
167      - name: Create Linux .tar.gz bundle
168        run: script/bundle-linux
169
170      - name: Upload Zed Nightly
171        run: script/upload-nightly linux-targz
172
173  update-nightly-tag:
174    name: Update nightly tag
175    if: github.repository_owner == 'zed-industries'
176    runs-on: ubuntu-latest
177    needs:
178      - bundle-mac
179      - bundle-linux-x86
180      - bundle-linux-arm
181    steps:
182      - name: Checkout repo
183        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
184        with:
185          fetch-depth: 0
186
187      - name: Update nightly tag
188        run: |
189          if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then
190            echo "Nightly tag already points to current commit. Skipping tagging."
191            exit 0
192          fi
193          git config user.name github-actions
194          git config user.email github-actions@github.com
195          git tag -f nightly
196          git push origin nightly --force