zed/.github/workflows/release_nightly.yml
2023-11-17 12:16:55 -08:00

164 lines
4.4 KiB
YAML

name: Release Nightly
on:
schedule:
# Fire every night at 1:00am
- cron: "0 1 * * *"
push:
tags:
- "nightly*"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
rustfmt:
name: Check formatting
runs-on:
- self-hosted
- test
steps:
- name: Install Rust
run: |
rustup set profile minimal
rustup update stable
- name: Checkout repo
uses: actions/checkout@v3
with:
clean: false
submodules: "recursive"
- name: cargo fmt
run: cargo fmt --all -- --check
tests:
name: Run tests
runs-on:
- self-hosted
- test
needs: rustfmt
env:
RUSTFLAGS: -D warnings
steps:
- name: Install Rust
run: |
rustup set profile minimal
rustup update stable
rustup target add wasm32-wasi
cargo install cargo-nextest
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Checkout repo
uses: actions/checkout@v3
with:
clean: false
submodules: "recursive"
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 70
- name: Run check
run: cargo check --workspace
- name: Run tests
run: cargo nextest run --workspace --no-fail-fast
- name: Build collab
run: cargo build -p collab
- name: Build other binaries
run: cargo build --workspace --bins --all-features
bundle:
name: Bundle app
runs-on:
- self-hosted
- bundle
needs: tests
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
steps:
- name: Install Rust
run: |
rustup set profile minimal
rustup update stable
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
rustup target add wasm32-wasi
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Checkout repo
uses: actions/checkout@v3
with:
clean: false
submodules: "recursive"
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 70
- name: Determine version and release channel
run: |
set -eu
version=$(git rev-parse --short HEAD)
channel=$(cat crates/zed/RELEASE_CHANNEL)
echo "Publishing version: ${version} on release channel ${channel}"
echo "RELEASE_CHANNEL=${channel}" >> $GITHUB_ENV
case ${channel} in
nightly)
exit 0;;
*)
echo "can't publish a release on channel ${channel} with this action"
exit 1;;
esac
- name: Generate license file
run: script/generate-licenses
- name: Create app bundle
run: script/bundle
# So, here's an example of how this _could_ be done.
# Problem: Need to setup some docker secrets
# Problem: This action is very old
# Problem: Need to add stuff for interacting with our API
# - uses: BetaHuhn/do-spaces-action@v2
# name: Upload app bundle to nightly
# id: spaces-upload
# with:
# # Need to put this stuff in kuberenetes I think
# access_key: ${{ secrets.ACCESS_KEY}}
# secret_key: ${{ secrets.SECRET_KEY }}
# space_name: ${{ secrets.SPACE_NAME }}
# space_region: ${{ secrets.SPACE_REGION }}
# source: target/release/Zed.dmg
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Zed Nightly
run: script/upload-nightly #something something
with:
do_secret: ${{ secrets.DO_SPACES_SECRET }}
do_access_key: ${{ secrets.DO_SPACES_ACCESS_KEY }}
# Upload to zed.dev?
- name: Upload new release URL to zed.dev
run: ??? #something something
with:
nightly_release_key: ${{ secrets.NIGHTLY_RELEASE_KEY }}
deployment_url: ${{ steps.spaces-upload.outputs.output_url }}