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    name: Check formatting and Clippy lints
19    if: github.repository_owner == 'zed-industries'
20    runs-on:
21      - self-hosted
22      - test
23    steps:
24      - name: Checkout repo
25        uses: actions/checkout@v4
26        with:
27          clean: false
28          submodules: "recursive"
29          fetch-depth: 0
30
31      - name: Run style checks
32        uses: ./.github/actions/check_style
33
34      - name: Run clippy
35        run: cargo xtask clippy
36  tests:
37    name: Run tests
38    if: github.repository_owner == 'zed-industries'
39    runs-on:
40      - self-hosted
41      - test
42    needs: style
43    steps:
44      - name: Checkout repo
45        uses: actions/checkout@v4
46        with:
47          clean: false
48          submodules: "recursive"
49
50      - name: Run tests
51        uses: ./.github/actions/run_tests
52
53  bundle:
54    name: Bundle app
55    if: github.repository_owner == 'zed-industries'
56    runs-on:
57      - self-hosted
58      - bundle
59    needs: tests
60    env:
61      MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
62      MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
63      APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
64      APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
65      DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
66      DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
67      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
68    steps:
69      - name: Install Node
70        uses: actions/setup-node@v4
71        with:
72          node-version: "18"
73
74      - name: Checkout repo
75        uses: actions/checkout@v4
76        with:
77          clean: false
78          submodules: "recursive"
79
80      - name: Limit target directory size
81        run: script/clear-target-dir-if-larger-than 100
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: Generate license file
91        run: script/generate-licenses
92
93      - name: Create app bundle
94        run: script/bundle
95
96      - name: Upload Zed Nightly
97        run: script/upload-nightly