Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ci: Build nightly more frequently (#53800)
Finn Evers4714220df32f
diff --git a/.github/workflows/autofix_pr.yml b/.github/workflows/autofix_pr.ymlindex 72fdcab663e..9918f6be0fc 100644--- a/.github/workflows/autofix_pr.yml+++ b/.github/workflows/autofix_pr.yml@@ -122,10 +122,10 @@ jobs:git commit -am "Autofix"git pushenv:- GIT_COMMITTER_NAME: Zed Zippy- GIT_COMMITTER_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.com- GIT_AUTHOR_NAME: Zed Zippy+ GIT_AUTHOR_NAME: zed-zippy[bot]GIT_AUTHOR_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.com+ GIT_COMMITTER_NAME: zed-zippy[bot]+ GIT_COMMITTER_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.comGITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}concurrency:group: ${{ github.workflow }}-${{ inputs.pr_number }}diff --git a/.github/workflows/cherry_pick.yml b/.github/workflows/cherry_pick.ymlindex b24f8a133be..82dc9fb545d 100644--- a/.github/workflows/cherry_pick.yml+++ b/.github/workflows/cherry_pick.yml@@ -45,9 +45,9 @@ jobs:COMMIT: ${{ inputs.commit }}CHANNEL: ${{ inputs.channel }}GIT_AUTHOR_NAME: zed-zippy[bot]- GIT_AUTHOR_EMAIL: <234243425+zed-zippy[bot]@users.noreply.github.com>+ GIT_AUTHOR_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.comGIT_COMMITTER_NAME: zed-zippy[bot]- GIT_COMMITTER_EMAIL: <234243425+zed-zippy[bot]@users.noreply.github.com>+ GIT_COMMITTER_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.comGITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}defaults:run:diff --git a/.github/workflows/extension_workflow_rollout.yml b/.github/workflows/extension_workflow_rollout.ymlindex 7c1617b2297..c1e61822df6 100644--- a/.github/workflows/extension_workflow_rollout.yml+++ b/.github/workflows/extension_workflow_rollout.yml@@ -220,10 +220,6 @@ jobs:clean: falsefetch-depth: 0token: ${{ steps.generate-token.outputs.token }}- - name: extension_workflow_rollout::create_rollout_tag::configure_git- run: |- git config user.name "zed-zippy[bot]"- git config user.email "234243425+zed-zippy[bot]@users.noreply.github.com"- name: extension_workflow_rollout::create_rollout_tag::update_rollout_tagrun: |if git rev-parse "extension-workflows" >/dev/null 2>&1; then@@ -234,6 +230,11 @@ jobs:echo "Creating new tag 'extension-workflows' at $(git rev-parse --short HEAD)"git tag "extension-workflows"git push origin "extension-workflows"+ env:+ GIT_AUTHOR_NAME: zed-zippy[bot]+ GIT_AUTHOR_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.com+ GIT_COMMITTER_NAME: zed-zippy[bot]+ GIT_COMMITTER_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.comtimeout-minutes: 1defaults:run:diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.ymlindex fc1b2c26b42..1035d1ab0a4 100644--- a/.github/workflows/release_nightly.yml+++ b/.github/workflows/release_nightly.yml@@ -5,29 +5,40 @@ env:CARGO_TERM_COLOR: alwaysRUST_BACKTRACE: '1'on:- push:- tags:- - nightlyschedule:- - cron: 0 7 * * *+ - cron: 0 */4 * * *+ workflow_dispatch: {}jobs:- check_style:+ check_nightly_tag:if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')- runs-on: namespace-profile-mac-large+ runs-on: namespace-profile-2x4-ubuntu-2404steps:- name: steps::checkout_repouses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfdwith:clean: false- fetch-depth: 0- - name: steps::cargo_fmt- run: cargo fmt --all -- --check- - name: ./script/clippy- run: ./script/clippy- timeout-minutes: 60- run_tests_windows:- if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')- runs-on: self-32vcpu-windows-2022+ fetch-tags: true+ - id: check+ name: release_nightly::check_nightly_tag+ run: |+ NIGHTLY_SHA=$(git rev-parse "nightly" 2>/dev/null || echo "")+ if [ "$NIGHTLY_SHA" = "$GITHUB_SHA" ]; then+ echo "Nightly tag already points to current commit. Skipping."+ echo "skip=true" >> "$GITHUB_OUTPUT"+ else+ echo "skip=false" >> "$GITHUB_OUTPUT"+ fi+ outputs:+ skip: ${{ steps.check.outputs.skip }}+ timeout-minutes: 5+ run_tests_linux:+ needs:+ - check_nightly_tag+ if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && needs.check_nightly_tag.outputs.skip != 'true'+ runs-on: namespace-profile-16x32-ubuntu-2204+ env:+ CC: clang+ CXX: clang++steps:- name: steps::checkout_repouses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd@@ -35,19 +46,27 @@ jobs:clean: false- name: steps::setup_cargo_configrun: |- New-Item -ItemType Directory -Path "./../.cargo" -Force- Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"- shell: pwsh+ mkdir -p ./../.cargo+ cp ./.cargo/ci-config.toml ./../.cargo/config.toml+ - name: steps::cache_rust_dependencies_namespace+ uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9+ with:+ cache: rust+ path: ~/.rustup+ - name: steps::setup_linux+ run: ./script/linux+ - name: steps::download_wasi_sdk+ run: ./script/download-wasi-sdk- name: steps::setup_nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020with:node-version: '20'+ - name: steps::cargo_install_nextest+ uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c- name: steps::clear_target_dir_if_large- run: ./script/clear-target-dir-if-larger-than.ps1 350 200- shell: pwsh+ run: ./script/clear-target-dir-if-larger-than 350 200- name: steps::setup_sccache- run: ./script/setup-sccache.ps1- shell: pwsh+ run: ./script/setup-sccacheenv:R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}@@ -55,49 +74,24 @@ jobs:SCCACHE_BUCKET: sccache-zed- name: steps::cargo_nextestrun: cargo nextest run --workspace --no-fail-fast --no-tests=warn- shell: pwsh- name: steps::show_sccache_stats- run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0- shell: pwsh+ run: sccache --show-stats || true- name: steps::cleanup_cargo_configif: always()run: |- Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue- shell: pwsh- timeout-minutes: 60- clippy_windows:- if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')- runs-on: self-32vcpu-windows-2022- steps:- - name: steps::checkout_repo- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd- with:- clean: false- - name: steps::setup_cargo_config- run: |- New-Item -ItemType Directory -Path "./../.cargo" -Force- Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"- shell: pwsh- - name: steps::setup_sccache- run: ./script/setup-sccache.ps1- shell: pwsh- env:- R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}- R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}- R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}- SCCACHE_BUCKET: sccache-zed- - name: steps::clippy- run: ./script/clippy.ps1- shell: pwsh- - name: steps::show_sccache_stats- run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0- shell: pwsh+ rm -rf ./../.cargotimeout-minutes: 60+ services:+ postgres:+ image: postgres:15+ env:+ POSTGRES_HOST_AUTH_METHOD: trust+ ports:+ - 5432:5432+ options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10bundle_linux_aarch64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: namespace-profile-8x32-ubuntu-2004-arm-m4env:CARGO_INCREMENTAL: 0@@ -141,9 +135,7 @@ jobs:timeout-minutes: 60bundle_linux_x86_64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: namespace-profile-32x64-ubuntu-2004env:CARGO_INCREMENTAL: 0@@ -187,9 +179,7 @@ jobs:timeout-minutes: 60bundle_mac_aarch64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: namespace-profile-mac-largeenv:CARGO_INCREMENTAL: 0@@ -238,9 +228,7 @@ jobs:timeout-minutes: 60bundle_mac_x86_64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: namespace-profile-mac-largeenv:CARGO_INCREMENTAL: 0@@ -289,9 +277,7 @@ jobs:timeout-minutes: 60bundle_windows_aarch64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: self-32vcpu-windows-2022env:CARGO_INCREMENTAL: 0@@ -342,9 +328,7 @@ jobs:timeout-minutes: 60bundle_windows_x86_64:needs:- - check_style- - run_tests_windows- - clippy_windows+ - run_tests_linuxruns-on: self-32vcpu-windows-2022env:CARGO_INCREMENTAL: 0@@ -395,8 +379,7 @@ jobs:timeout-minutes: 60build_nix_linux_x86_64:needs:- - check_style- - run_tests_windows+ - run_tests_linuxif: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')runs-on: namespace-profile-32x64-ubuntu-2004env:@@ -429,8 +412,7 @@ jobs:continue-on-error: truebuild_nix_mac_aarch64:needs:- - check_style- - run_tests_windows+ - run_tests_linuxif: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')runs-on: namespace-profile-mac-largeenv:@@ -487,11 +469,18 @@ jobs:if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')runs-on: namespace-profile-4x8-ubuntu-2204steps:+ - id: generate-token+ name: steps::authenticate_as_zippy+ uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859+ with:+ app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}+ private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}+ permission-contents: write- name: steps::checkout_repouses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfdwith:clean: false- fetch-depth: 0+ fetch-tags: true- name: release::download_workflow_artifactsuses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7cwith:@@ -519,16 +508,18 @@ jobs:env:DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}- - name: release_nightly::update_nightly_tag_job::update_nightly_tag- run: |- if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then- echo "Nightly tag already points to current commit. Skipping tagging."- exit 0- fi- git config user.name github-actions- git config user.email [email protected]- git tag -f nightly- git push origin nightly --force+ - name: steps::update_tag+ uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b+ with:+ script: |+ github.rest.git.updateRef({+ owner: context.repo.owner,+ repo: context.repo.repo,+ ref: 'tags/nightly',+ sha: context.sha,+ force: true+ })+ github-token: ${{ steps.generate-token.outputs.token }}- name: release::create_sentry_releaseuses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354cwith:@@ -554,6 +545,9 @@ jobs:env:SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}SLACK_MESSAGE: '❌ ${{ github.workflow }} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'+concurrency:+ group: release-nightly+ cancel-in-progress: truedefaults:run:shell: bash -euxo pipefail {0}diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rsindex 2b6a79027d6..f1afa96c230 100644--- a/crates/auto_update/src/auto_update.rs+++ b/crates/auto_update/src/auto_update.rs@@ -42,6 +42,7 @@ impl std::fmt::Display for MissingDependencyError {impl std::error::Error for MissingDependencyError {}const POLL_INTERVAL: Duration = Duration::from_secs(60 * 60);+const NIGHTLY_POLL_INTERVAL: Duration = Duration::from_secs(15 * 60);const REMOTE_SERVER_CACHE_LIMIT: usize = 5;#[cfg(target_os = "linux")]@@ -419,6 +420,12 @@ impl AutoUpdater {}pub fn start_polling(&self, cx: &mut Context<Self>) -> Task<Result<()>> {+ let poll_interval =+ ReleaseChannel::try_global(cx).map_or(POLL_INTERVAL, |channel| match channel {+ ReleaseChannel::Nightly => NIGHTLY_POLL_INTERVAL,+ _ => POLL_INTERVAL,+ });+cx.spawn(async move |this, cx| {if cfg!(target_os = "windows") {use util::ResultExt;@@ -431,7 +438,7 @@ impl AutoUpdater {loop {this.update(cx, |this, cx| this.poll(UpdateCheckType::Automatic, cx))?;- cx.background_executor().timer(POLL_INTERVAL).await;+ cx.background_executor().timer(poll_interval).await;}})}diff --git a/script/bump-nightly b/script/bump-nightlyindex 24199623877..b4c681820da 100755--- a/script/bump-nightly+++ b/script/bump-nightly@@ -2,6 +2,4 @@set -e-git fetch origin main:tags/nightly -f-git log --oneline -1 nightly-git push -f origin nightly+gh workflow run release_nightly.ymldiff --git a/tooling/xtask/src/tasks/workflows/autofix_pr.rs b/tooling/xtask/src/tasks/workflows/autofix_pr.rsindex a409594dfd6..e576f43f91d 100644--- a/tooling/xtask/src/tasks/workflows/autofix_pr.rs+++ b/tooling/xtask/src/tasks/workflows/autofix_pr.rs@@ -4,7 +4,7 @@ use crate::tasks::workflows::{runners,steps::{self, DownloadArtifactStep, FluentBuilder, IfNoFilesFound, NamedJob, RepositoryTarget,- TokenPermissions, UploadArtifactStep, named, use_clang,+ TokenPermissions, UploadArtifactStep, ZippyGitIdentity, named, use_clang,},vars::{self, StepOutput, WorkflowInput},};@@ -129,16 +129,7 @@ fn commit_changes(pr_number: &WorkflowInput, autofix_job: &NamedJob) -> NamedJobgit commit -am "Autofix"git push"#})- .add_env(("GIT_COMMITTER_NAME", "Zed Zippy"))- .add_env((- "GIT_COMMITTER_EMAIL",- "234243425+zed-zippy[bot]@users.noreply.github.com",- ))- .add_env(("GIT_AUTHOR_NAME", "Zed Zippy"))- .add_env((- "GIT_AUTHOR_EMAIL",- "234243425+zed-zippy[bot]@users.noreply.github.com",- ))+ .with_zippy_git_identity().add_env(("GITHUB_TOKEN", token))}diff --git a/tooling/xtask/src/tasks/workflows/cherry_pick.rs b/tooling/xtask/src/tasks/workflows/cherry_pick.rsindex fe5a966156d..15d2808dbf6 100644--- a/tooling/xtask/src/tasks/workflows/cherry_pick.rs+++ b/tooling/xtask/src/tasks/workflows/cherry_pick.rs@@ -2,7 +2,7 @@ use gh_workflow::*;use crate::tasks::workflows::{runners,- steps::{self, NamedJob, RepositoryTarget, TokenPermissions, named},+ steps::{self, NamedJob, RepositoryTarget, TokenPermissions, ZippyGitIdentity, named},vars::{StepOutput, WorkflowInput},};@@ -39,16 +39,7 @@ fn run_cherry_pick(.add_env(("BRANCH", branch.to_string())).add_env(("COMMIT", commit.to_string())).add_env(("CHANNEL", channel.to_string()))- .add_env(("GIT_AUTHOR_NAME", "zed-zippy[bot]"))- .add_env((- "GIT_AUTHOR_EMAIL",- "<234243425+zed-zippy[bot]@users.noreply.github.com>",- ))- .add_env(("GIT_COMMITTER_NAME", "zed-zippy[bot]"))- .add_env((- "GIT_COMMITTER_EMAIL",- "<234243425+zed-zippy[bot]@users.noreply.github.com>",- ))+ .with_zippy_git_identity().add_env(("GITHUB_TOKEN", token))}diff --git a/tooling/xtask/src/tasks/workflows/extension_workflow_rollout.rs b/tooling/xtask/src/tasks/workflows/extension_workflow_rollout.rsindex 4dd1f1bb1fc..e97b6edff47 100644--- a/tooling/xtask/src/tasks/workflows/extension_workflow_rollout.rs+++ b/tooling/xtask/src/tasks/workflows/extension_workflow_rollout.rs@@ -13,7 +13,8 @@ use crate::tasks::workflows::vars::JobOutput;use crate::tasks::workflows::{runners,steps::{- self, DEFAULT_REPOSITORY_OWNER_GUARD, NamedJob, RepositoryTarget, generate_token, named,+ self, DEFAULT_REPOSITORY_OWNER_GUARD, NamedJob, RepositoryTarget, ZippyGitIdentity,+ generate_token, named,},vars::{self, StepOutput, WorkflowInput},};@@ -348,13 +349,6 @@ fn create_rollout_tag(rollout_job: &NamedJob, filter_repos_input: &WorkflowInput"#})}- fn configure_git() -> Step<Run> {- named::bash(indoc! {r#"- git config user.name "zed-zippy[bot]"- git config user.email "234243425+zed-zippy[bot]@users.noreply.github.com"- "#})- }-let (authenticate, token) =generate_token(vars::ZED_ZIPPY_APP_ID, vars::ZED_ZIPPY_APP_PRIVATE_KEY).for_repository(RepositoryTarget::current())@@ -371,8 +365,7 @@ fn create_rollout_tag(rollout_job: &NamedJob, filter_repos_input: &WorkflowInput.timeout_minutes(1u32).add_step(authenticate).add_step(checkout_zed_repo(&token))- .add_step(configure_git())- .add_step(update_rollout_tag());+ .add_step(update_rollout_tag().with_zippy_git_identity());named::job(job)}diff --git a/tooling/xtask/src/tasks/workflows/release_nightly.rs b/tooling/xtask/src/tasks/workflows/release_nightly.rsindex 277db38bee6..c9e51969e43 100644--- a/tooling/xtask/src/tasks/workflows/release_nightly.rs+++ b/tooling/xtask/src/tasks/workflows/release_nightly.rs@@ -5,9 +5,12 @@ use crate::tasks::workflows::{prep_release_artifacts,},run_bundling::{bundle_linux, bundle_mac, bundle_windows},- run_tests::{clippy, run_platform_tests_no_filter},+ run_tests::run_platform_tests_no_filter,runners::{Arch, Platform, ReleaseChannel},- steps::{CommonJobConditions, FluentBuilder, NamedJob},+ steps::{+ CommonJobConditions, DEFAULT_REPOSITORY_OWNER_GUARD, FluentBuilder, GitRef, NamedJob,+ RefSha, RepositoryTarget, TokenPermissions,+ },};use super::{runners, steps, steps::named, vars};@@ -15,48 +18,46 @@ use gh_workflow::*;/// Generates the release_nightly.yml workflowpub fn release_nightly() -> Workflow {- let style = check_style();- // run only on windows as that's our fastest platform right now.- let tests = run_platform_tests_no_filter(Platform::Windows);- let clippy_job = clippy(Platform::Windows, None);- let nightly = Some(ReleaseChannel::Nightly);+ let (check_tag, skip) = check_nightly_tag();+ let mut tests = run_platform_tests_no_filter(Platform::Linux);+ tests.job = tests+ .job+ .needs([check_tag.name.clone()])+ .cond(Expression::new(format!(+ "{DEFAULT_REPOSITORY_OWNER_GUARD} && {} != 'true'",+ skip.expr()+ )));++ const NIGHTLY: Option<ReleaseChannel> = Some(ReleaseChannel::Nightly);let bundle = ReleaseBundleJobs {- linux_aarch64: bundle_linux(Arch::AARCH64, nightly, &[&style, &tests, &clippy_job]),- linux_x86_64: bundle_linux(Arch::X86_64, nightly, &[&style, &tests, &clippy_job]),- mac_aarch64: bundle_mac(Arch::AARCH64, nightly, &[&style, &tests, &clippy_job]),- mac_x86_64: bundle_mac(Arch::X86_64, nightly, &[&style, &tests, &clippy_job]),- windows_aarch64: bundle_windows(Arch::AARCH64, nightly, &[&style, &tests, &clippy_job]),- windows_x86_64: bundle_windows(Arch::X86_64, nightly, &[&style, &tests, &clippy_job]),+ linux_aarch64: bundle_linux(Arch::AARCH64, NIGHTLY, &[&tests]),+ linux_x86_64: bundle_linux(Arch::X86_64, NIGHTLY, &[&tests]),+ mac_aarch64: bundle_mac(Arch::AARCH64, NIGHTLY, &[&tests]),+ mac_x86_64: bundle_mac(Arch::X86_64, NIGHTLY, &[&tests]),+ windows_aarch64: bundle_windows(Arch::AARCH64, NIGHTLY, &[&tests]),+ windows_x86_64: bundle_windows(Arch::X86_64, NIGHTLY, &[&tests]),};- let nix_linux_x86 = build_nix(- Platform::Linux,- Arch::X86_64,- "default",- None,- &[&style, &tests],- );- let nix_mac_arm = build_nix(- Platform::Mac,- Arch::AARCH64,- "default",- None,- &[&style, &tests],- );+ let nix_linux_x86 = build_nix(Platform::Linux, Arch::X86_64, "default", None, &[&tests]);+ let nix_mac_arm = build_nix(Platform::Mac, Arch::AARCH64, "default", None, &[&tests]);let update_nightly_tag = update_nightly_tag_job(&bundle);let notify_on_failure = notify_on_failure(&bundle.jobs());named::workflow().on(Event::default()- // Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)- .schedule([Schedule::new("0 7 * * *")])- .push(Push::default().add_tag("nightly")))+ // Fire 6 times a day+ .schedule([Schedule::new("0 */4 * * *")])+ .workflow_dispatch(WorkflowDispatch::default()))+ .concurrency(+ Concurrency::default()+ .group("release-nightly")+ .cancel_in_progress(true),+ ).add_env(("CARGO_TERM_COLOR", "always")).add_env(("RUST_BACKTRACE", "1"))- .add_job(style.name, style.job)+ .add_job(check_tag.name, check_tag.job).add_job(tests.name, tests.job)- .add_job(clippy_job.name, clippy_job.job).map(|mut workflow| {for job in bundle.into_jobs() {workflow = workflow.add_job(job.name, job.job);@@ -69,14 +70,30 @@ pub fn release_nightly() -> Workflow {.add_job(notify_on_failure.name, notify_on_failure.job)}-fn check_style() -> NamedJob {+fn check_nightly_tag() -> (NamedJob, vars::JobOutput) {+ let step = named::bash(indoc::indoc! {r#"+ NIGHTLY_SHA=$(git rev-parse "nightly" 2>/dev/null || echo "")+ if [ "$NIGHTLY_SHA" = "$GITHUB_SHA" ]; then+ echo "Nightly tag already points to current commit. Skipping."+ echo "skip=true" >> "$GITHUB_OUTPUT"+ else+ echo "skip=false" >> "$GITHUB_OUTPUT"+ fi+ "#})+ .id("check");++ let skip_output = vars::StepOutput::new(&step, "skip");+let job = release_job(&[])- .runs_on(runners::MAC_DEFAULT)- .add_step(steps::checkout_repo().with_full_history())- .add_step(steps::cargo_fmt())- .add_step(steps::script("./script/clippy"));+ .runs_on(runners::LINUX_SMALL)+ .timeout_minutes(5u32)+ .outputs([("skip".to_owned(), skip_output.to_string())])+ .add_step(steps::checkout_repo().with_fetch_tags())+ .add_step(step);- named::job(job)+ let job = named::job(job);+ let skip = skip_output.as_job_output(&job);+ (job, skip)}fn release_job(deps: &[&NamedJob]) -> Job {@@ -91,24 +108,17 @@ fn release_job(deps: &[&NamedJob]) -> Job {}fn update_nightly_tag_job(bundle: &ReleaseBundleJobs) -> NamedJob {- fn update_nightly_tag() -> Step<Run> {- named::bash(indoc::indoc! {r#"- if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then- echo "Nightly tag already points to current commit. Skipping tagging."- exit 0- fi- git config user.name github-actions- git config user.email [email protected]- git tag -f nightly- git push origin nightly --force- "#})- }+ let (authenticate, token) = steps::authenticate_as_zippy()+ .for_repository(RepositoryTarget::current())+ .with_permissions([(TokenPermissions::Contents, Level::Write)])+ .into();NamedJob {name: "update_nightly_tag".to_owned(),job: steps::release_job(&bundle.jobs()).runs_on(runners::LINUX_MEDIUM)- .add_step(steps::checkout_repo().with_full_history())+ .add_step(authenticate)+ .add_step(steps::checkout_repo().with_fetch_tags()).add_step(download_workflow_artifacts()).add_step(steps::script("ls -lR ./artifacts")).add_step(prep_release_artifacts())@@ -123,7 +133,12 @@ fn update_nightly_tag_job(bundle: &ReleaseBundleJobs) -> NamedJob {vars::DIGITALOCEAN_SPACES_SECRET_KEY,)),)- .add_step(update_nightly_tag())+ .add_step(steps::update_ref(+ GitRef::tag("nightly"),+ RefSha::Context,+ &token,+ true,+ )).add_step(create_sentry_release()),}}diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rsindex aec9f2086ba..8e73906396e 100644--- a/tooling/xtask/src/tasks/workflows/steps.rs+++ b/tooling/xtask/src/tasks/workflows/steps.rs@@ -63,6 +63,7 @@ enum FetchDepth {#[derive(Default)]pub(crate) struct CheckoutStep {fetch_depth: FetchDepth,+ fetch_tags: bool,name: Option<String>,token: Option<String>,path: Option<String>,@@ -110,6 +111,11 @@ impl CheckoutStep {self.ref_ = Some(ref_.to_string());self}++ pub fn with_fetch_tags(mut self) -> Self {+ self.fetch_tags = true;+ self+ }}impl From<CheckoutStep> for Step<Use> {@@ -132,6 +138,7 @@ impl From<CheckoutStep> for Step<Use> {.when_some(value.repository, |step, repository| {step.add_with(("repository", repository))})+ .when(value.fetch_tags, |step| step.add_with(("fetch-tags", true))).when_some(value.ref_, |step, ref_| step.add_with(("ref", ref_))).when_some(value.token, |step, token| step.add_with(("token", token)))}@@ -524,6 +531,22 @@ pub mod named {}}+const ZED_ZIPPY_GIT_USER_NAME: &str = "zed-zippy[bot]";+const ZED_ZIPPY_GIT_USER_EMAIL: &str = "234243425+zed-zippy[bot]@users.noreply.github.com";++pub(crate) trait ZippyGitIdentity {+ fn with_zippy_git_identity(self) -> Self;+}++impl ZippyGitIdentity for Step<Run> {+ fn with_zippy_git_identity(self) -> Self {+ self.add_env(("GIT_AUTHOR_NAME", ZED_ZIPPY_GIT_USER_NAME))+ .add_env(("GIT_AUTHOR_EMAIL", ZED_ZIPPY_GIT_USER_EMAIL))+ .add_env(("GIT_COMMITTER_NAME", ZED_ZIPPY_GIT_USER_NAME))+ .add_env(("GIT_COMMITTER_EMAIL", ZED_ZIPPY_GIT_USER_EMAIL))+ }+}+const GITHUB_SCRIPT_SHA: &str = "f28e40c7f34bde8b3046d885e986cb6290c5673b"; // v7const UPLOAD_ARTIFACT_SHA: &str = "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"; // v7.0.1const DOWNLOAD_ARTIFACT_SHA: &str = "3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c"; // v8.0.1@@ -1019,10 +1042,9 @@ pub(crate) fn create_ref(}}-#[allow(unused)]pub(crate) fn update_ref(git_ref: GitRef,- sha: impl ToString,+ sha: impl Into<RefSha>,token: &StepOutput,force: bool,) -> impl Into<Step<Use>> {