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    rustfmt:
18        name: Check formatting
19        runs-on:
20            - self-hosted
21            - test
22        steps:
23            - name: Checkout repo
24              uses: actions/checkout@v3
25              with:
26                  clean: false
27                  submodules: "recursive"
28
29            - name: Run rustfmt
30              uses: ./.github/actions/check_formatting
31
32    tests:
33        name: Run tests
34        runs-on:
35            - self-hosted
36            - test
37        needs: rustfmt
38        steps:
39            - name: Checkout repo
40              uses: actions/checkout@v3
41              with:
42                  clean: false
43                  submodules: "recursive"
44
45            - name: Run tests
46              uses: ./.github/actions/run_tests
47
48    bundle:
49        name: Bundle app
50        runs-on:
51            - self-hosted
52            - bundle
53        needs: tests
54        env:
55            MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
56            MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
57            APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
58            APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
59            DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
60            DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
61        steps:
62            - name: Install Rust
63              run: |
64                  rustup set profile minimal
65                  rustup update stable
66                  rustup target add aarch64-apple-darwin
67                  rustup target add x86_64-apple-darwin
68                  rustup target add wasm32-wasi
69
70            - name: Install Node
71              uses: actions/setup-node@v3
72              with:
73                  node-version: "18"
74
75            - name: Checkout repo
76              uses: actions/checkout@v3
77              with:
78                  clean: false
79                  submodules: "recursive"
80
81            - name: Limit target directory size
82              run: script/clear-target-dir-if-larger-than 100
83
84            - name: Set release channel to nightly
85              run: |
86                  set -eu
87                  version=$(git rev-parse --short HEAD)
88                  echo "Publishing version: ${version} on release channel nightly"
89                  echo "nightly" > crates/zed/RELEASE_CHANNEL
90
91            - name: Generate license file
92              run: script/generate-licenses
93
94            - name: Create app bundle
95              run: script/bundle
96
97            - name: Upload Zed Nightly
98              run: script/upload-nightly