diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 1134167e05e29ffebfcf176b4f8c6cfc1b9e862d..054767e5f1fd86c2a5b8fa2112802e797ec10f6e 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -29,10 +29,10 @@ jobs: node-version: '20' cache: pnpm cache-dependency-path: script/danger/pnpm-lock.yaml - - name: danger::install_deps + - name: danger::danger_job::install_deps run: pnpm install --dir script/danger shell: bash -euxo pipefail {0} - - name: danger::run + - name: danger::danger_job::run run: pnpm run --dir script/danger danger ci shell: bash -euxo pipefail {0} env: diff --git a/.github/workflows/nix_build.yml b/.github/workflows/nix_build.yml deleted file mode 100644 index 4dd45bd3a740a43785e0284f0b86b2cdef50c1c7..0000000000000000000000000000000000000000 --- a/.github/workflows/nix_build.yml +++ /dev/null @@ -1,97 +0,0 @@ -# Generated from xtask::workflows::nix_build -# Rebuild with `cargo xtask workflows`. -name: nix_build -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: '1' - CARGO_INCREMENTAL: '0' -on: - pull_request: - branches: - - '**' - paths: - - nix/** - - flake.* - - Cargo.* - - rust-toolchain.toml - - .cargo/config.toml - push: - branches: - - main - - v[0-9]+.[0-9]+.x - paths: - - nix/** - - flake.* - - Cargo.* - - rust-toolchain.toml - - .cargo/config.toml - workflow_call: {} -jobs: - build_nix_linux_x86_64: - if: github.repository_owner == 'zed-industries' - runs-on: namespace-profile-32x64-ubuntu-2004 - env: - ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} - ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} - ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }} - GIT_LFS_SKIP_SMUDGE: '1' - steps: - - name: steps::checkout_repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - clean: false - - name: nix_build::install_nix - uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f - with: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - name: nix_build::cachix_action - uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad - with: - name: zed - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - cachixArgs: -v - pushFilter: -zed-editor-[0-9.]*-nightly - - name: nix_build::build - run: nix build .#debug -L --accept-flake-config - shell: bash -euxo pipefail {0} - timeout-minutes: 60 - continue-on-error: true - build_nix_mac_aarch64: - if: github.repository_owner == 'zed-industries' - runs-on: self-mini-macos - env: - ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} - ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} - ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }} - GIT_LFS_SKIP_SMUDGE: '1' - steps: - - name: steps::checkout_repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - clean: false - - name: nix_build::set_path - run: | - echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" - echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH" - shell: bash -euxo pipefail {0} - - name: nix_build::cachix_action - uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad - with: - name: zed - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - cachixArgs: -v - pushFilter: -zed-editor-[0-9.]*-nightly - - name: nix_build::build - run: nix build .#debug -L --accept-flake-config - shell: bash -euxo pipefail {0} - - name: nix_build::limit_store - run: |- - if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then - nix-collect-garbage -d || true - fi - shell: bash -euxo pipefail {0} - timeout-minutes: 60 - continue-on-error: true -concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }} - cancel-in-progress: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f867996c66c2e2f02052e0e9d33000897bdd3af..e34242b8089431ac98d21abebc5400a7db041907 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -467,7 +467,7 @@ jobs: shell: bash -euxo pipefail {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: release::create_sentry_release + - name: release::auto_release_preview::create_sentry_release uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c with: environment: production diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 80e6534e70e8f7169514fb8cc569f7b11488cd88..20230fb499ea9fa892a316bd1762424869004262 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -201,9 +201,6 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: release_nightly::add_rust_to_path - run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - shell: bash -euxo pipefail {0} - name: ./script/linux run: ./script/linux shell: bash -euxo pipefail {0} @@ -242,9 +239,6 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: release_nightly::add_rust_to_path - run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - shell: bash -euxo pipefail {0} - name: ./script/linux run: ./script/linux shell: bash -euxo pipefail {0} @@ -298,11 +292,11 @@ jobs: "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::build_zed_installer + - name: run_bundling::bundle_windows run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::upload_zed_nightly_windows + - name: release_nightly::upload_zed_nightly run: script/upload-nightly.ps1 -Architecture x86_64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} @@ -340,11 +334,11 @@ jobs: "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::build_zed_installer + - name: run_bundling::bundle_windows run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::upload_zed_nightly_windows + - name: release_nightly::upload_zed_nightly run: script/upload-nightly.ps1 -Architecture aarch64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} @@ -365,17 +359,17 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: nix_build::install_nix + - name: nix_build::build_nix::install_nix uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - - name: nix_build::cachix_action + - name: nix_build::build_nix::cachix_action uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad with: name: zed authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} cachixArgs: -v - - name: nix_build::build + - name: nix_build::build_nix::build run: nix build .#default -L --accept-flake-config shell: bash -euxo pipefail {0} timeout-minutes: 60 @@ -396,21 +390,21 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: nix_build::set_path + - name: nix_build::build_nix::set_path run: | echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH" shell: bash -euxo pipefail {0} - - name: nix_build::cachix_action + - name: nix_build::build_nix::cachix_action uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad with: name: zed authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} cachixArgs: -v - - name: nix_build::build + - name: nix_build::build_nix::build run: nix build .#default -L --accept-flake-config shell: bash -euxo pipefail {0} - - name: nix_build::limit_store + - name: nix_build::build_nix::limit_store run: |- if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then nix-collect-garbage -d || true @@ -434,7 +428,7 @@ jobs: with: clean: false fetch-depth: 0 - - name: release_nightly::update_nightly_tag + - 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." @@ -445,7 +439,7 @@ jobs: git tag -f nightly git push origin nightly --force shell: bash -euxo pipefail {0} - - name: release_nightly::create_sentry_release + - name: release_nightly::update_nightly_tag_job::create_sentry_release uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c with: environment: production diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 63c882bf7b0cf447bfd641002bcf67667bbea8b6..51ff9ee331ca69b251bb00905e22213527cbf118 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -444,18 +444,18 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: nix_build::install_nix + - name: nix_build::build_nix::install_nix uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - - name: nix_build::cachix_action + - name: nix_build::build_nix::cachix_action uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad with: name: zed authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} cachixArgs: -v pushFilter: -zed-editor-[0-9.]*-nightly - - name: nix_build::build + - name: nix_build::build_nix::build run: nix build .#debug -L --accept-flake-config shell: bash -euxo pipefail {0} timeout-minutes: 60 @@ -475,22 +475,22 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: nix_build::set_path + - name: nix_build::build_nix::set_path run: | echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH" shell: bash -euxo pipefail {0} - - name: nix_build::cachix_action + - name: nix_build::build_nix::cachix_action uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad with: name: zed authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} cachixArgs: -v pushFilter: -zed-editor-[0-9.]*-nightly - - name: nix_build::build + - name: nix_build::build_nix::build run: nix build .#debug -L --accept-flake-config shell: bash -euxo pipefail {0} - - name: nix_build::limit_store + - name: nix_build::build_nix::limit_store run: |- if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then nix-collect-garbage -d || true diff --git a/tooling/xtask/src/tasks/workflows/danger.rs b/tooling/xtask/src/tasks/workflows/danger.rs index 6ae7543a76480b37ca53d96d3f682c06b3d073e8..eed2cba732292e5851468766084e846f366b3edc 100644 --- a/tooling/xtask/src/tasks/workflows/danger.rs +++ b/tooling/xtask/src/tasks/workflows/danger.rs @@ -1,11 +1,13 @@ use gh_workflow::*; -use crate::tasks::workflows::steps::named; +use crate::tasks::workflows::steps::{NamedJob, named}; use super::{runners, steps}; /// Generates the danger.yml workflow pub fn danger() -> Workflow { + let danger = danger_job(); + named::workflow() .on( Event::default().pull_request(PullRequest::default().add_branch("main").types([ @@ -15,39 +17,43 @@ pub fn danger() -> Workflow { PullRequestType::Edited, ])), ) - .add_job( - "danger", - Job::default() - .cond(Expression::new( - "github.repository_owner == 'zed-industries'", - )) - .runs_on(runners::LINUX_SMALL) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_pnpm()) - .add_step( - steps::setup_node() - .add_with(("cache", "pnpm")) - .add_with(("cache-dependency-path", "script/danger/pnpm-lock.yaml")), - ) - .add_step(install_deps()) - .add_step(run()), - ) + .add_job(danger.name, danger.job) } -pub fn install_deps() -> Step { - named::bash("pnpm install --dir script/danger") -} +fn danger_job() -> NamedJob { + pub fn install_deps() -> Step { + named::bash("pnpm install --dir script/danger") + } + + pub fn run() -> Step { + named::bash("pnpm run --dir script/danger danger ci") + // This GitHub token is not used, but the value needs to be here to prevent + // Danger from throwing an error. + .add_env(("GITHUB_TOKEN", "not_a_real_token")) + // All requests are instead proxied through an instance of + // https://github.com/maxdeviant/danger-proxy that allows Danger to securely + // authenticate with GitHub while still being able to run on PRs from forks. + .add_env(( + "DANGER_GITHUB_API_BASE_URL", + "https://danger-proxy.fly.dev/github", + )) + } -pub fn run() -> Step { - named::bash("pnpm run --dir script/danger danger ci") - // This GitHub token is not used, but the value needs to be here to prevent - // Danger from throwing an error. - .add_env(("GITHUB_TOKEN", "not_a_real_token")) - // All requests are instead proxied through an instance of - // https://github.com/maxdeviant/danger-proxy that allows Danger to securely - // authenticate with GitHub while still being able to run on PRs from forks. - .add_env(( - "DANGER_GITHUB_API_BASE_URL", - "https://danger-proxy.fly.dev/github", - )) + NamedJob { + name: "danger".to_string(), + job: Job::default() + .cond(Expression::new( + "github.repository_owner == 'zed-industries'", + )) + .runs_on(runners::LINUX_SMALL) + .add_step(steps::checkout_repo()) + .add_step(steps::setup_pnpm()) + .add_step( + steps::setup_node() + .add_with(("cache", "pnpm")) + .add_with(("cache-dependency-path", "script/danger/pnpm-lock.yaml")), + ) + .add_step(install_deps()) + .add_step(run()), + } } diff --git a/tooling/xtask/src/tasks/workflows/nix_build.rs b/tooling/xtask/src/tasks/workflows/nix_build.rs index 85d13ff62fdd3c62ba2db47dfb93c750f29c17c2..3c6818106335aac712bbf4c282107e735cd5c631 100644 --- a/tooling/xtask/src/tasks/workflows/nix_build.rs +++ b/tooling/xtask/src/tasks/workflows/nix_build.rs @@ -14,6 +14,55 @@ pub(crate) fn build_nix( cachix_filter: Option<&str>, deps: &[&NamedJob], ) -> NamedJob { + // on our macs we manually install nix. for some reason the cachix action is running + // under a non-login /bin/bash shell which doesn't source the proper script to add the + // nix profile to PATH, so we manually add them here + pub fn set_path() -> Step { + named::bash(indoc! {r#" + echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" + echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH" + "#}) + } + + pub fn install_nix() -> Step { + named::uses( + "cachix", + "install-nix-action", + "02a151ada4993995686f9ed4f1be7cfbb229e56f", // v31 + ) + .add_with(("github_access_token", vars::GITHUB_TOKEN)) + } + + pub fn cachix_action(cachix_filter: Option<&str>) -> Step { + let mut step = named::uses( + "cachix", + "cachix-action", + "0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad", // v16 + ) + .add_with(("name", "zed")) + .add_with(("authToken", vars::CACHIX_AUTH_TOKEN)) + .add_with(("cachixArgs", "-v")); + if let Some(cachix_filter) = cachix_filter { + step = step.add_with(("pushFilter", cachix_filter)); + } + step + } + + pub fn build(flake_output: &str) -> Step { + named::bash(&format!( + "nix build .#{} -L --accept-flake-config", + flake_output + )) + } + + pub fn limit_store() -> Step { + named::bash(indoc! {r#" + if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then + nix-collect-garbage -d || true + fi"# + }) + } + let runner = match platform { Platform::Windows => unimplemented!(), Platform::Linux => runners::LINUX_X86_BUNDLER, @@ -55,52 +104,3 @@ pub(crate) fn build_nix( job, } } - -// on our macs we manually install nix. for some reason the cachix action is running -// under a non-login /bin/bash shell which doesn't source the proper script to add the -// nix profile to PATH, so we manually add them here -pub fn set_path() -> Step { - named::bash(indoc! {r#" - echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" - echo "/Users/administrator/.nix-profile/bin" >> "$GITHUB_PATH" - "#}) -} - -pub fn install_nix() -> Step { - named::uses( - "cachix", - "install-nix-action", - "02a151ada4993995686f9ed4f1be7cfbb229e56f", // v31 - ) - .add_with(("github_access_token", vars::GITHUB_TOKEN)) -} - -pub fn cachix_action(cachix_filter: Option<&str>) -> Step { - let mut step = named::uses( - "cachix", - "cachix-action", - "0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad", // v16 - ) - .add_with(("name", "zed")) - .add_with(("authToken", vars::CACHIX_AUTH_TOKEN)) - .add_with(("cachixArgs", "-v")); - if let Some(cachix_filter) = cachix_filter { - step = step.add_with(("pushFilter", cachix_filter)); - } - step -} - -pub fn build(flake_output: &str) -> Step { - named::bash(&format!( - "nix build .#{} -L --accept-flake-config", - flake_output - )) -} - -pub fn limit_store() -> Step { - named::bash(indoc! {r#" - if [ "$(du -sm /nix/store | cut -f1)" -gt 50000 ]; then - nix-collect-garbage -d || true - fi"# - }) -} diff --git a/tooling/xtask/src/tasks/workflows/release.rs b/tooling/xtask/src/tasks/workflows/release.rs index ee2e2cb17de0c5ea342d15b0f0a1bba7dfc8adac..52f268ef58a6c81adcf8b9396cc26a9737d846ac 100644 --- a/tooling/xtask/src/tasks/workflows/release.rs +++ b/tooling/xtask/src/tasks/workflows/release.rs @@ -45,7 +45,28 @@ pub(crate) fn release() -> Workflow { .add_job(auto_release_preview.name, auto_release_preview.job) } +struct ReleaseBundleJobs { + linux_arm64: NamedJob, + linux_x86_64: NamedJob, + mac_arm64: NamedJob, + mac_x86_64: NamedJob, + windows_arm64: NamedJob, + windows_x86_64: NamedJob, +} + fn auto_release_preview(deps: &[&NamedJob; 1]) -> NamedJob { + fn create_sentry_release() -> Step { + named::uses( + "getsentry", + "action-release", + "526942b68292201ac6bbb99b9a0747d4abee354c", // v3 + ) + .add_env(("SENTRY_ORG", "zed-dev")) + .add_env(("SENTRY_PROJECT", "zed")) + .add_env(("SENTRY_AUTH_TOKEN", "${{ secrets.SENTRY_AUTH_TOKEN }}")) + .add_with(("environment", "production")) + } + named::job( dependant_job(deps) .runs_on(runners::LINUX_SMALL) @@ -66,27 +87,6 @@ fn auto_release_preview(deps: &[&NamedJob; 1]) -> NamedJob { ) } -fn create_sentry_release() -> Step { - named::uses( - "getsentry", - "action-release", - "526942b68292201ac6bbb99b9a0747d4abee354c", // v3 - ) - .add_env(("SENTRY_ORG", "zed-dev")) - .add_env(("SENTRY_PROJECT", "zed")) - .add_env(("SENTRY_AUTH_TOKEN", "${{ secrets.SENTRY_AUTH_TOKEN }}")) - .add_with(("environment", "production")) -} - -struct ReleaseBundleJobs { - linux_arm64: NamedJob, - linux_x86_64: NamedJob, - mac_arm64: NamedJob, - mac_x86_64: NamedJob, - windows_arm64: NamedJob, - windows_x86_64: NamedJob, -} - fn upload_release_assets(deps: &[&NamedJob], bundle_jobs: &ReleaseBundleJobs) -> NamedJob { fn download_workflow_artifacts() -> Step { named::uses( diff --git a/tooling/xtask/src/tasks/workflows/release_nightly.rs b/tooling/xtask/src/tasks/workflows/release_nightly.rs index 7d7de5b289572c49eeccc103979a7518bec82d44..7079cdbf028c31a27eb9cc230c7c93eb67367680 100644 --- a/tooling/xtask/src/tasks/workflows/release_nightly.rs +++ b/tooling/xtask/src/tasks/workflows/release_nightly.rs @@ -1,6 +1,6 @@ use crate::tasks::workflows::{ nix_build::build_nix, - run_bundling::bundle_mac, + run_bundling::{bundle_mac, bundle_windows}, run_tests::run_platform_tests, runners::{Arch, Platform}, steps::NamedJob, @@ -135,7 +135,6 @@ fn bundle_linux_nightly(arch: Arch, deps: &[&NamedJob]) -> NamedJob { .runs_on(arch.linux_bundler()) .add_step(steps::checkout_repo()) .add_step(steps::setup_sentry()) - .add_step(add_rust_to_path()) .add_step(steps::script("./script/linux")); // todo(ci) can we do this on arm too? @@ -163,12 +162,37 @@ fn bundle_windows_nightly(arch: Arch, deps: &[&NamedJob]) -> NamedJob { .add_step(steps::checkout_repo()) .add_step(steps::setup_sentry()) .add_step(set_release_channel_to_nightly(platform)) - .add_step(build_zed_installer(arch)) - .add_step(upload_zed_nightly_windows(arch)), + .add_step(bundle_windows(arch)) + .add_step(upload_zed_nightly(platform, arch)), } } fn update_nightly_tag_job(deps: &[&NamedJob]) -> NamedJob { + fn update_nightly_tag() -> Step { + 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 github-actions@github.com + git tag -f nightly + git push origin nightly --force + "#}) + } + + fn create_sentry_release() -> Step { + named::uses( + "getsentry", + "action-release", + "526942b68292201ac6bbb99b9a0747d4abee354c", // v3 + ) + .add_env(("SENTRY_ORG", "zed-dev")) + .add_env(("SENTRY_PROJECT", "zed")) + .add_env(("SENTRY_AUTH_TOKEN", vars::SENTRY_AUTH_TOKEN)) + .add_with(("environment", "production")) + } + NamedJob { name: "update_nightly_tag".to_owned(), job: steps::release_job(deps) @@ -197,10 +221,6 @@ fn set_release_channel_to_nightly(platform: Platform) -> Step { } } -fn add_rust_to_path() -> Step { - named::bash(r#"echo "$HOME/.cargo/bin" >> "$GITHUB_PATH""#) -} - fn upload_zed_nightly(platform: Platform, arch: Arch) -> Step { match platform { Platform::Linux => named::bash(&format!("script/upload-nightly linux-targz {arch}")), @@ -214,44 +234,3 @@ fn upload_zed_nightly(platform: Platform, arch: Arch) -> Step { } } } - -fn build_zed_installer(arch: Arch) -> Step { - let cmd = match arch { - Arch::X86_64 => "script/bundle-windows.ps1 -Architecture x86_64", - Arch::ARM64 => "script/bundle-windows.ps1 -Architecture aarch64", - }; - named::pwsh(cmd).working_directory("${{ env.ZED_WORKSPACE }}") -} - -fn upload_zed_nightly_windows(arch: Arch) -> Step { - let cmd = match arch { - Arch::X86_64 => "script/upload-nightly.ps1 -Architecture x86_64", - Arch::ARM64 => "script/upload-nightly.ps1 -Architecture aarch64", - }; - named::pwsh(cmd).working_directory("${{ env.ZED_WORKSPACE }}") -} - -fn update_nightly_tag() -> Step { - 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 github-actions@github.com - git tag -f nightly - git push origin nightly --force - "#}) -} - -fn create_sentry_release() -> Step { - named::uses( - "getsentry", - "action-release", - "526942b68292201ac6bbb99b9a0747d4abee354c", // v3 - ) - .add_env(("SENTRY_ORG", "zed-dev")) - .add_env(("SENTRY_PROJECT", "zed")) - .add_env(("SENTRY_AUTH_TOKEN", vars::SENTRY_AUTH_TOKEN)) - .add_with(("environment", "production")) -} diff --git a/tooling/xtask/src/tasks/workflows/run_bundling.rs b/tooling/xtask/src/tasks/workflows/run_bundling.rs index 2e8990faf8b5fef7a9b4fbcdc2ad2fe91bfed4b2..be163b215bace76c411145d0ad04d8a9dd7788ca 100644 --- a/tooling/xtask/src/tasks/workflows/run_bundling.rs +++ b/tooling/xtask/src/tasks/workflows/run_bundling.rs @@ -144,7 +144,7 @@ pub(crate) fn bundle_windows_job(arch: runners::Arch, deps: &[&NamedJob]) -> Job ) } -fn bundle_windows(arch: runners::Arch) -> Step { +pub fn bundle_windows(arch: runners::Arch) -> Step { let step = match arch { runners::Arch::X86_64 => named::pwsh("script/bundle-windows.ps1 -Architecture x86_64"), runners::Arch::ARM64 => named::pwsh("script/bundle-windows.ps1 -Architecture aarch64"),