logiguard fork: GPUI xdg-activation keyboard-focus serial fix
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Single-commit orphan branch: full zed-industries/zed @ 8c74db0 source tree with a 3-file patch applied (no upstream history). Patch (crates/gpui_linux/src/linux/wayland/): - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Mutter honors window activation only when the token carries the keyboard- focus serial from wl_keyboard.enter; GPUI used a stale mouse-press serial. See docs/tray-window-focus-wayland.md in logiguard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
339
.github/CODEOWNERS.hold
vendored
Normal file
339
.github/CODEOWNERS.hold
vendored
Normal file
@@ -0,0 +1,339 @@
|
||||
# CODEOWNERS for zed-industries/zed
|
||||
#
|
||||
# ┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ WARNING: This file is auto-generated. DO NOT EDIT MANUALLY. │
|
||||
# │ │
|
||||
# │ Changes made directly to this file will be overwritten by the next │
|
||||
# │ scheduled workflow run. To modify code ownership, update the │
|
||||
# │ team-membership-rules.yml file in the codeowner-coordinator repo: │
|
||||
# │ https://github.com/zed-industries/codeowner-coordinator │
|
||||
# └─────────────────────────────────────────────────────────────────────────────┘
|
||||
#
|
||||
# Coverage: 100% (all paths have an owner)
|
||||
#
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# DEFAULT FALLBACK (must be first - CODEOWNERS is last-match-wins)
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
* @zed-industries/first-responder
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# ai-team
|
||||
# LLM integrations, agents, predictions
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/assets/prompts/ @zed-industries/ai-team
|
||||
/crates/acp_thread/ @zed-industries/ai-team
|
||||
/crates/acp_tools/ @zed-industries/ai-team
|
||||
/crates/agent/ @zed-industries/ai-team
|
||||
/crates/agent_servers/ @zed-industries/ai-team
|
||||
/crates/agent_settings/ @zed-industries/ai-team
|
||||
/crates/agent_ui/ @zed-industries/ai-team
|
||||
/crates/ai_onboarding/ @zed-industries/ai-team
|
||||
/crates/anthropic/ @zed-industries/ai-team
|
||||
/crates/bedrock/ @zed-industries/ai-team
|
||||
/crates/cloud_llm_client/ @zed-industries/ai-team
|
||||
/crates/codestral/ @zed-industries/ai-team
|
||||
/crates/context_server/ @zed-industries/ai-team
|
||||
/crates/copilot/ @zed-industries/ai-team
|
||||
/crates/copilot_chat/ @zed-industries/ai-team
|
||||
/crates/copilot_ui/ @zed-industries/ai-team
|
||||
/crates/deepseek/ @zed-industries/ai-team
|
||||
/crates/edit_prediction/ @zed-industries/ai-team
|
||||
/crates/edit_prediction_cli/ @zed-industries/ai-team
|
||||
/crates/edit_prediction_context/ @zed-industries/ai-team
|
||||
/crates/edit_prediction_types/ @zed-industries/ai-team
|
||||
/crates/edit_prediction_ui/ @zed-industries/ai-team
|
||||
/crates/eval_utils/ @zed-industries/ai-team
|
||||
/crates/google_ai/ @zed-industries/ai-team
|
||||
/crates/language_model/ @zed-industries/ai-team
|
||||
/crates/language_models/ @zed-industries/ai-team
|
||||
/crates/lmstudio/ @zed-industries/ai-team
|
||||
/crates/mistral/ @zed-industries/ai-team
|
||||
/crates/ollama/ @zed-industries/ai-team
|
||||
/crates/open_ai/ @zed-industries/ai-team
|
||||
/crates/open_router/ @zed-industries/ai-team
|
||||
/crates/prompt_store/ @zed-industries/ai-team
|
||||
/crates/rules_library/ @zed-industries/ai-team
|
||||
# SUGGESTED: Review needed - based on Richard Feldman (2 commits)
|
||||
/crates/shell_command_parser/ @zed-industries/ai-team
|
||||
/crates/vercel/ @zed-industries/ai-team
|
||||
/crates/x_ai/ @zed-industries/ai-team
|
||||
/crates/zeta_prompt/ @zed-industries/ai-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# collab-team
|
||||
# Real-time collaboration, channels, calls, remote development
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/call/ @zed-industries/collab-team
|
||||
/crates/channel/ @zed-industries/collab-team
|
||||
/crates/client/ @zed-industries/collab-team
|
||||
/crates/collab/ @zed-industries/collab-team
|
||||
/crates/collab_ui/ @zed-industries/collab-team
|
||||
/crates/dev_container/ @zed-industries/collab-team
|
||||
/crates/livekit_api/ @zed-industries/collab-team
|
||||
/crates/livekit_client/ @zed-industries/collab-team
|
||||
/crates/proto/ @zed-industries/collab-team
|
||||
/crates/remote/ @zed-industries/collab-team
|
||||
/crates/remote_server/ @zed-industries/collab-team
|
||||
/crates/rpc/ @zed-industries/collab-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# core-team
|
||||
# GPUI framework, text editing, vim, buffers, text manipulation
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/action_log/ @zed-industries/core-team
|
||||
/crates/breadcrumbs/ @zed-industries/core-team
|
||||
/crates/buffer_diff/ @zed-industries/core-team
|
||||
/crates/editor/ @zed-industries/core-team
|
||||
/crates/encoding_selector/ @zed-industries/core-team
|
||||
/crates/go_to_line/ @zed-industries/core-team
|
||||
/crates/gpui/ @zed-industries/core-team
|
||||
/crates/gpui_macros/ @zed-industries/core-team
|
||||
/crates/gpui_tokio/ @zed-industries/core-team
|
||||
/crates/html_to_markdown/ @zed-industries/core-team
|
||||
/crates/journal/ @zed-industries/core-team
|
||||
/crates/line_ending_selector/ @zed-industries/core-team
|
||||
/crates/multi_buffer/ @zed-industries/core-team
|
||||
/crates/outline/ @zed-industries/core-team
|
||||
/crates/outline_panel/ @zed-industries/core-team
|
||||
/crates/rich_text/ @zed-industries/core-team
|
||||
/crates/rope/ @zed-industries/core-team
|
||||
/crates/snippet/ @zed-industries/core-team
|
||||
/crates/snippet_provider/ @zed-industries/core-team
|
||||
/crates/snippets_ui/ @zed-industries/core-team
|
||||
/crates/streaming_diff/ @zed-industries/core-team
|
||||
/crates/sum_tree/ @zed-industries/core-team
|
||||
/crates/text/ @zed-industries/core-team
|
||||
/crates/vim/ @zed-industries/core-team
|
||||
/crates/vim_mode_setting/ @zed-industries/core-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# developer-tools-team
|
||||
# Terminal, REPL, tasks, debugger, DAP, git integration
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/dap/ @zed-industries/developer-tools-team
|
||||
/crates/dap_adapters/ @zed-industries/developer-tools-team
|
||||
/crates/debug_adapter_extension/ @zed-industries/developer-tools-team
|
||||
/crates/debugger_tools/ @zed-industries/developer-tools-team
|
||||
/crates/debugger_ui/ @zed-industries/developer-tools-team
|
||||
/crates/git/ @zed-industries/developer-tools-team
|
||||
# SUGGESTED: Review needed - based on Anthony Eid (4 commits)
|
||||
/crates/git_graph/ @zed-industries/developer-tools-team
|
||||
/crates/git_hosting_providers/ @zed-industries/developer-tools-team
|
||||
/crates/git_ui/ @zed-industries/developer-tools-team
|
||||
/crates/inspector_ui/ @zed-industries/developer-tools-team
|
||||
/crates/miniprofiler_ui/ @zed-industries/developer-tools-team
|
||||
/crates/repl/ @zed-industries/developer-tools-team
|
||||
/crates/task/ @zed-industries/developer-tools-team
|
||||
/crates/tasks_ui/ @zed-industries/developer-tools-team
|
||||
/crates/terminal/ @zed-industries/developer-tools-team
|
||||
/crates/terminal_view/ @zed-industries/developer-tools-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# ecosystem-team
|
||||
# Language support, LSP, Tree-sitter, extensions, extension API
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/extension/ @zed-industries/ecosystem-team
|
||||
/crates/extension_api/ @zed-industries/ecosystem-team
|
||||
/crates/extension_cli/ @zed-industries/ecosystem-team
|
||||
/crates/extension_host/ @zed-industries/ecosystem-team
|
||||
/crates/extensions_ui/ @zed-industries/ecosystem-team
|
||||
/crates/json_schema_store/ @zed-industries/ecosystem-team
|
||||
/crates/language/ @zed-industries/ecosystem-team
|
||||
/crates/language_extension/ @zed-industries/ecosystem-team
|
||||
/crates/language_onboarding/ @zed-industries/ecosystem-team
|
||||
/crates/language_selector/ @zed-industries/ecosystem-team
|
||||
/crates/language_tools/ @zed-industries/ecosystem-team
|
||||
/crates/languages/ @zed-industries/ecosystem-team
|
||||
/crates/lsp/ @zed-industries/ecosystem-team
|
||||
/crates/node_runtime/ @zed-industries/ecosystem-team
|
||||
/crates/prettier/ @zed-industries/ecosystem-team
|
||||
# SUGGESTED: Review needed - based on Piotr Osiewicz (1 commits)
|
||||
/crates/remote_connection/ @zed-industries/ecosystem-team
|
||||
/crates/toolchain_selector/ @zed-industries/ecosystem-team
|
||||
/extensions/ @zed-industries/ecosystem-team
|
||||
/extensions/glsl/ @zed-industries/ecosystem-team
|
||||
/extensions/html/ @zed-industries/ecosystem-team
|
||||
/extensions/proto/ @zed-industries/ecosystem-team
|
||||
/extensions/test-extension/ @zed-industries/ecosystem-team
|
||||
/extensions/workflows/ @zed-industries/ecosystem-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# infrastructure-team
|
||||
# Core utilities, networking, database, telemetry, reliability
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/aws_http_client/ @zed-industries/infrastructure-team
|
||||
/crates/clock/ @zed-industries/infrastructure-team
|
||||
/crates/collections/ @zed-industries/infrastructure-team
|
||||
/crates/crashes/ @zed-industries/infrastructure-team
|
||||
/crates/credentials_provider/ @zed-industries/infrastructure-team
|
||||
/crates/db/ @zed-industries/infrastructure-team
|
||||
/crates/denoise/ @zed-industries/infrastructure-team
|
||||
/crates/feature_flags/ @zed-industries/infrastructure-team
|
||||
/crates/fs/ @zed-industries/infrastructure-team
|
||||
/crates/fs_benchmarks/ @zed-industries/infrastructure-team
|
||||
/crates/http_client/ @zed-industries/infrastructure-team
|
||||
/crates/http_client_tls/ @zed-industries/infrastructure-team
|
||||
/crates/nc/ @zed-industries/infrastructure-team
|
||||
/crates/net/ @zed-industries/infrastructure-team
|
||||
/crates/paths/ @zed-industries/infrastructure-team
|
||||
/crates/release_channel/ @zed-industries/infrastructure-team
|
||||
/crates/reqwest_client/ @zed-industries/infrastructure-team
|
||||
/crates/scheduler/ @zed-industries/infrastructure-team
|
||||
/crates/session/ @zed-industries/infrastructure-team
|
||||
/crates/sqlez/ @zed-industries/infrastructure-team
|
||||
/crates/sqlez_macros/ @zed-industries/infrastructure-team
|
||||
/crates/telemetry/ @zed-industries/infrastructure-team
|
||||
/crates/telemetry_events/ @zed-industries/infrastructure-team
|
||||
/crates/time_format/ @zed-industries/infrastructure-team
|
||||
/crates/util/ @zed-industries/infrastructure-team
|
||||
/crates/util_macros/ @zed-industries/infrastructure-team
|
||||
/crates/watch/ @zed-industries/infrastructure-team
|
||||
/crates/web_search/ @zed-industries/infrastructure-team
|
||||
/crates/web_search_providers/ @zed-industries/infrastructure-team
|
||||
/crates/zlog/ @zed-industries/infrastructure-team
|
||||
/crates/zlog_settings/ @zed-industries/infrastructure-team
|
||||
/crates/ztracing/ @zed-industries/infrastructure-team
|
||||
/crates/ztracing_macro/ @zed-industries/infrastructure-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# platform-team
|
||||
# App shell, CI/CD, packaging, distribution, build scripts
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/.factory/ @zed-industries/platform-team
|
||||
/.zed/ @zed-industries/platform-team
|
||||
/assets/badge/ @zed-industries/platform-team
|
||||
/assets/settings/ @zed-industries/platform-team
|
||||
/ci/ @zed-industries/platform-team
|
||||
/crates/askpass/ @zed-industries/platform-team
|
||||
/crates/audio/ @zed-industries/platform-team
|
||||
/crates/auto_update/ @zed-industries/platform-team
|
||||
/crates/auto_update_helper/ @zed-industries/platform-team
|
||||
/crates/auto_update_ui/ @zed-industries/platform-team
|
||||
/crates/cli/ @zed-industries/platform-team
|
||||
/crates/command_palette/ @zed-industries/platform-team
|
||||
/crates/command_palette_hooks/ @zed-industries/platform-team
|
||||
/crates/docs_preprocessor/ @zed-industries/platform-team
|
||||
/crates/feedback/ @zed-industries/platform-team
|
||||
/crates/install_cli/ @zed-industries/platform-team
|
||||
/crates/keymap_editor/ @zed-industries/platform-team
|
||||
/crates/media/ @zed-industries/platform-team
|
||||
/crates/migrator/ @zed-industries/platform-team
|
||||
/crates/notifications/ @zed-industries/platform-team
|
||||
/crates/onboarding/ @zed-industries/platform-team
|
||||
# SUGGESTED: Review needed - based on Finn Evers (1 commits)
|
||||
/crates/platform_title_bar/ @zed-industries/platform-team
|
||||
/crates/schema_generator/ @zed-industries/platform-team
|
||||
/crates/settings/ @zed-industries/platform-team
|
||||
/crates/settings_content/ @zed-industries/platform-team
|
||||
/crates/settings_json/ @zed-industries/platform-team
|
||||
/crates/settings_macros/ @zed-industries/platform-team
|
||||
/crates/settings_profile_selector/ @zed-industries/platform-team
|
||||
/crates/settings_ui/ @zed-industries/platform-team
|
||||
# SUGGESTED: Review needed - based on Finn Evers (2 commits)
|
||||
/crates/sidebar/ @zed-industries/platform-team
|
||||
/crates/system_specs/ @zed-industries/platform-team
|
||||
/crates/zed/ @zed-industries/platform-team
|
||||
/crates/zed_actions/ @zed-industries/platform-team
|
||||
/crates/zed_env_vars/ @zed-industries/platform-team
|
||||
/docs/ @zed-industries/platform-team
|
||||
/docs/.conventions/ @zed-industries/platform-team
|
||||
/docs/.doc-examples/ @zed-industries/platform-team
|
||||
/docs/src/ @zed-industries/platform-team
|
||||
/docs/theme/ @zed-industries/platform-team
|
||||
/nix/ @zed-industries/platform-team
|
||||
/script/ @zed-industries/platform-team
|
||||
/script/danger/ @zed-industries/platform-team
|
||||
/script/flatpak/ @zed-industries/platform-team
|
||||
/script/lib/ @zed-industries/platform-team
|
||||
/script/licenses/ @zed-industries/platform-team
|
||||
/script/terms/ @zed-industries/platform-team
|
||||
/script/update_top_ranking_issues/ @zed-industries/platform-team
|
||||
/tooling/ @zed-industries/platform-team
|
||||
/tooling/perf/ @zed-industries/platform-team
|
||||
/tooling/xtask/ @zed-industries/platform-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# project-team
|
||||
# Project/workspace management, file navigation, search
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/crates/diagnostics/ @zed-industries/project-team
|
||||
/crates/explorer_command_injector/ @zed-industries/project-team
|
||||
/crates/file_finder/ @zed-industries/project-team
|
||||
/crates/file_icons/ @zed-industries/project-team
|
||||
/crates/fuzzy/ @zed-industries/project-team
|
||||
/crates/project/ @zed-industries/project-team
|
||||
/crates/project_benchmarks/ @zed-industries/project-team
|
||||
/crates/project_panel/ @zed-industries/project-team
|
||||
/crates/project_symbols/ @zed-industries/project-team
|
||||
/crates/recent_projects/ @zed-industries/project-team
|
||||
/crates/search/ @zed-industries/project-team
|
||||
/crates/workspace/ @zed-industries/project-team
|
||||
/crates/worktree/ @zed-industries/project-team
|
||||
/crates/worktree_benchmarks/ @zed-industries/project-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# ui-team
|
||||
# UI components, themes, visual design
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/assets/ @zed-industries/ui-team
|
||||
/assets/fonts/ @zed-industries/ui-team
|
||||
/assets/icons/ @zed-industries/ui-team
|
||||
/assets/images/ @zed-industries/ui-team
|
||||
/assets/keymaps/ @zed-industries/ui-team
|
||||
/assets/sounds/ @zed-industries/ui-team
|
||||
/assets/themes/ @zed-industries/ui-team
|
||||
/crates/activity_indicator/ @zed-industries/ui-team
|
||||
/crates/assets/ @zed-industries/ui-team
|
||||
/crates/component/ @zed-industries/ui-team
|
||||
/crates/component_preview/ @zed-industries/ui-team
|
||||
/crates/icons/ @zed-industries/ui-team
|
||||
/crates/image_viewer/ @zed-industries/ui-team
|
||||
/crates/markdown/ @zed-industries/ui-team
|
||||
/crates/markdown_preview/ @zed-industries/ui-team
|
||||
/crates/menu/ @zed-industries/ui-team
|
||||
/crates/panel/ @zed-industries/ui-team
|
||||
/crates/picker/ @zed-industries/ui-team
|
||||
/crates/refineable/ @zed-industries/ui-team
|
||||
/crates/story/ @zed-industries/ui-team
|
||||
/crates/storybook/ @zed-industries/ui-team
|
||||
/crates/svg_preview/ @zed-industries/ui-team
|
||||
/crates/tab_switcher/ @zed-industries/ui-team
|
||||
/crates/theme/ @zed-industries/ui-team
|
||||
/crates/theme_extension/ @zed-industries/ui-team
|
||||
/crates/theme_importer/ @zed-industries/ui-team
|
||||
/crates/theme_selector/ @zed-industries/ui-team
|
||||
/crates/title_bar/ @zed-industries/ui-team
|
||||
/crates/ui/ @zed-industries/ui-team
|
||||
/crates/ui_input/ @zed-industries/ui-team
|
||||
/crates/ui_macros/ @zed-industries/ui-team
|
||||
/crates/ui_prompt/ @zed-industries/ui-team
|
||||
/crates/which_key/ @zed-industries/ui-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# zed-dev-team
|
||||
# Zed website, marketing, documentation site
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
# SUGGESTED: Review needed - based on Joseph T. Lyons (1 commits)
|
||||
/crates/open_path_prompt/ @zed-industries/zed-dev-team
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# DIRECT OVERRIDES
|
||||
# Paths with specific owner assignments (not derived from team paths)
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/.cloudflare/ @zed-industries/cloud-team
|
||||
/crates/cloud_api_client/ @zed-industries/cloud-team
|
||||
/crates/cloud_api_types/ @zed-industries/cloud-team
|
||||
/legal/ @zed-industries/bizops-team
|
||||
43
.github/DISCUSSION_TEMPLATE/feature-requests.yml
vendored
Normal file
43
.github/DISCUSSION_TEMPLATE/feature-requests.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
# Feature Request
|
||||
|
||||
Welcome! 👋
|
||||
|
||||
If you are interested in proposing a new feature, improvement, or change to Zed, you are in the right place.
|
||||
|
||||
Use this template to suggest a new feature, improvement, or change.
|
||||
|
||||
- type: textarea
|
||||
id: main
|
||||
attributes:
|
||||
label: Body
|
||||
value: |
|
||||
# What are you proposing?
|
||||
|
||||
Describe the feature, improvement, or change at a high level.
|
||||
|
||||
# Why does this matter?
|
||||
|
||||
What problem does this solve?
|
||||
|
||||
What becomes easier or possible?
|
||||
|
||||
# Are there any examples or context?
|
||||
|
||||
Screenshots, mockups, workflows, or examples from other tools.
|
||||
|
||||
# Possible approach
|
||||
|
||||
If you have ideas about how this could work, share them here.
|
||||
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Learn more about how feature requests work in our
|
||||
[Feature Request Guidelines](https://github.com/zed-industries/zed/discussions/51422).
|
||||
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: zed-industries
|
||||
119
.github/ISSUE_TEMPLATE/10_bug_report.yml
vendored
Normal file
119
.github/ISSUE_TEMPLATE/10_bug_report.yml
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
name: Report a bug
|
||||
description: Report a problem with Zed.
|
||||
type: Bug
|
||||
labels: "state:needs triage"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Is this bug already reported? Upvote to get it noticed faster. [Here’s the search](https://github.com/zed-industries/zed/issues). Upvote means giving it a :+1: reaction.
|
||||
|
||||
Feature request? Please open in [discussions](https://github.com/zed-industries/zed/discussions/new/choose) instead.
|
||||
|
||||
Just have a question or need support? Welcome to [Discord Support Forums](https://discord.com/invite/zedindustries).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Reproduction steps
|
||||
description: A step-by-step description of how to reproduce the bug from a **clean Zed install**. The more context you provide, the easier it is to find and fix the problem fast.
|
||||
placeholder: |
|
||||
1. Start Zed
|
||||
2. Click X
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Current vs. Expected behavior
|
||||
description: |
|
||||
Current behavior (screenshots, videos, etc. are appreciated), vs. what you expected the behavior to be.
|
||||
|
||||
placeholder: |
|
||||
Current behavior: <screenshot with an arrow> The icon is blue. Expected behavior: The icon should be red because this is what the setting is documented to do.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: Zed version and system specs
|
||||
description: |
|
||||
Open the command palette in Zed, then type “zed: copy system specs into clipboard”.
|
||||
placeholder: |
|
||||
Zed: v0.215.0 (Zed Nightly bfe141ea79aa4984028934067ba75c48d99136ae)
|
||||
OS: macOS 15.1
|
||||
Memory: 36 GiB
|
||||
Architecture: aarch64
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Attach Zed log file
|
||||
description: |
|
||||
Open the command palette in Zed, then type `zed: open log` to see the last 1000 lines. Or type `zed: reveal log in file manager` in the command palette to reveal the log file itself.
|
||||
|
||||
⚠️ **Please review your log file for secrets (API keys, tokens, etc.) and partially or fully redact them before posting.**
|
||||
value: |
|
||||
<details><summary>Zed.log</summary>
|
||||
|
||||
<!-- Paste your log inside the code block. -->
|
||||
```log
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant Zed settings
|
||||
description: |
|
||||
Open the command palette in Zed, then type “zed: open settings file” and copy/paste any relevant (e.g., LSP-specific) settings.
|
||||
|
||||
⚠️ **Please review your settings file for secrets (API keys, tokens, etc.) and partially or fully redact them before posting.**
|
||||
value: |
|
||||
<details><summary>settings.json</summary>
|
||||
|
||||
<!-- Paste your settings inside the code block. -->
|
||||
```json
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant Keymap
|
||||
description: |
|
||||
Open the command palette in Zed, then type “zed: open keymap file” and copy/paste the file’s contents.
|
||||
value: |
|
||||
<details><summary>keymap.json</summary>
|
||||
|
||||
<!-- Paste your keymap file inside the code block. -->
|
||||
```json
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: (for AI issues) Model provider details
|
||||
placeholder: |
|
||||
- Provider: (Anthropic via ZedPro, Anthropic via API key, Copilot Chat, Mistral, OpenAI, etc.)
|
||||
- Model Name: (Claude Sonnet 4.5, Gemini 3.1 Pro, GPT-5)
|
||||
- Mode: (Agent Panel, Inline Assistant, or Terminal Assistant)
|
||||
- Other details (ACPs, MCPs, other settings, etc.):
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: If you are using WSL on Windows, what flavor of Linux are you using?
|
||||
multiple: false
|
||||
options:
|
||||
- Arch Linux
|
||||
- Ubuntu
|
||||
- Fedora
|
||||
- Mint
|
||||
- Pop!_OS
|
||||
- NixOS
|
||||
- Other
|
||||
45
.github/ISSUE_TEMPLATE/11_crash_report.yml
vendored
Normal file
45
.github/ISSUE_TEMPLATE/11_crash_report.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Report a crash
|
||||
description: Zed is crashing or freezing or hanging.
|
||||
type: Crash
|
||||
labels: "state:needs triage"
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Reproduction steps
|
||||
description: A step-by-step description of how to reproduce the crash from a **clean Zed install**. The more context you provide, the easier it is to find and fix the problem fast.
|
||||
placeholder: |
|
||||
1. Start Zed
|
||||
2. Perform an action
|
||||
3. Zed crashes
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Zed version and system specs
|
||||
description: |
|
||||
Open the command palette in Zed, then type “zed: copy system specs into clipboard”.
|
||||
placeholder: |
|
||||
Zed: v0.215.0 (Zed Nightly bfe141ea79aa4984028934067ba75c48d99136ae)
|
||||
OS: macOS 15.1
|
||||
Memory: 36 GiB
|
||||
Architecture: aarch64
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Attach Zed log file
|
||||
description: |
|
||||
Open the command palette in Zed, then type `zed: open log` to see the last 1000 lines. Or type `zed: reveal log in file manager` in the command palette to reveal the log file itself.
|
||||
|
||||
⚠️ **Please review your log file for secrets (API keys, tokens, etc.) and partially or fully redact them before posting.**
|
||||
value: |
|
||||
<details><summary>Zed.log</summary>
|
||||
|
||||
<!-- Paste your log inside the code block. -->
|
||||
```log
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
validations:
|
||||
required: false
|
||||
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# yaml-language-server: $schema=https://www.schemastore.org/github-issue-config.json
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Feature request
|
||||
url: https://github.com/zed-industries/zed/discussions/new?category=feature-requests
|
||||
about: To request a feature, open a new discussion under one of the appropriate categories.
|
||||
- name: Our Discord community
|
||||
url: https://discord.com/invite/zedindustries
|
||||
about: Join our Discord server for real-time discussion and user support.
|
||||
48
.github/actionlint.yml
vendored
Normal file
48
.github/actionlint.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# Configuration related to self-hosted runner.
|
||||
self-hosted-runner:
|
||||
# Labels of self-hosted runner in array of strings.
|
||||
labels:
|
||||
# GitHub-hosted Runners
|
||||
- github-8vcpu-ubuntu-2404
|
||||
- github-16vcpu-ubuntu-2404
|
||||
- github-32vcpu-ubuntu-2404
|
||||
- github-8vcpu-ubuntu-2204
|
||||
- github-16vcpu-ubuntu-2204
|
||||
- github-32vcpu-ubuntu-2204
|
||||
- github-16vcpu-ubuntu-2204-arm
|
||||
- windows-2025-16
|
||||
- windows-2025-32
|
||||
- windows-2025-64
|
||||
# Namespace Ubuntu 20.04 (Release builds)
|
||||
- namespace-profile-16x32-ubuntu-2004
|
||||
- namespace-profile-32x64-ubuntu-2004
|
||||
- namespace-profile-16x32-ubuntu-2004-arm
|
||||
- namespace-profile-32x64-ubuntu-2004-arm
|
||||
# Namespace Ubuntu 22.04 (Everything else)
|
||||
- namespace-profile-4x8-ubuntu-2204
|
||||
- namespace-profile-8x16-ubuntu-2204
|
||||
- namespace-profile-16x32-ubuntu-2204
|
||||
- namespace-profile-32x64-ubuntu-2204
|
||||
# Namespace Ubuntu 24.04 (like ubuntu-latest)
|
||||
- namespace-profile-2x4-ubuntu-2404
|
||||
- namespace-profile-8x32-ubuntu-2404
|
||||
# Namespace Limited Preview
|
||||
- namespace-profile-8x16-ubuntu-2004-arm-m4
|
||||
- namespace-profile-8x32-ubuntu-2004-arm-m4
|
||||
# Namespace mac
|
||||
- namespace-profile-mac-large
|
||||
# Self Hosted Runners
|
||||
- self-mini-macos
|
||||
- self-32vcpu-windows-2022
|
||||
|
||||
# Disable shellcheck because it doesn't like powershell
|
||||
# This should have been triggered with initial rollout of actionlint
|
||||
# but https://github.com/zed-industries/zed/pull/36693
|
||||
# somehow caused actionlint to actually check those windows jobs
|
||||
# where previously they were being skipped. Likely caused by an
|
||||
# unknown bug in actionlint where parsing of `runs-on: [ ]`
|
||||
# breaks something else. (yuck)
|
||||
paths:
|
||||
.github/workflows/{ci,release_nightly}.yml:
|
||||
ignore:
|
||||
- "shellcheck"
|
||||
9
.github/actions/check_style/action.yml
vendored
Normal file
9
.github/actions/check_style/action.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
name: "Check formatting"
|
||||
description: "Checks code formatting use cargo fmt"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: cargo fmt
|
||||
shell: bash -euxo pipefail {0}
|
||||
run: cargo fmt --all -- --check
|
||||
21
.github/actions/run_tests/action.yml
vendored
Normal file
21
.github/actions/run_tests/action.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: "Run tests"
|
||||
description: "Runs the tests"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install nextest
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c # nextest
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Limit target directory size
|
||||
shell: bash -euxo pipefail {0}
|
||||
run: script/clear-target-dir-if-larger-than 350 200
|
||||
|
||||
- name: Run tests
|
||||
shell: bash -euxo pipefail {0}
|
||||
run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
|
||||
26
.github/actions/run_tests_windows/action.yml
vendored
Normal file
26
.github/actions/run_tests_windows/action.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: "Run tests on Windows"
|
||||
description: "Runs the tests on Windows"
|
||||
|
||||
inputs:
|
||||
working-directory:
|
||||
description: "The working directory"
|
||||
required: true
|
||||
default: "."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install test runner
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c # nextest
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Run tests
|
||||
shell: powershell
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
run: |
|
||||
cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
|
||||
2
.github/cherry-pick-bot.yml
vendored
Normal file
2
.github/cherry-pick-bot.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
enabled: true
|
||||
preservePullRequestTitle: true
|
||||
13
.github/pull_request_template.md
vendored
Normal file
13
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Self-Review Checklist:
|
||||
|
||||
- [ ] I've reviewed my own diff for quality, security, and reliability
|
||||
- [ ] Unsafe blocks (if any) have justifying comments
|
||||
- [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
|
||||
- [ ] Tests cover the new/changed behavior
|
||||
- [ ] Performance impact has been considered and is acceptable
|
||||
|
||||
Closes #ISSUE
|
||||
|
||||
Release Notes:
|
||||
|
||||
- N/A or Added/Fixed/Improved ...
|
||||
83
.github/workflows/add_commented_closed_issue_to_project.yml
vendored
Normal file
83
.github/workflows/add_commented_closed_issue_to_project.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: "Surface closed issues someone's commented on"
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
add-to-project:
|
||||
if: >
|
||||
github.repository == 'zed-industries/zed' &&
|
||||
github.event.issue.state == 'closed' &&
|
||||
github.event.issue.pull_request == null &&
|
||||
github.event.issue.type != null &&
|
||||
github.event.issue.type.name == 'Bug' &&
|
||||
github.event.comment.user.type != 'Bot'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- id: is-post-close-comment
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const closedAt = new Date(context.payload.issue.closed_at);
|
||||
const commentedAt = new Date(context.payload.comment.created_at);
|
||||
const diffSeconds = Math.abs(commentedAt - closedAt) / 1000;
|
||||
if (diffSeconds <= 30) {
|
||||
core.notice(`Skipping — comment was likely part of "Close with comment" (${diffSeconds}s gap)`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
- if: steps.is-post-close-comment.outputs.result == 'true'
|
||||
id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- if: steps.is-post-close-comment.outputs.result == 'true'
|
||||
id: check-staff
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||
script: |
|
||||
try {
|
||||
const response = await github.rest.teams.getMembershipForUserInOrg({
|
||||
org: 'zed-industries',
|
||||
team_slug: 'staff',
|
||||
username: context.payload.comment.user.login
|
||||
});
|
||||
return response.data.state === 'active';
|
||||
} catch (error) {
|
||||
// 404 means user is not a member
|
||||
if (error.status === 404) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
- if: steps.is-post-close-comment.outputs.result == 'true' && steps.check-staff.outputs.result == 'true'
|
||||
env:
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo "::notice::Skipping issue #$ISSUE_NUMBER - commenter is staff member"
|
||||
|
||||
# github-script outputs are JSON strings, so we compare against 'false' (string)
|
||||
- if: steps.is-post-close-comment.outputs.result == 'true' && steps.check-staff.outputs.result == 'false'
|
||||
env:
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
|
||||
run: |
|
||||
echo "::notice::Adding issue #$ISSUE_NUMBER to project (comment by $COMMENT_USER_LOGIN)"
|
||||
|
||||
- if: steps.is-post-close-comment.outputs.result == 'true' && steps.check-staff.outputs.result == 'false'
|
||||
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
|
||||
with:
|
||||
project-url: https://github.com/orgs/zed-industries/projects/73
|
||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||
156
.github/workflows/after_release.yml
vendored
Normal file
156
.github/workflows/after_release.yml
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
# Generated from xtask::workflows::after_release
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: after_release
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name || inputs.tag_name }}
|
||||
IS_PRERELEASE: ${{ github.event.release.prerelease || inputs.prerelease }}
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_name:
|
||||
description: tag_name
|
||||
required: true
|
||||
type: string
|
||||
prerelease:
|
||||
description: prerelease
|
||||
required: true
|
||||
type: boolean
|
||||
body:
|
||||
description: body
|
||||
type: string
|
||||
default: ''
|
||||
jobs:
|
||||
rebuild_releases_page:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: after_release::rebuild_releases_page::refresh_cloud_releases
|
||||
run: curl -fX POST "https://cloud.zed.dev/releases/refresh?expect_tag=$TAG_NAME"
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: after_release::rebuild_releases_page::redeploy_zed_dev
|
||||
run: ./script/redeploy-vercel
|
||||
env:
|
||||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
||||
deploy_docs:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
permissions:
|
||||
contents: read
|
||||
uses: zed-industries/zed/.github/workflows/deploy_docs.yml@main
|
||||
secrets:
|
||||
DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
with:
|
||||
channel: ${{ (github.event.release.prerelease || inputs.prerelease) && 'preview' || 'stable' }}
|
||||
checkout_ref: ${{ github.event.release.tag_name || inputs.tag_name }}
|
||||
post_to_discord:
|
||||
needs:
|
||||
- rebuild_releases_page
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: get-release-url
|
||||
name: after_release::post_to_discord::get_release_url
|
||||
run: |
|
||||
if [ "$IS_PRERELEASE" == "true" ]; then
|
||||
URL="https://zed.dev/releases/preview"
|
||||
else
|
||||
URL="https://zed.dev/releases/stable"
|
||||
fi
|
||||
|
||||
echo "URL=$URL" >> "$GITHUB_OUTPUT"
|
||||
- id: get-content
|
||||
name: after_release::post_to_discord::get_content
|
||||
uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757
|
||||
with:
|
||||
stringToTruncate: |
|
||||
📣 Zed [${{ env.TAG_NAME }}](<${{ steps.get-release-url.outputs.URL }}>) was just released!
|
||||
|
||||
${{ github.event.release.body || inputs.body }}
|
||||
maxLength: 2000
|
||||
truncationSymbol: '...'
|
||||
- name: after_release::post_to_discord::discord_webhook_action
|
||||
uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164
|
||||
with:
|
||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }}
|
||||
content: ${{ steps.get-content.outputs.string }}
|
||||
publish_winget:
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
steps:
|
||||
- name: after_release::publish_winget::sync_winget_pkgs_fork
|
||||
run: |
|
||||
$headers = @{
|
||||
"Authorization" = "Bearer $env:WINGET_TOKEN"
|
||||
"Accept" = "application/vnd.github+json"
|
||||
"X-GitHub-Api-Version" = "2022-11-28"
|
||||
}
|
||||
$body = @{ branch = "master" } | ConvertTo-Json
|
||||
$uri = "https://api.github.com/repos/$env:GITHUB_REPOSITORY_OWNER/winget-pkgs/merge-upstream"
|
||||
try {
|
||||
Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $body -ContentType "application/json"
|
||||
Write-Host "Successfully synced winget-pkgs fork"
|
||||
} catch {
|
||||
Write-Host "Fork sync response: $_"
|
||||
Write-Host "Continuing anyway - fork may already be up to date"
|
||||
}
|
||||
shell: pwsh
|
||||
env:
|
||||
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
||||
- id: set-package-name
|
||||
name: after_release::publish_winget::set_package_name
|
||||
run: |
|
||||
if ($env:IS_PRERELEASE -eq "true") {
|
||||
$PACKAGE_NAME = "ZedIndustries.Zed.Preview"
|
||||
} else {
|
||||
$PACKAGE_NAME = "ZedIndustries.Zed"
|
||||
}
|
||||
|
||||
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $env:GITHUB_OUTPUT
|
||||
shell: pwsh
|
||||
- name: after_release::publish_winget::winget_releaser
|
||||
uses: vedantmgoyal9/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f
|
||||
with:
|
||||
identifier: ${{ steps.set-package-name.outputs.PACKAGE_NAME }}
|
||||
release-tag: ${{ env.TAG_NAME }}
|
||||
max-versions-to-keep: 5
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
create_sentry_release:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: release::create_sentry_release
|
||||
uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c
|
||||
with:
|
||||
environment: production
|
||||
env:
|
||||
SENTRY_ORG: zed-dev
|
||||
SENTRY_PROJECT: zed
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
notify_on_failure:
|
||||
needs:
|
||||
- rebuild_releases_page
|
||||
- post_to_discord
|
||||
- publish_winget
|
||||
- create_sentry_release
|
||||
- deploy_docs
|
||||
if: failure()
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: release::send_slack_message
|
||||
run: 'curl -X POST -H ''Content-type: application/json'' --data "$(jq -n --arg text "$SLACK_MESSAGE" ''{"text": $text}'')" "$SLACK_WEBHOOK"'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
SLACK_MESSAGE: '❌ ${{ github.workflow }} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
104
.github/workflows/assign-reviewers.yml
vendored
Normal file
104
.github/workflows/assign-reviewers.yml
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# Assign Reviewers — Smart team assignment based on diff weight
|
||||
#
|
||||
# Triggers on PR open and ready_for_review events. Checks out the coordinator
|
||||
# repo (zed-industries/codeowner-coordinator) to access the assignment script and rules,
|
||||
# then assigns the 1-2 most relevant teams as reviewers.
|
||||
#
|
||||
# NOTE: This file is stored in the codeowner-coordinator repo but must be deployed to
|
||||
# the zed repo at .github/workflows/assign-reviewers.yml. See INSTALL.md.
|
||||
#
|
||||
# AUTH NOTE: Uses a GitHub App (COORDINATOR_APP_ID + COORDINATOR_APP_PRIVATE_KEY)
|
||||
# for all API operations: cloning the private coordinator repo, requesting team
|
||||
# reviewers, and setting PR assignees. GITHUB_TOKEN is not used.
|
||||
#
|
||||
# SECURITY INVARIANTS (pull_request_target):
|
||||
# This workflow runs with access to secrets for ALL PRs including forks.
|
||||
# It is safe ONLY because:
|
||||
# 1. The checkout is the coordinator repo at ref: main — NEVER the PR head/branch
|
||||
# 2. No ${{ }} interpolation of event fields in run: blocks — all routed via env:
|
||||
# 3. The script never executes, sources, or reads files from the PR branch
|
||||
# Violating any of these enables remote code execution with secret access.
|
||||
|
||||
name: Assign Reviewers
|
||||
|
||||
on:
|
||||
# zizmor: ignore[dangerous-triggers] reviewed — no PR code checkout, only coordinator repo at ref: main
|
||||
pull_request_target:
|
||||
types: [opened, ready_for_review]
|
||||
|
||||
# GITHUB_TOKEN is not used — all operations use the GitHub App token.
|
||||
# Declare minimal permissions so the default token has no write access.
|
||||
permissions: {}
|
||||
|
||||
# Prevent duplicate runs for the same PR (e.g., rapid push + ready_for_review).
|
||||
concurrency:
|
||||
group: assign-reviewers-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# NOTE: For ready_for_review events, the webhook payload may still carry
|
||||
# draft: true due to a GitHub race condition (payload serialized before DB
|
||||
# update). We trust the event type instead — the script rechecks draft status
|
||||
# via a live API call as defense-in-depth.
|
||||
#
|
||||
# No author_association filter — external and fork PRs also get reviewer
|
||||
# assignments. Assigned reviewers are inherently scoped to org team members
|
||||
# by the GitHub Teams API.
|
||||
jobs:
|
||||
assign-reviewers:
|
||||
if: >-
|
||||
github.event.action == 'ready_for_review' || github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ vars.COORDINATOR_APP_ID }}
|
||||
private-key: ${{ secrets.COORDINATOR_APP_PRIVATE_KEY }}
|
||||
repositories: codeowner-coordinator,zed
|
||||
|
||||
# SECURITY: checks out the coordinator repo at ref: main, NOT the PR branch.
|
||||
# persist-credentials: false prevents the token from leaking into .git/config.
|
||||
- name: Checkout coordinator repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
repository: zed-industries/codeowner-coordinator
|
||||
ref: main
|
||||
path: codeowner-coordinator
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --no-deps -q --only-binary ':all:' \
|
||||
-r /dev/stdin <<< "pyyaml==6.0.3 --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d"
|
||||
|
||||
- name: Assign reviewers
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
TARGET_REPO: ${{ github.repository }}
|
||||
ASSIGN_INTERNAL: ${{ vars.ASSIGN_INTERNAL || 'false' }}
|
||||
ASSIGN_EXTERNAL: ${{ vars.ASSIGN_EXTERNAL || 'true' }}
|
||||
run: |
|
||||
cd codeowner-coordinator
|
||||
python .github/scripts/assign-reviewers.py \
|
||||
--pr "$PR_URL" \
|
||||
--apply \
|
||||
--rules-file team-membership-rules.yml \
|
||||
--repo "$TARGET_REPO" \
|
||||
--org zed-industries \
|
||||
2>&1 | tee /tmp/assign-reviewers-output.txt
|
||||
|
||||
- name: Upload output
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: assign-reviewers-output
|
||||
path: /tmp/assign-reviewers-output.txt
|
||||
retention-days: 30
|
||||
70
.github/workflows/assign_contributor_issue.yml
vendored
Normal file
70
.github/workflows/assign_contributor_issue.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# Assign Contributor Issue — auto-assign labeled contributor issues
|
||||
#
|
||||
# When an issue has both a `.contrib/good *` label and an `area:` label,
|
||||
# finds the least-busy contributor interested in that area (via Tally form
|
||||
# responses), assigns the issue, updates the project board, and notifies
|
||||
# the contributor on Slack.
|
||||
#
|
||||
# Errors and "no candidates" conditions are reported to the Slack activity
|
||||
# channel.
|
||||
|
||||
name: Assign Contributor Issue
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: "Issue number to test against"
|
||||
required: true
|
||||
type: number
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: assign-contributor-${{ github.event.issue.number || inputs.issue_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
assign-contributor:
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.repository == 'zed-industries/zed' &&
|
||||
github.event.issue.state == 'open' &&
|
||||
(startsWith(github.event.label.name, '.contrib/good ') || startsWith(github.event.label.name, 'area:')))
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: script/github-assign-contributor-issue.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Assign contributor
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
TALLY_API_KEY: ${{ secrets.TALLY_API_KEY }}
|
||||
TALLY_FORM_ID: ${{ vars.TALLY_CONTRIBUTOR_FORM_ID }}
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTRIBUTOR_BOT_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number || inputs.issue_number }}
|
||||
run: python script/github-assign-contributor-issue.py "$ISSUE_NUMBER"
|
||||
135
.github/workflows/autofix_pr.yml
vendored
Normal file
135
.github/workflows/autofix_pr.yml
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
# Generated from xtask::workflows::autofix_pr
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: autofix_pr
|
||||
run-name: 'autofix PR #${{ inputs.pr_number }}'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
description: pr_number
|
||||
required: true
|
||||
type: string
|
||||
run_clippy:
|
||||
description: run_clippy
|
||||
type: boolean
|
||||
default: 'true'
|
||||
jobs:
|
||||
run_autofix:
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: autofix_pr::run_autofix::checkout_pr
|
||||
run: gh pr checkout "$PR_NUMBER"
|
||||
env:
|
||||
PR_NUMBER: ${{ inputs.pr_number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_pnpm
|
||||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
|
||||
with:
|
||||
version: '9'
|
||||
- name: autofix_pr::run_autofix::install_cargo_machete
|
||||
if: ${{ inputs.run_clippy }}
|
||||
uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507
|
||||
with:
|
||||
tool: cargo-machete@0.7.0
|
||||
- name: autofix_pr::run_autofix::run_cargo_fix
|
||||
if: ${{ inputs.run_clippy }}
|
||||
run: cargo fix --workspace --allow-dirty --allow-staged
|
||||
- name: autofix_pr::run_autofix::run_cargo_machete_fix
|
||||
if: ${{ inputs.run_clippy }}
|
||||
run: cargo machete --fix
|
||||
- name: autofix_pr::run_autofix::run_clippy_fix
|
||||
if: ${{ inputs.run_clippy }}
|
||||
run: cargo clippy --workspace --fix --allow-dirty --allow-staged
|
||||
- name: autofix_pr::run_autofix::run_prettier_fix
|
||||
run: ./script/prettier --write
|
||||
- name: autofix_pr::run_autofix::run_cargo_fmt
|
||||
run: cargo fmt --all
|
||||
- id: create-patch
|
||||
name: autofix_pr::run_autofix::create_patch
|
||||
run: |
|
||||
if git diff --quiet; then
|
||||
echo "No changes to commit"
|
||||
echo "has_changes=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
git diff > autofix.patch
|
||||
echo "has_changes=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: upload artifact autofix-patch
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: autofix-patch
|
||||
path: autofix.patch
|
||||
if-no-files-found: ignore
|
||||
retention-days: '1'
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
outputs:
|
||||
has_changes: ${{ steps.create-patch.outputs.has_changes }}
|
||||
commit_changes:
|
||||
needs:
|
||||
- run_autofix
|
||||
if: needs.run_autofix.outputs.has_changes == 'true'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- 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
|
||||
permission-workflows: write
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: autofix_pr::commit_changes::checkout_pr
|
||||
run: gh pr checkout "$PR_NUMBER"
|
||||
env:
|
||||
PR_NUMBER: ${{ inputs.pr_number }}
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
- name: autofix_pr::download_patch_artifact
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
with:
|
||||
name: autofix-patch
|
||||
- name: autofix_pr::commit_changes::apply_patch
|
||||
run: git apply autofix.patch
|
||||
- name: autofix_pr::commit_changes::commit_and_push
|
||||
run: |
|
||||
git commit -am "Autofix"
|
||||
git push
|
||||
env:
|
||||
GIT_COMMITTER_NAME: Zed Zippy
|
||||
GIT_COMMITTER_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.com
|
||||
GIT_AUTHOR_NAME: Zed Zippy
|
||||
GIT_AUTHOR_EMAIL: 234243425+zed-zippy[bot]@users.noreply.github.com
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ inputs.pr_number }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
331
.github/workflows/background_agent_mvp.yml
vendored
Normal file
331
.github/workflows/background_agent_mvp.yml
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
name: background_agent_mvp
|
||||
|
||||
# NOTE: Scheduled runs disabled as of 2026-02-24. The workflow can still be
|
||||
# triggered manually via workflow_dispatch. See Notion doc "Background Agent
|
||||
# for Zed" for current status and contact info to resume this work.
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: "0 16 * * 1-5"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
crash_ids:
|
||||
description: "Optional comma-separated Sentry issue IDs (e.g. ZED-4VS,ZED-123)"
|
||||
required: false
|
||||
type: string
|
||||
reviewers:
|
||||
description: "Optional comma-separated GitHub reviewer handles"
|
||||
required: false
|
||||
type: string
|
||||
top:
|
||||
description: "Top N candidates when crash_ids is empty"
|
||||
required: false
|
||||
type: string
|
||||
default: "3"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
|
||||
DROID_MODEL: claude-opus-4-5-20251101
|
||||
SENTRY_ORG: zed-dev
|
||||
|
||||
jobs:
|
||||
run-mvp:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 180
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Droid CLI
|
||||
run: |
|
||||
curl -fsSL https://app.factory.ai/cli | sh
|
||||
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
|
||||
echo "DROID_BIN=${HOME}/.local/bin/droid" >> "$GITHUB_ENV"
|
||||
"${HOME}/.local/bin/droid" --version
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Resolve reviewers
|
||||
id: reviewers
|
||||
env:
|
||||
INPUT_REVIEWERS: ${{ inputs.reviewers }}
|
||||
DEFAULT_REVIEWERS: ${{ vars.BACKGROUND_AGENT_REVIEWERS }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$DEFAULT_REVIEWERS" ]; then
|
||||
DEFAULT_REVIEWERS="eholk,morgankrey,osiewicz,bennetbo"
|
||||
fi
|
||||
REVIEWERS="${INPUT_REVIEWERS:-$DEFAULT_REVIEWERS}"
|
||||
REVIEWERS="$(echo "$REVIEWERS" | tr -d '[:space:]')"
|
||||
echo "reviewers=$REVIEWERS" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Select crash candidates
|
||||
id: candidates
|
||||
env:
|
||||
INPUT_CRASH_IDS: ${{ inputs.crash_ids }}
|
||||
INPUT_TOP: ${{ inputs.top }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_BACKGROUND_AGENT_MVP_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
PREFETCH_DIR="/tmp/crash-data"
|
||||
ARGS=(--select-only --prefetch-dir "$PREFETCH_DIR" --org "$SENTRY_ORG")
|
||||
if [ -n "$INPUT_CRASH_IDS" ]; then
|
||||
ARGS+=(--crash-ids "$INPUT_CRASH_IDS")
|
||||
else
|
||||
TARGET_DRAFT_PRS="${INPUT_TOP:-3}"
|
||||
if ! [[ "$TARGET_DRAFT_PRS" =~ ^[0-9]+$ ]] || [ "$TARGET_DRAFT_PRS" -lt 1 ]; then
|
||||
TARGET_DRAFT_PRS="3"
|
||||
fi
|
||||
CANDIDATE_TOP=$((TARGET_DRAFT_PRS * 5))
|
||||
if [ "$CANDIDATE_TOP" -gt 100 ]; then
|
||||
CANDIDATE_TOP=100
|
||||
fi
|
||||
ARGS+=(--top "$CANDIDATE_TOP" --sample-size 100)
|
||||
fi
|
||||
|
||||
IDS="$(python3 script/run-background-agent-mvp-local "${ARGS[@]}")"
|
||||
|
||||
if [ -z "$IDS" ]; then
|
||||
echo "No candidates selected"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using crash IDs: $IDS"
|
||||
echo "ids=$IDS" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Run background agent pipeline per crash
|
||||
id: pipeline
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REVIEWERS: ${{ steps.reviewers.outputs.reviewers }}
|
||||
CRASH_IDS: ${{ steps.candidates.outputs.ids }}
|
||||
TARGET_DRAFT_PRS_INPUT: ${{ inputs.top }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git config user.name "factory-droid[bot]"
|
||||
git config user.email "138933559+factory-droid[bot]@users.noreply.github.com"
|
||||
|
||||
# Crash ID format validation regex
|
||||
CRASH_ID_PATTERN='^[A-Za-z0-9]+-[A-Za-z0-9]+$'
|
||||
TARGET_DRAFT_PRS="${TARGET_DRAFT_PRS_INPUT:-3}"
|
||||
if ! [[ "$TARGET_DRAFT_PRS" =~ ^[0-9]+$ ]] || [ "$TARGET_DRAFT_PRS" -lt 1 ]; then
|
||||
TARGET_DRAFT_PRS="3"
|
||||
fi
|
||||
CREATED_DRAFT_PRS=0
|
||||
|
||||
IFS=',' read -r -a CRASH_ID_ARRAY <<< "$CRASH_IDS"
|
||||
|
||||
for CRASH_ID in "${CRASH_ID_ARRAY[@]}"; do
|
||||
if [ "$CREATED_DRAFT_PRS" -ge "$TARGET_DRAFT_PRS" ]; then
|
||||
echo "Reached target draft PR count ($TARGET_DRAFT_PRS), stopping candidate processing"
|
||||
break
|
||||
fi
|
||||
|
||||
CRASH_ID="$(echo "$CRASH_ID" | xargs)"
|
||||
[ -z "$CRASH_ID" ] && continue
|
||||
|
||||
# Validate crash ID format to prevent injection via branch names or prompts
|
||||
if ! [[ "$CRASH_ID" =~ $CRASH_ID_PATTERN ]]; then
|
||||
echo "ERROR: Invalid crash ID format: '$CRASH_ID' — skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
BRANCH="background-agent/mvp-${CRASH_ID,,}-$(date +%Y%m%d)"
|
||||
echo "Running crash pipeline for $CRASH_ID on $BRANCH"
|
||||
|
||||
# Deduplication: skip if a draft PR already exists for this crash
|
||||
EXISTING_BRANCH_PR="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number' || echo "")"
|
||||
if [ -n "$EXISTING_BRANCH_PR" ]; then
|
||||
echo "Draft PR #$EXISTING_BRANCH_PR already exists for $CRASH_ID — skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! git fetch origin main; then
|
||||
echo "WARNING: Failed to fetch origin/main for $CRASH_ID — skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! git checkout -B "$BRANCH" origin/main; then
|
||||
echo "WARNING: Failed to create checkout branch $BRANCH for $CRASH_ID — skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
CRASH_DATA_FILE="/tmp/crash-data/crash-${CRASH_ID}.md"
|
||||
if [ ! -f "$CRASH_DATA_FILE" ]; then
|
||||
echo "WARNING: No pre-fetched crash data for $CRASH_ID at $CRASH_DATA_FILE — skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
python3 -c "
|
||||
import sys
|
||||
crash_id, data_file = sys.argv[1], sys.argv[2]
|
||||
prompt = f'''You are running the weekly background crash-fix MVP pipeline for crash {crash_id}.
|
||||
|
||||
The crash report has been pre-fetched and is available at: {data_file}
|
||||
Read this file to get the crash data. Do not call script/sentry-fetch.
|
||||
|
||||
Required workflow:
|
||||
1. Read the crash report from {data_file}
|
||||
2. Read and follow .rules.
|
||||
3. Follow .factory/prompts/crash/investigate.md and write ANALYSIS.md
|
||||
4. Follow .factory/prompts/crash/link-issues.md and write LINKED_ISSUES.md
|
||||
5. Follow .factory/prompts/crash/fix.md to implement a minimal fix with tests
|
||||
6. Run validators required by the fix prompt for the affected code paths
|
||||
7. Write PR_BODY.md with sections:
|
||||
- Crash Summary
|
||||
- Root Cause
|
||||
- Fix
|
||||
- Validation
|
||||
- Potentially Related Issues (High/Medium/Low from LINKED_ISSUES.md)
|
||||
- Reviewer Checklist
|
||||
- Release Notes (final section; format as Release Notes:, then a blank line, then one bullet like - N/A)
|
||||
|
||||
Constraints:
|
||||
- Do not merge or auto-approve.
|
||||
- Keep changes narrowly scoped to this crash.
|
||||
- Do not modify files in .github/, .factory/, or script/ directories.
|
||||
- When investigating git history, limit your search to the last 2 weeks of commits. Do not traverse older history.
|
||||
- If the crash is not solvable with available context, write a clear blocker summary to PR_BODY.md.
|
||||
'''
|
||||
import textwrap
|
||||
with open('/tmp/background-agent-prompt.md', 'w') as f:
|
||||
f.write(textwrap.dedent(prompt))
|
||||
" "$CRASH_ID" "$CRASH_DATA_FILE"
|
||||
|
||||
if ! "$DROID_BIN" exec --auto medium -m "$DROID_MODEL" -f /tmp/background-agent-prompt.md; then
|
||||
echo "Droid execution failed for $CRASH_ID, continuing to next candidate"
|
||||
continue
|
||||
fi
|
||||
|
||||
for REPORT_FILE in ANALYSIS.md LINKED_ISSUES.md PR_BODY.md; do
|
||||
if [ -f "$REPORT_FILE" ]; then
|
||||
echo "::group::${CRASH_ID} ${REPORT_FILE}"
|
||||
cat "$REPORT_FILE"
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
done
|
||||
|
||||
if git diff --quiet; then
|
||||
echo "No code changes produced for $CRASH_ID"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Stage only expected file types — not git add -A
|
||||
git add -- '*.rs' '*.toml' 'Cargo.lock' 'ANALYSIS.md' 'LINKED_ISSUES.md' 'PR_BODY.md'
|
||||
|
||||
# Reject changes to protected paths
|
||||
PROTECTED_CHANGES="$(git diff --cached --name-only | grep -E '^(\.github/|\.factory/|script/)' || true)"
|
||||
if [ -n "$PROTECTED_CHANGES" ]; then
|
||||
echo "ERROR: Agent modified protected paths — aborting commit for $CRASH_ID:"
|
||||
echo "$PROTECTED_CHANGES"
|
||||
git reset HEAD -- .
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! git diff --cached --quiet; then
|
||||
git commit -m "Fix crash ${CRASH_ID}"
|
||||
fi
|
||||
|
||||
git push -u origin "$BRANCH"
|
||||
|
||||
CRATE_PREFIX=""
|
||||
CHANGED_CRATES="$(git diff --cached --name-only | awk -F/ '/^crates\/[^/]+\// {print $2}' | sort -u)"
|
||||
if [ -n "$CHANGED_CRATES" ] && [ "$(printf "%s\n" "$CHANGED_CRATES" | wc -l | tr -d ' ')" -eq 1 ]; then
|
||||
CRATE_PREFIX="${CHANGED_CRATES}: "
|
||||
fi
|
||||
|
||||
TITLE="${CRATE_PREFIX}Fix crash ${CRASH_ID}"
|
||||
BODY_FILE="PR_BODY.md"
|
||||
if [ ! -f "$BODY_FILE" ]; then
|
||||
BODY_FILE="/tmp/pr-body-${CRASH_ID}.md"
|
||||
printf "Automated draft crash-fix pipeline output for %s.\n\nNo PR_BODY.md was generated by the agent; please review commit and linked artifacts manually.\n" "$CRASH_ID" > "$BODY_FILE"
|
||||
fi
|
||||
|
||||
python3 -c '
|
||||
import re
|
||||
import sys
|
||||
|
||||
path = sys.argv[1]
|
||||
body = open(path, encoding="utf-8").read()
|
||||
pattern = re.compile(r"(^|\n)Release Notes:\r?\n(?:\r?\n)*(?P<bullets>(?:\s*-\s+.*(?:\r?\n|$))+)", re.MULTILINE)
|
||||
match = pattern.search(body)
|
||||
|
||||
if match:
|
||||
bullets = [
|
||||
re.sub(r"^\s*", "", bullet)
|
||||
for bullet in re.findall(r"^\s*-\s+.*$", match.group("bullets"), re.MULTILINE)
|
||||
]
|
||||
if not bullets:
|
||||
bullets = ["- N/A"]
|
||||
section = "Release Notes:\n\n" + "\n".join(bullets)
|
||||
body_without_release_notes = (body[: match.start()] + body[match.end() :]).rstrip()
|
||||
if body_without_release_notes:
|
||||
normalized_body = f"{body_without_release_notes}\n\n{section}\n"
|
||||
else:
|
||||
normalized_body = f"{section}\n"
|
||||
else:
|
||||
normalized_body = body.rstrip() + "\n\nRelease Notes:\n\n- N/A\n"
|
||||
|
||||
with open(path, "w", encoding="utf-8") as file:
|
||||
file.write(normalized_body)
|
||||
' "$BODY_FILE"
|
||||
|
||||
EXISTING_PR="$(gh pr list --head "$BRANCH" --json number --jq '.[0].number')"
|
||||
if [ -n "$EXISTING_PR" ]; then
|
||||
gh pr edit "$EXISTING_PR" --title "$TITLE" --body-file "$BODY_FILE"
|
||||
PR_NUMBER="$EXISTING_PR"
|
||||
else
|
||||
PR_URL="$(gh pr create --draft --base main --head "$BRANCH" --title "$TITLE" --body-file "$BODY_FILE")"
|
||||
PR_NUMBER="$(basename "$PR_URL")"
|
||||
fi
|
||||
|
||||
if [ -n "$REVIEWERS" ]; then
|
||||
IFS=',' read -r -a REVIEWER_ARRAY <<< "$REVIEWERS"
|
||||
for REVIEWER in "${REVIEWER_ARRAY[@]}"; do
|
||||
[ -z "$REVIEWER" ] && continue
|
||||
gh pr edit "$PR_NUMBER" --add-reviewer "$REVIEWER" || true
|
||||
done
|
||||
fi
|
||||
|
||||
CREATED_DRAFT_PRS=$((CREATED_DRAFT_PRS + 1))
|
||||
echo "Created/updated draft PRs this run: $CREATED_DRAFT_PRS/$TARGET_DRAFT_PRS"
|
||||
done
|
||||
|
||||
echo "created_draft_prs=$CREATED_DRAFT_PRS" >> "$GITHUB_OUTPUT"
|
||||
echo "target_draft_prs=$TARGET_DRAFT_PRS" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cleanup pre-fetched crash data
|
||||
if: always()
|
||||
run: rm -rf /tmp/crash-data
|
||||
|
||||
- name: Workflow summary
|
||||
if: always()
|
||||
env:
|
||||
SUMMARY_CRASH_IDS: ${{ steps.candidates.outputs.ids }}
|
||||
SUMMARY_REVIEWERS: ${{ steps.reviewers.outputs.reviewers }}
|
||||
SUMMARY_CREATED_DRAFT_PRS: ${{ steps.pipeline.outputs.created_draft_prs }}
|
||||
SUMMARY_TARGET_DRAFT_PRS: ${{ steps.pipeline.outputs.target_draft_prs }}
|
||||
run: |
|
||||
{
|
||||
echo "## Background Agent MVP"
|
||||
echo ""
|
||||
echo "- Crash IDs: ${SUMMARY_CRASH_IDS:-none}"
|
||||
echo "- Reviewer routing: ${SUMMARY_REVIEWERS:-NOT CONFIGURED}"
|
||||
echo "- Draft PRs created: ${SUMMARY_CREATED_DRAFT_PRS:-0}/${SUMMARY_TARGET_DRAFT_PRS:-3}"
|
||||
echo "- Pipeline: investigate -> link-issues -> fix -> draft PR"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
concurrency:
|
||||
group: background-agent-mvp
|
||||
cancel-in-progress: false
|
||||
23
.github/workflows/bump_collab_staging.yml
vendored
Normal file
23
.github/workflows/bump_collab_staging.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Bump collab-staging Tag
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Fire every day at 16:00 UTC (At the start of the US workday)
|
||||
- cron: "0 16 * * *"
|
||||
|
||||
jobs:
|
||||
update-collab-staging-tag:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update collab-staging tag
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git tag -f collab-staging
|
||||
git push origin collab-staging --force
|
||||
86
.github/workflows/bump_patch_version.yml
vendored
Normal file
86
.github/workflows/bump_patch_version.yml
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
# Generated from xtask::workflows::bump_patch_version
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: bump_patch_version
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: Branch name to run on
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
run_bump_patch_version:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: ${{ inputs.branch }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: channel
|
||||
name: bump_patch_version::run_bump_patch_version::read_channel
|
||||
run: |
|
||||
channel="$(cat crates/zed/RELEASE_CHANNEL)"
|
||||
|
||||
tag_suffix=""
|
||||
case $channel in
|
||||
stable)
|
||||
;;
|
||||
preview)
|
||||
tag_suffix="-pre"
|
||||
;;
|
||||
*)
|
||||
echo "::error::must be run on a stable or preview release branch"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
version=$(script/get-crate-version zed)
|
||||
|
||||
{
|
||||
echo "channel=$channel"
|
||||
echo "version=$version"
|
||||
echo "tag_suffix=$tag_suffix"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
- name: steps::install_cargo_edit
|
||||
uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507
|
||||
with:
|
||||
tool: cargo-edit
|
||||
- id: bump-version
|
||||
name: bump_patch_version::run_bump_patch_version::bump_version
|
||||
run: |
|
||||
version="$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //')"
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
- id: commit
|
||||
name: steps::bot_commit
|
||||
uses: IAreKyleW00t/verified-bot-commit@126a6a11889ab05bcff72ec2403c326cd249b84c
|
||||
with:
|
||||
message: Bump to ${{ steps.bump-version.outputs.version }} for @${{ github.actor }}
|
||||
ref: refs/heads/${{ inputs.branch }}
|
||||
files: '**'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: steps::create_tag
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/v${{ steps.bump-version.outputs.version }}${{ steps.channel.outputs.tag_suffix }}',
|
||||
sha: '${{ steps.commit.outputs.commit }}'
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ inputs.branch }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
226
.github/workflows/bump_zed_version.yml
vendored
Normal file
226
.github/workflows/bump_zed_version.yml
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
# Generated from xtask::workflows::bump_zed_version
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: bump_zed_version
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target:
|
||||
description: 'Which channels to bump: all, main, preview, or stable'
|
||||
type: string
|
||||
default: all
|
||||
jobs:
|
||||
resolve_versions:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: main
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: versions
|
||||
name: bump_zed_version::resolve_versions::extract_versions
|
||||
run: |
|
||||
version=$(script/get-crate-version zed)
|
||||
major=$(echo "$version" | cut -d. -f1)
|
||||
minor=$(echo "$version" | cut -d. -f2)
|
||||
|
||||
channel=$(cat crates/zed/RELEASE_CHANNEL)
|
||||
if [[ "$channel" != "dev" && "$channel" != "nightly" ]]; then
|
||||
echo "::error::release channel on main should be dev or nightly, found: $channel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Next main version after bump
|
||||
next_version="${major}.$((minor + 1)).0"
|
||||
next_major=$(echo "$next_version" | cut -d. -f1)
|
||||
next_minor=$(echo "$next_version" | cut -d. -f2)
|
||||
pr_branch="bump-zed-to-v${next_major}.${next_minor}.0"
|
||||
|
||||
# New preview branch from current main
|
||||
preview_branch="v${major}.${minor}.x"
|
||||
preview_tag="v${version}-pre"
|
||||
|
||||
# Current preview to promote to stable — derive branch from released preview version
|
||||
released_preview=$(script/get-released-version preview)
|
||||
if [[ -z "$released_preview" ]]; then
|
||||
echo "::error::could not determine released preview version"
|
||||
exit 1
|
||||
fi
|
||||
stable_major=$(echo "$released_preview" | cut -d. -f1)
|
||||
stable_minor=$(echo "$released_preview" | cut -d. -f2)
|
||||
stable_branch="v${stable_major}.${stable_minor}.x"
|
||||
|
||||
# Final validation
|
||||
for var in next_version pr_branch preview_branch preview_tag stable_branch; do
|
||||
if [[ -z "${!var}" ]]; then
|
||||
echo "::error::failed to compute $var"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
{
|
||||
echo "next_version=$next_version"
|
||||
echo "pr_branch=$pr_branch"
|
||||
echo "preview_branch=$preview_branch"
|
||||
echo "preview_tag=$preview_tag"
|
||||
echo "stable_branch=$stable_branch"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "Resolved: next=$next_version preview=$preview_branch($preview_tag) stable=$stable_branch pr=$pr_branch"
|
||||
outputs:
|
||||
next_version: ${{ steps.versions.outputs.next_version }}
|
||||
pr_branch: ${{ steps.versions.outputs.pr_branch }}
|
||||
preview_branch: ${{ steps.versions.outputs.preview_branch }}
|
||||
preview_tag: ${{ steps.versions.outputs.preview_tag }}
|
||||
stable_branch: ${{ steps.versions.outputs.stable_branch }}
|
||||
bump_main:
|
||||
needs:
|
||||
- resolve_versions
|
||||
if: inputs.target == 'all' || inputs.target == 'main'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: main
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: steps::install_cargo_edit
|
||||
uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507
|
||||
with:
|
||||
tool: cargo-edit
|
||||
- name: bump_zed_version::bump_main::bump_version
|
||||
run: cargo set-version -p zed --bump minor
|
||||
- name: steps::create_pull_request
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: Bump Zed to v${{ needs.resolve_versions.outputs.next_version }}
|
||||
body: |-
|
||||
Release Notes:
|
||||
|
||||
- N/A
|
||||
commit-message: Bump Zed to v${{ needs.resolve_versions.outputs.next_version }}
|
||||
branch: ${{ needs.resolve_versions.outputs.pr_branch }}
|
||||
committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
base: main
|
||||
delete-branch: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
sign-commits: true
|
||||
assignees: ${{ github.actor }}
|
||||
create_preview_branch:
|
||||
needs:
|
||||
- resolve_versions
|
||||
if: inputs.target == 'all' || inputs.target == 'preview'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: main
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: main-sha
|
||||
name: bump_zed_version::create_preview_branch::get_main_sha
|
||||
run: echo "main_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||
- name: bump_zed_version::create_preview_branch::promote_to_preview
|
||||
run: echo -n preview > crates/zed/RELEASE_CHANNEL
|
||||
- name: steps::create_branch
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/heads/${{ needs.resolve_versions.outputs.preview_branch }}',
|
||||
sha: '${{ steps.main-sha.outputs.main_sha }}'
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: commit
|
||||
name: steps::bot_commit
|
||||
uses: IAreKyleW00t/verified-bot-commit@126a6a11889ab05bcff72ec2403c326cd249b84c
|
||||
with:
|
||||
message: ${{ needs.resolve_versions.outputs.preview_branch }} preview for @${{ github.actor }}
|
||||
ref: refs/heads/${{ needs.resolve_versions.outputs.preview_branch }}
|
||||
files: crates/zed/RELEASE_CHANNEL
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: steps::create_tag
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/${{ needs.resolve_versions.outputs.preview_tag }}',
|
||||
sha: '${{ steps.commit.outputs.commit }}'
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
promote_to_stable:
|
||||
needs:
|
||||
- resolve_versions
|
||||
if: inputs.target == 'all' || inputs.target == 'stable'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: ${{ needs.resolve_versions.outputs.stable_branch }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: stable-info
|
||||
name: bump_zed_version::promote_to_stable
|
||||
run: |
|
||||
stable_version=$(script/get-crate-version zed)
|
||||
{
|
||||
echo "stable_tag=v${stable_version}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
- name: bump_zed_version::promote_to_stable
|
||||
run: echo -n stable > crates/zed/RELEASE_CHANNEL
|
||||
- id: commit
|
||||
name: steps::bot_commit
|
||||
uses: IAreKyleW00t/verified-bot-commit@126a6a11889ab05bcff72ec2403c326cd249b84c
|
||||
with:
|
||||
message: ${{ needs.resolve_versions.outputs.stable_branch }} stable for @${{ github.actor }}
|
||||
ref: refs/heads/${{ needs.resolve_versions.outputs.stable_branch }}
|
||||
files: crates/zed/RELEASE_CHANNEL
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: steps::create_tag
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/${{ steps.stable-info.outputs.stable_tag }}',
|
||||
sha: '${{ steps.commit.outputs.commit }}'
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
73
.github/workflows/catch_blank_issues.yml
vendored
Normal file
73
.github/workflows/catch_blank_issues.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: "Label new and reopened blank issues for triage"
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
add-triage-label:
|
||||
if: github.repository == 'zed-industries/zed'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- id: check-staff
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||
script: |
|
||||
try {
|
||||
const response = await github.rest.teams.getMembershipForUserInOrg({
|
||||
org: 'zed-industries',
|
||||
team_slug: 'staff',
|
||||
username: context.payload.sender.login
|
||||
});
|
||||
return response.data.state === 'active';
|
||||
} catch (error) {
|
||||
if (error.status === 404) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
- if: steps.check-staff.outputs.result == 'true'
|
||||
env:
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo "::notice::Skipping issue #$ISSUE_NUMBER - actor is staff member"
|
||||
|
||||
- if: steps.check-staff.outputs.result == 'false'
|
||||
id: add-label
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||
script: |
|
||||
const issue = context.payload.issue;
|
||||
const hasTriageLabel = issue.labels.some(
|
||||
label => label.name === 'state:needs triage'
|
||||
);
|
||||
|
||||
if (hasTriageLabel) {
|
||||
console.log('Issue already has state:needs triage, skipping');
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: ['state:needs triage']
|
||||
});
|
||||
|
||||
console.log(`Added state:needs triage to issue #${issue.number}`);
|
||||
54
.github/workflows/cherry_pick.yml
vendored
Normal file
54
.github/workflows/cherry_pick.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# Generated from xtask::workflows::cherry_pick
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: cherry_pick
|
||||
run-name: 'cherry_pick to ${{ inputs.channel }} #${{ inputs.pr_number }}'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit:
|
||||
description: commit
|
||||
required: true
|
||||
type: string
|
||||
branch:
|
||||
description: branch
|
||||
required: true
|
||||
type: string
|
||||
channel:
|
||||
description: channel
|
||||
required: true
|
||||
type: string
|
||||
pr_number:
|
||||
description: pr_number
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
run_cherry_pick:
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- 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
|
||||
permission-workflows: write
|
||||
permission-pull-requests: write
|
||||
- name: cherry_pick::run_cherry_pick::cherry_pick
|
||||
run: ./script/cherry-pick "$BRANCH" "$COMMIT" "$CHANNEL"
|
||||
env:
|
||||
BRANCH: ${{ inputs.branch }}
|
||||
COMMIT: ${{ inputs.commit }}
|
||||
CHANNEL: ${{ inputs.channel }}
|
||||
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.com>
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
70
.github/workflows/comment_on_potential_duplicate_issues.yml
vendored
Normal file
70
.github/workflows/comment_on_potential_duplicate_issues.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Comment on potential duplicate bug/crash reports
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: "Issue number to analyze"
|
||||
required: true
|
||||
type: number
|
||||
|
||||
concurrency:
|
||||
group: potential-duplicate-check-${{ github.event.issue.number || inputs.issue_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
identify-duplicates:
|
||||
# For manual testing, allow running on any branch; for automatic runs, only on main repo
|
||||
if: github.event_name == 'workflow_dispatch' || github.repository == 'zed-industries/zed'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: script/github-check-new-issue-for-duplicates.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Get github app token
|
||||
id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Run duplicate detection
|
||||
id: detect
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_ISSUE_DEDUP }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number || inputs.issue_number }}
|
||||
run: |
|
||||
python script/github-check-new-issue-for-duplicates.py "$ISSUE_NUMBER" > result.json
|
||||
cat result.json
|
||||
|
||||
- name: Write job summary
|
||||
if: always()
|
||||
run: |
|
||||
echo '```json' >> "$GITHUB_STEP_SUMMARY"
|
||||
if [[ -f result.json ]] && jq empty result.json 2>/dev/null; then
|
||||
jq . result.json >> "$GITHUB_STEP_SUMMARY"
|
||||
else
|
||||
echo '{"error": "No valid result.json generated. Check logs for details."}' >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
echo '```' >> "$GITHUB_STEP_SUMMARY"
|
||||
113
.github/workflows/community_champion_auto_labeler.yml
vendored
Normal file
113
.github/workflows/community_champion_auto_labeler.yml
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
name: Community Champion Auto Labeler
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
label_community_champion:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: Check if author is a community champion and apply label
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
|
||||
env:
|
||||
COMMUNITY_CHAMPIONS: |
|
||||
0x2CA
|
||||
5brian
|
||||
5herlocked
|
||||
abdelq
|
||||
afgomez
|
||||
AidanV
|
||||
akbxr
|
||||
AlvaroParker
|
||||
amtoaer
|
||||
artemevsevev
|
||||
bajrangCoder
|
||||
bcomnes
|
||||
Be-ing
|
||||
blopker
|
||||
bnjjj
|
||||
bobbymannino
|
||||
CharlesChen0823
|
||||
chbk
|
||||
davewa
|
||||
davidbarsky
|
||||
ddoemonn
|
||||
djsauble
|
||||
errmayank
|
||||
fantacell
|
||||
fdncred
|
||||
findrakecil
|
||||
FloppyDisco
|
||||
gko
|
||||
huacnlee
|
||||
imumesh18
|
||||
injust
|
||||
jacobtread
|
||||
jansol
|
||||
jeffreyguenther
|
||||
jenslys
|
||||
jongretar
|
||||
lemorage
|
||||
lingyaochu
|
||||
lnay
|
||||
marcocondrache
|
||||
marius851000
|
||||
mikebronner
|
||||
ognevny
|
||||
PKief
|
||||
playdohface
|
||||
RemcoSmitsDev
|
||||
rgbkrk
|
||||
romaninsh
|
||||
rxptr
|
||||
Simek
|
||||
someone13574
|
||||
sourcefrog
|
||||
suxiaoshao
|
||||
Takk8IS
|
||||
tartarughina
|
||||
thedadams
|
||||
tidely
|
||||
timvermeulen
|
||||
valentinegb
|
||||
versecafe
|
||||
vitallium
|
||||
WhySoBad
|
||||
ya7010
|
||||
Zertsov
|
||||
with:
|
||||
script: |
|
||||
const communityChampions = process.env.COMMUNITY_CHAMPIONS
|
||||
.split('\n')
|
||||
.map(handle => handle.trim().toLowerCase())
|
||||
.filter(handle => handle.length > 0);
|
||||
|
||||
let author;
|
||||
if (context.eventName === 'issues') {
|
||||
author = context.payload.issue.user.login;
|
||||
} else if (context.eventName === 'pull_request_target') {
|
||||
author = context.payload.pull_request.user.login;
|
||||
}
|
||||
|
||||
if (!author || !communityChampions.includes(author.toLowerCase())) {
|
||||
return;
|
||||
}
|
||||
|
||||
const issueNumber = context.payload.issue?.number || context.payload.pull_request?.number;
|
||||
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
labels: ['community champion']
|
||||
});
|
||||
|
||||
console.log(`Applied 'community champion' label to #${issueNumber} by ${author}`);
|
||||
} catch (error) {
|
||||
console.error(`Failed to apply label: ${error.message}`);
|
||||
}
|
||||
40
.github/workflows/community_close_stale_issues.yml
vendored
Normal file
40
.github/workflows/community_close_stale_issues.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: "Close Stale Issues"
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 2 * * 5"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
debug-only:
|
||||
description: "Run in dry-run mode (no changes made)"
|
||||
type: boolean
|
||||
default: false
|
||||
operations-per-run:
|
||||
description: "Max number of issues to process (default: 1000)"
|
||||
type: number
|
||||
default: 1000
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: >
|
||||
Zed development moves fast and a significant number of bugs become outdated.
|
||||
If you can reproduce this bug on the latest stable Zed, please let us know by leaving a comment with the Zed version,
|
||||
it helps us focus on the right issues.
|
||||
If the bug doesn't appear for you anymore, feel free to close the issue yourself; otherwise, the bot will close it in a couple of weeks.
|
||||
But even after it's closed by the bot, you can leave a comment with the version where the bug is reproducible and we'll reopen the issue.
|
||||
Thanks!
|
||||
close-issue-message: "This issue was closed due to inactivity. If you're still experiencing this problem, please leave a comment with your Zed version so that we can reopen the issue."
|
||||
days-before-stale: 90
|
||||
days-before-close: 21
|
||||
only-issue-types: "Bug,Crash"
|
||||
operations-per-run: ${{ inputs.operations-per-run || 2000 }}
|
||||
ascending: true
|
||||
enable-statistics: true
|
||||
debug-only: ${{ inputs.debug-only }}
|
||||
stale-issue-label: "stale"
|
||||
exempt-issue-labels: "never stale"
|
||||
75
.github/workflows/community_pr_board.yml
vendored
Normal file
75
.github/workflows/community_pr_board.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# Community PR Board — route labeled community PRs to a GitHub Project board
|
||||
#
|
||||
# When an area/platform label is added to a community PR (not staff, not bot),
|
||||
# the PR is added to the project board with a Track field set to the matching
|
||||
# review area group. Status transitions for assignment, re-request, and
|
||||
# comment events are handled here. Review-based status changes (approved →
|
||||
# "In Progress (us)", changes requested → "In Progress (author)") are handled
|
||||
# by built-in board automations.
|
||||
#
|
||||
# See script/community-pr-track-mapping.json for the label→track mapping.
|
||||
|
||||
name: Community PR Board
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled, unlabeled, assigned, review_requested]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
description: "PR number to process (re-resolves track from current labels)"
|
||||
required: true
|
||||
type: number
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: community-pr-board-${{ github.event.pull_request.number || github.event.issue.number || inputs.pr_number }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
route-pr:
|
||||
if: >-
|
||||
github.repository == 'zed-industries/zed' &&
|
||||
(github.event_name != 'issue_comment' ||
|
||||
(github.event.issue.pull_request &&
|
||||
github.event.comment.user.login == github.event.issue.user.login)) &&
|
||||
!contains(toJSON(github.event.pull_request.labels.*.name), 'staff') &&
|
||||
!contains(toJSON(github.event.pull_request.labels.*.name), 'bot')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: |
|
||||
script/github-community-pr-board.py
|
||||
script/community-pr-track-mapping.json
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Route PR to board
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
PROJECT_NUMBER: "85"
|
||||
MANUAL_PR_NUMBER: ${{ inputs.pr_number }}
|
||||
run: python script/github-community-pr-board.py
|
||||
27
.github/workflows/community_update_all_top_ranking_issues.yml
vendored
Normal file
27
.github/workflows/community_update_all_top_ranking_issues.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Update All Top Ranking Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 */12 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_top_ranking_issues:
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
if: github.repository == 'zed-industries/zed'
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
||||
with:
|
||||
version: "latest"
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "script/update_top_ranking_issues/pyproject.toml"
|
||||
- name: Install Python 3.13
|
||||
run: uv python install 3.13
|
||||
- name: Install dependencies
|
||||
run: uv sync --project script/update_top_ranking_issues -p 3.13
|
||||
- name: Run script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: uv run --project script/update_top_ranking_issues script/update_top_ranking_issues/main.py --github-token "$GITHUB_TOKEN" --issue-reference-number 5393
|
||||
27
.github/workflows/community_update_weekly_top_ranking_issues.yml
vendored
Normal file
27
.github/workflows/community_update_weekly_top_ranking_issues.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Update Weekly Top Ranking Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 15 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_top_ranking_issues:
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
if: github.repository == 'zed-industries/zed'
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
||||
with:
|
||||
version: "latest"
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "script/update_top_ranking_issues/pyproject.toml"
|
||||
- name: Install Python 3.13
|
||||
run: uv python install 3.13
|
||||
- name: Install dependencies
|
||||
run: uv sync --project script/update_top_ranking_issues -p 3.13
|
||||
- name: Run script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: uv run --project script/update_top_ranking_issues script/update_top_ranking_issues/main.py --github-token "$GITHUB_TOKEN" --issue-reference-number 6952 --query-day-interval 7
|
||||
84
.github/workflows/compare_perf.yml
vendored
Normal file
84
.github/workflows/compare_perf.yml
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
# Generated from xtask::workflows::compare_perf
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: compare_perf
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
head:
|
||||
description: head
|
||||
required: true
|
||||
type: string
|
||||
base:
|
||||
description: base
|
||||
required: true
|
||||
type: string
|
||||
crate_name:
|
||||
description: crate_name
|
||||
type: string
|
||||
default: ''
|
||||
jobs:
|
||||
run_perf:
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
mkdir -p ./../.cargo
|
||||
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: compare_perf::run_perf::install_hyperfine
|
||||
uses: taiki-e/install-action@b4f2d5cb8597b15997c8ede873eb6185efc5f0ad
|
||||
- name: steps::git_checkout
|
||||
run: git fetch origin "$REF_NAME" && git checkout "$REF_NAME"
|
||||
env:
|
||||
REF_NAME: ${{ inputs.base }}
|
||||
- name: compare_perf::run_perf::cargo_perf_test
|
||||
run: |2-
|
||||
|
||||
if [ -n "$CRATE_NAME" ]; then
|
||||
cargo perf-test -p "$CRATE_NAME" -- --json="$REF_NAME";
|
||||
else
|
||||
cargo perf-test -p vim -- --json="$REF_NAME";
|
||||
fi
|
||||
env:
|
||||
REF_NAME: ${{ inputs.base }}
|
||||
CRATE_NAME: ${{ inputs.crate_name }}
|
||||
- name: steps::git_checkout
|
||||
run: git fetch origin "$REF_NAME" && git checkout "$REF_NAME"
|
||||
env:
|
||||
REF_NAME: ${{ inputs.head }}
|
||||
- name: compare_perf::run_perf::cargo_perf_test
|
||||
run: |2-
|
||||
|
||||
if [ -n "$CRATE_NAME" ]; then
|
||||
cargo perf-test -p "$CRATE_NAME" -- --json="$REF_NAME";
|
||||
else
|
||||
cargo perf-test -p vim -- --json="$REF_NAME";
|
||||
fi
|
||||
env:
|
||||
REF_NAME: ${{ inputs.head }}
|
||||
CRATE_NAME: ${{ inputs.crate_name }}
|
||||
- name: compare_perf::run_perf::compare_runs
|
||||
run: cargo perf-compare --save=results.md "$BASE" "$HEAD"
|
||||
env:
|
||||
BASE: ${{ inputs.base }}
|
||||
HEAD: ${{ inputs.head }}
|
||||
- name: '@actions/upload-artifact results.md'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: results.md
|
||||
path: results.md
|
||||
if-no-files-found: error
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
73
.github/workflows/compliance_check.yml
vendored
Normal file
73
.github/workflows/compliance_check.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Generated from xtask::workflows::compliance_check
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: compliance_check
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
on:
|
||||
schedule:
|
||||
- cron: 30 17 * * 2
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
scheduled_compliance_check:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- id: determine-version
|
||||
name: compliance_check::scheduled_compliance_check
|
||||
run: |
|
||||
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' crates/zed/Cargo.toml | tr -d '[:space:]')
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Could not determine version from crates/zed/Cargo.toml"
|
||||
exit 1
|
||||
fi
|
||||
TAG="v${VERSION}-pre"
|
||||
echo "Checking compliance for $TAG"
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
- id: run-compliance-check
|
||||
name: release::add_compliance_steps::run_compliance_check
|
||||
run: |
|
||||
cargo xtask compliance version "$LATEST_TAG" --branch main --report-path "compliance-report-${GITHUB_REF_NAME}.md"
|
||||
env:
|
||||
GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
LATEST_TAG: ${{ steps.determine-version.outputs.tag }}
|
||||
continue-on-error: true
|
||||
- name: '@actions/upload-artifact compliance-report-${{ github.ref_name }}.md'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: compliance-report-${{ github.ref_name }}.md
|
||||
path: compliance-report-${{ github.ref_name }}.md
|
||||
if-no-files-found: error
|
||||
- name: send_compliance_slack_notification
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
|
||||
STATUS="✅ Scheduled compliance check passed for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s" "$STATUS" "$ARTIFACT_URL")
|
||||
else
|
||||
STATUS="⚠️ Scheduled compliance check failed for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22")
|
||||
fi
|
||||
|
||||
curl -X POST -H 'Content-type: application/json' \
|
||||
--data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
|
||||
"$SLACK_WEBHOOK"
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
|
||||
COMPLIANCE_TAG: ${{ steps.determine-version.outputs.tag }}
|
||||
ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
64
.github/workflows/congrats.yml
vendored
Normal file
64
.github/workflows/congrats.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: Congratsbot
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
check-author:
|
||||
if: ${{ github.repository_owner == 'zed-industries' }}
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
outputs:
|
||||
should_congratulate: ${{ steps.check.outputs.should_congratulate }}
|
||||
steps:
|
||||
- name: Get PR info and check if author is external
|
||||
id: check
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
|
||||
with:
|
||||
github-token: ${{ secrets.CONGRATSBOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
commit_sha: context.sha
|
||||
});
|
||||
|
||||
if (prs.length === 0) {
|
||||
core.setOutput('should_congratulate', 'false');
|
||||
return;
|
||||
}
|
||||
|
||||
const mergedPR = prs.find(pr => pr.merged_at !== null) || prs[0];
|
||||
|
||||
if (mergedPR.user.type === "Bot") {
|
||||
// They are a good bot, but not good enough to be congratulated
|
||||
core.setOutput('should_congratulate', 'false');
|
||||
return;
|
||||
}
|
||||
|
||||
const prAuthor = mergedPR.user.login;
|
||||
|
||||
try {
|
||||
await github.rest.teams.getMembershipForUserInOrg({
|
||||
org: 'zed-industries',
|
||||
team_slug: 'staff',
|
||||
username: prAuthor
|
||||
});
|
||||
core.setOutput('should_congratulate', 'false');
|
||||
} catch (error) {
|
||||
if (error.status === 404) {
|
||||
core.setOutput('should_congratulate', 'true');
|
||||
} else {
|
||||
console.error(`Error checking team membership: ${error.message}`);
|
||||
core.setOutput('should_congratulate', 'false');
|
||||
}
|
||||
}
|
||||
|
||||
congrats:
|
||||
needs: check-author
|
||||
if: needs.check-author.outputs.should_congratulate == 'true'
|
||||
uses: withastro/automation/.github/workflows/congratsbot.yml@a5bd0c5748c4d56e687cdd558064f9ee8adfb1f2 # main
|
||||
with:
|
||||
EMOJIS: 🎉,🎊,🧑🚀,🥳,🙌,🚀,🦀,🔥,🚢
|
||||
secrets:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
||||
41
.github/workflows/danger.yml
vendored
Normal file
41
.github/workflows/danger.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# Generated from xtask::workflows::danger
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: danger
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- edited
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
danger:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_pnpm
|
||||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
|
||||
with:
|
||||
version: '9'
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: pnpm
|
||||
cache-dependency-path: script/danger/pnpm-lock.yaml
|
||||
- name: danger::danger_job::install_deps
|
||||
run: pnpm install --dir script/danger
|
||||
- name: danger::danger_job::run
|
||||
run: pnpm run --dir script/danger danger ci
|
||||
env:
|
||||
GITHUB_TOKEN: not_a_real_token
|
||||
DANGER_GITHUB_API_BASE_URL: https://danger-proxy.zed.dev/github
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
167
.github/workflows/deploy_collab.yml
vendored
Normal file
167
.github/workflows/deploy_collab.yml
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
# Generated from xtask::workflows::deploy_collab
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: deploy_collab
|
||||
env:
|
||||
DOCKER_BUILDKIT: '1'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- collab-production
|
||||
jobs:
|
||||
style:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
name: Check formatting and Clippy lints
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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::cargo_fmt
|
||||
run: cargo fmt --all -- --check
|
||||
- name: steps::clippy
|
||||
run: ./script/clippy
|
||||
tests:
|
||||
needs:
|
||||
- style
|
||||
name: Run tests
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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::cargo_install_nextest
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: deploy_collab::tests::run_collab_tests
|
||||
run: cargo nextest run --package collab --no-fail-fast
|
||||
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 10
|
||||
publish:
|
||||
needs:
|
||||
- style
|
||||
- tests
|
||||
name: Publish collab server image
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: deploy_collab::publish::install_doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
||||
- name: deploy_collab::publish::sign_into_registry
|
||||
run: doctl registry login
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: deploy_collab::publish::build_docker_image
|
||||
run: |
|
||||
docker build -f Dockerfile-collab \
|
||||
--build-arg "GITHUB_SHA=$GITHUB_SHA" \
|
||||
--tag "registry.digitalocean.com/zed/collab:$GITHUB_SHA" \
|
||||
.
|
||||
- name: deploy_collab::publish::publish_docker_image
|
||||
run: docker push "registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
|
||||
- name: deploy_collab::publish::prune_docker_system
|
||||
run: docker system prune --filter 'until=72h' -f
|
||||
deploy:
|
||||
needs:
|
||||
- publish
|
||||
name: Deploy new server image
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: deploy_collab::deploy::install_doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
||||
- name: deploy_collab::deploy::sign_into_kubernetes
|
||||
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 "$CLUSTER_NAME"
|
||||
env:
|
||||
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
|
||||
- name: deploy_collab::deploy::start_rollout
|
||||
run: |
|
||||
set -eu
|
||||
if [[ $GITHUB_REF_NAME = "collab-production" ]]; then
|
||||
export ZED_KUBE_NAMESPACE=production
|
||||
export ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT=10
|
||||
export ZED_API_LOAD_BALANCER_SIZE_UNIT=2
|
||||
elif [[ $GITHUB_REF_NAME = "collab-staging" ]]; then
|
||||
export ZED_KUBE_NAMESPACE=staging
|
||||
export ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT=1
|
||||
export ZED_API_LOAD_BALANCER_SIZE_UNIT=1
|
||||
else
|
||||
echo "cowardly refusing to deploy from an unknown branch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Deploying collab:$GITHUB_SHA to $ZED_KUBE_NAMESPACE"
|
||||
|
||||
source script/lib/deploy-helpers.sh
|
||||
export_vars_for_environment "$ZED_KUBE_NAMESPACE"
|
||||
|
||||
ZED_DO_CERTIFICATE_ID="$(doctl compute certificate list --format ID --no-header)"
|
||||
export ZED_DO_CERTIFICATE_ID
|
||||
export ZED_IMAGE_ID="registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
|
||||
|
||||
export ZED_SERVICE_NAME=collab
|
||||
export ZED_LOAD_BALANCER_SIZE_UNIT=$ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT
|
||||
export DATABASE_MAX_CONNECTIONS=850
|
||||
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
|
||||
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status "deployment/$ZED_SERVICE_NAME" --watch
|
||||
echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
|
||||
|
||||
export ZED_SERVICE_NAME=api
|
||||
export ZED_LOAD_BALANCER_SIZE_UNIT=$ZED_API_LOAD_BALANCER_SIZE_UNIT
|
||||
export DATABASE_MAX_CONNECTIONS=60
|
||||
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
|
||||
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status "deployment/$ZED_SERVICE_NAME" --watch
|
||||
echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
153
.github/workflows/deploy_docs.yml
vendored
Normal file
153
.github/workflows/deploy_docs.yml
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
# Generated from xtask::workflows::deploy_docs
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: deploy_docs
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
channel:
|
||||
description: channel
|
||||
type: string
|
||||
default: ''
|
||||
checkout_ref:
|
||||
description: checkout_ref
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
DOCS_AMPLITUDE_API_KEY:
|
||||
description: DOCS_AMPLITUDE_API_KEY
|
||||
required: true
|
||||
CLOUDFLARE_API_TOKEN:
|
||||
description: CLOUDFLARE_API_TOKEN
|
||||
required: true
|
||||
CLOUDFLARE_ACCOUNT_ID:
|
||||
description: CLOUDFLARE_ACCOUNT_ID
|
||||
required: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
channel:
|
||||
description: 'Docs channel to deploy: nightly, preview, or stable'
|
||||
type: string
|
||||
default: ''
|
||||
checkout_ref:
|
||||
description: Git ref to checkout and deploy. Defaults to event SHA when omitted.
|
||||
type: string
|
||||
default: ''
|
||||
jobs:
|
||||
deploy_docs:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
name: Build and Deploy Docs
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- id: resolve-channel
|
||||
name: deploy_docs::resolve_channel_step
|
||||
run: |
|
||||
if [ -z "$CHANNEL" ]; then
|
||||
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
||||
CHANNEL="nightly"
|
||||
else
|
||||
echo "::error::channel input is required when ref is not main."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$CHANNEL" in
|
||||
"nightly")
|
||||
SITE_URL="/docs/nightly/"
|
||||
PROJECT_NAME="docs-nightly"
|
||||
;;
|
||||
"preview")
|
||||
SITE_URL="/docs/preview/"
|
||||
PROJECT_NAME="docs-preview"
|
||||
;;
|
||||
"stable")
|
||||
SITE_URL="/docs/"
|
||||
PROJECT_NAME="docs"
|
||||
;;
|
||||
*)
|
||||
echo "::error::Invalid docs channel '$CHANNEL'. Expected one of: nightly, preview, stable."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
{
|
||||
echo "channel=$CHANNEL"
|
||||
echo "site_url=$SITE_URL"
|
||||
echo "project_name=$PROJECT_NAME"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
CHANNEL: ${{ inputs.channel }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: ${{ inputs.checkout_ref != '' && inputs.checkout_ref || github.sha }}
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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: ./script/generate-action-metadata
|
||||
run: ./script/generate-action-metadata
|
||||
- name: deploy_docs::lychee_link_check
|
||||
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
|
||||
with:
|
||||
args: --no-progress --exclude '^http' './docs/src/**/*'
|
||||
fail: true
|
||||
jobSummary: false
|
||||
- name: deploy_docs::install_mdbook
|
||||
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08
|
||||
with:
|
||||
mdbook-version: 0.4.37
|
||||
- name: deploy_docs::build_docs_book
|
||||
run: |
|
||||
mkdir -p target/deploy
|
||||
mdbook build ./docs --dest-dir=../target/deploy/docs/
|
||||
env:
|
||||
DOCS_CHANNEL: ${{ steps.resolve-channel.outputs.channel }}
|
||||
MDBOOK_BOOK__SITE_URL: ${{ steps.resolve-channel.outputs.site_url }}
|
||||
- name: deploy_docs::lychee_link_check
|
||||
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
|
||||
with:
|
||||
args: --no-progress --exclude '^http' 'target/deploy/docs'
|
||||
fail: true
|
||||
jobSummary: false
|
||||
- name: deploy_docs::docs_deploy_steps::deploy_to_cf_pages
|
||||
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: pages deploy target/deploy --project-name=${{ steps.resolve-channel.outputs.project_name }} --branch main
|
||||
- name: deploy_docs::docs_deploy_steps::upload_install_script
|
||||
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: r2 object put -f script/install.sh zed-open-source-website-assets/install.sh
|
||||
- name: deploy_docs::docs_deploy_steps::deploy_docs_worker
|
||||
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: deploy .cloudflare/docs-proxy/src/worker.js
|
||||
- name: deploy_docs::docs_deploy_steps::upload_wrangler_logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: wrangler_logs
|
||||
path: /home/runner/.config/.wrangler/logs/
|
||||
timeout-minutes: 60
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
23
.github/workflows/deploy_nightly_docs.yml
vendored
Normal file
23
.github/workflows/deploy_nightly_docs.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated from xtask::workflows::deploy_nightly_docs
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: deploy_nightly_docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
deploy_docs:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
permissions:
|
||||
contents: read
|
||||
uses: zed-industries/zed/.github/workflows/deploy_docs.yml@main
|
||||
secrets:
|
||||
DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
with:
|
||||
channel: nightly
|
||||
checkout_ref: ${{ github.sha }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
488
.github/workflows/docs_suggestions.yml
vendored
Normal file
488
.github/workflows/docs_suggestions.yml
vendored
Normal file
@@ -0,0 +1,488 @@
|
||||
name: Documentation Suggestions
|
||||
|
||||
# Stable release callout stripping plan (not wired yet):
|
||||
# 1. Add a separate stable-only workflow trigger on `release.published`
|
||||
# with `github.event.release.prerelease == false`.
|
||||
# 2. In that workflow, run `script/docs-strip-preview-callouts` on `main`.
|
||||
# 3. Open a PR with stripped preview callouts for human review.
|
||||
# 4. Fail loudly on script errors or when no callout changes are produced.
|
||||
# 5. Keep this workflow focused on suggestions only until that stable workflow is added.
|
||||
|
||||
on:
|
||||
# Run when PRs are merged to main
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'crates/**/*.rs'
|
||||
- '!crates/**/*_test.rs'
|
||||
- '!crates/**/tests/**'
|
||||
|
||||
# Run on cherry-picks to release branches
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
branches:
|
||||
- 'v0.*'
|
||||
paths:
|
||||
- 'crates/**/*.rs'
|
||||
|
||||
# Manual trigger for testing
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
description: 'PR number to analyze'
|
||||
required: true
|
||||
type: string
|
||||
mode:
|
||||
description: 'Output mode'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- batch
|
||||
- immediate
|
||||
default: batch
|
||||
|
||||
env:
|
||||
DROID_MODEL: claude-sonnet-4-5-20250929
|
||||
SUGGESTIONS_BRANCH: docs/suggestions-pending
|
||||
|
||||
jobs:
|
||||
# Job for PRs merged to main - batch suggestions to branch
|
||||
# Only runs for PRs from the same repo (not forks) since secrets aren't available for fork PRs
|
||||
batch-suggestions:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
if: |
|
||||
(github.event_name == 'pull_request' &&
|
||||
github.event.pull_request.merged == true &&
|
||||
github.event.pull_request.base.ref == 'main' &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.mode == 'batch')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install Droid CLI
|
||||
run: |
|
||||
# Retry with exponential backoff for transient network/auth issues
|
||||
MAX_RETRIES=3
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
echo "Attempt $i of $MAX_RETRIES to install Droid CLI..."
|
||||
if curl -fsSL https://app.factory.ai/cli | sh; then
|
||||
echo "Droid CLI installed successfully"
|
||||
break
|
||||
fi
|
||||
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
echo "Failed to install Droid CLI after $MAX_RETRIES attempts"
|
||||
exit 1
|
||||
fi
|
||||
sleep $((i * 5))
|
||||
done
|
||||
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
|
||||
env:
|
||||
FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
|
||||
|
||||
- name: Get PR info
|
||||
id: pr
|
||||
env:
|
||||
INPUT_PR_NUMBER: ${{ inputs.pr_number }}
|
||||
EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if [ -n "$INPUT_PR_NUMBER" ]; then
|
||||
PR_NUM="$INPUT_PR_NUMBER"
|
||||
else
|
||||
PR_NUM="$EVENT_PR_NUMBER"
|
||||
fi
|
||||
if ! [[ "$PR_NUM" =~ ^[0-9]+$ ]]; then
|
||||
echo "::error::Invalid PR number: $PR_NUM"
|
||||
exit 1
|
||||
fi
|
||||
echo "number=$PR_NUM" >> "$GITHUB_OUTPUT"
|
||||
PR_TITLE=$(gh pr view "$PR_NUM" --json title --jq '.title' | tr -d '\n\r' | head -c 200)
|
||||
EOF_MARKER="EOF_$(openssl rand -hex 8)"
|
||||
{
|
||||
echo "title<<$EOF_MARKER"
|
||||
echo "$PR_TITLE"
|
||||
echo "$EOF_MARKER"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Analyze PR for documentation needs
|
||||
id: analyze
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: |
|
||||
# Ensure gh CLI is authenticated (GH_TOKEN may not be auto-detected)
|
||||
# Unset GH_TOKEN first to allow gh auth login to store credentials
|
||||
echo "$GH_TOKEN" | (unset GH_TOKEN && gh auth login --with-token)
|
||||
|
||||
OUTPUT_FILE=$(mktemp)
|
||||
|
||||
# Retry with exponential backoff for transient Factory API failures
|
||||
MAX_RETRIES=3
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
echo "Attempt $i of $MAX_RETRIES to analyze PR..."
|
||||
if ./script/docs-suggest \
|
||||
--pr "$PR_NUMBER" \
|
||||
--immediate \
|
||||
--preview \
|
||||
--output "$OUTPUT_FILE" \
|
||||
--verbose; then
|
||||
echo "Analysis completed successfully"
|
||||
break
|
||||
fi
|
||||
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
echo "Analysis failed after $MAX_RETRIES attempts"
|
||||
exit 1
|
||||
fi
|
||||
echo "Retrying in $((i * 5)) seconds..."
|
||||
sleep $((i * 5))
|
||||
done
|
||||
|
||||
# Check if we got actionable suggestions (not "no updates needed")
|
||||
if grep -q "Documentation Suggestions" "$OUTPUT_FILE" && \
|
||||
! grep -q "No Documentation Updates Needed" "$OUTPUT_FILE"; then
|
||||
echo "has_suggestions=true" >> "$GITHUB_OUTPUT"
|
||||
echo "output_file=$OUTPUT_FILE" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "has_suggestions=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No actionable documentation suggestions for this PR"
|
||||
cat "$OUTPUT_FILE"
|
||||
fi
|
||||
|
||||
- name: Commit suggestions to queue branch
|
||||
if: steps.analyze.outputs.has_suggestions == 'true'
|
||||
env:
|
||||
PR_NUM: ${{ steps.pr.outputs.number }}
|
||||
PR_TITLE: ${{ steps.pr.outputs.title }}
|
||||
OUTPUT_FILE: ${{ steps.analyze.outputs.output_file }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Configure git
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# Retry loop for handling concurrent pushes
|
||||
MAX_RETRIES=3
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
echo "Attempt $i of $MAX_RETRIES"
|
||||
|
||||
# Fetch and checkout suggestions branch (create if doesn't exist)
|
||||
if git ls-remote --exit-code --heads origin "$SUGGESTIONS_BRANCH" > /dev/null 2>&1; then
|
||||
git fetch origin "$SUGGESTIONS_BRANCH"
|
||||
git checkout -B "$SUGGESTIONS_BRANCH" "origin/$SUGGESTIONS_BRANCH"
|
||||
else
|
||||
# Create orphan branch for clean history
|
||||
git checkout --orphan "$SUGGESTIONS_BRANCH"
|
||||
git rm -rf . > /dev/null 2>&1 || true
|
||||
|
||||
# Initialize with README
|
||||
cat > README.md << 'EOF'
|
||||
# Documentation Suggestions Queue
|
||||
|
||||
This branch contains batched documentation suggestions for the next Preview release.
|
||||
|
||||
Each file represents suggestions from a merged PR. At preview branch cut time,
|
||||
run `script/docs-suggest-publish` to create a documentation PR from these suggestions.
|
||||
|
||||
## Structure
|
||||
|
||||
- `suggestions/PR-XXXXX.md` - Suggestions for PR #XXXXX
|
||||
- `manifest.json` - Index of all pending suggestions
|
||||
|
||||
## Workflow
|
||||
|
||||
1. PRs merged to main trigger documentation analysis
|
||||
2. Suggestions are committed here as individual files
|
||||
3. At preview release, suggestions are collected into a docs PR
|
||||
4. After docs PR is created, this branch is reset
|
||||
EOF
|
||||
|
||||
mkdir -p suggestions
|
||||
echo '{"suggestions":[]}' > manifest.json
|
||||
git add README.md suggestions manifest.json
|
||||
git commit -m "Initialize documentation suggestions queue"
|
||||
fi
|
||||
|
||||
# Create suggestion file
|
||||
SUGGESTION_FILE="suggestions/PR-${PR_NUM}.md"
|
||||
|
||||
{
|
||||
echo "# PR #${PR_NUM}: ${PR_TITLE}"
|
||||
echo ""
|
||||
echo "_Merged: $(date -u +%Y-%m-%dT%H:%M:%SZ)_"
|
||||
echo "_PR: https://github.com/${REPO}/pull/${PR_NUM}_"
|
||||
echo ""
|
||||
cat "$OUTPUT_FILE"
|
||||
} > "$SUGGESTION_FILE"
|
||||
|
||||
# Update manifest
|
||||
MANIFEST=$(cat manifest.json)
|
||||
NEW_ENTRY="{\"pr\":${PR_NUM},\"title\":$(echo "$PR_TITLE" | jq -R .),\"file\":\"$SUGGESTION_FILE\",\"date\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}"
|
||||
|
||||
# Add to manifest if not already present
|
||||
if ! echo "$MANIFEST" | jq -e ".suggestions[] | select(.pr == $PR_NUM)" > /dev/null 2>&1; then
|
||||
echo "$MANIFEST" | jq ".suggestions += [$NEW_ENTRY]" > manifest.json
|
||||
fi
|
||||
|
||||
# Commit
|
||||
git add "$SUGGESTION_FILE" manifest.json
|
||||
git commit -m "docs: Add suggestions for PR #${PR_NUM}
|
||||
|
||||
${PR_TITLE}
|
||||
|
||||
Auto-generated documentation suggestions for review at next preview release."
|
||||
|
||||
# Try to push
|
||||
if git push origin "$SUGGESTIONS_BRANCH"; then
|
||||
echo "Successfully pushed suggestions"
|
||||
break
|
||||
else
|
||||
echo "Push failed, retrying..."
|
||||
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
echo "Failed after $MAX_RETRIES attempts"
|
||||
exit 1
|
||||
fi
|
||||
sleep $((i * 2))
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
env:
|
||||
HAS_SUGGESTIONS: ${{ steps.analyze.outputs.has_suggestions }}
|
||||
PR_NUM: ${{ steps.pr.outputs.number }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
{
|
||||
echo "## Documentation Suggestions"
|
||||
echo ""
|
||||
if [ "$HAS_SUGGESTIONS" == "true" ]; then
|
||||
echo "✅ Suggestions queued for PR #${PR_NUM}"
|
||||
echo ""
|
||||
echo "View pending suggestions: [docs/suggestions-pending branch](https://github.com/${REPO}/tree/${SUGGESTIONS_BRANCH})"
|
||||
else
|
||||
echo "No documentation updates needed for this PR."
|
||||
fi
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
# Job for cherry-picks to release branches - immediate output as PR comment
|
||||
cherry-pick-suggestions:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
concurrency:
|
||||
group: docs-suggestions-${{ github.event.pull_request.number || inputs.pr_number || 'manual' }}
|
||||
cancel-in-progress: true
|
||||
if: |
|
||||
(github.event_name == 'pull_request_target' &&
|
||||
startsWith(github.event.pull_request.base.ref, 'v0.') &&
|
||||
contains(fromJSON('["MEMBER","OWNER"]'),
|
||||
github.event.pull_request.author_association)) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.mode == 'immediate')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.ref || '' }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Droid CLI
|
||||
run: |
|
||||
# Retry with exponential backoff for transient network/auth issues
|
||||
MAX_RETRIES=3
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
echo "Attempt $i of $MAX_RETRIES to install Droid CLI..."
|
||||
if curl -fsSL https://app.factory.ai/cli | sh; then
|
||||
echo "Droid CLI installed successfully"
|
||||
break
|
||||
fi
|
||||
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
echo "Failed to install Droid CLI after $MAX_RETRIES attempts"
|
||||
exit 1
|
||||
fi
|
||||
sleep $((i * 5))
|
||||
done
|
||||
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
|
||||
env:
|
||||
FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
|
||||
|
||||
- name: Get PR number
|
||||
id: pr
|
||||
env:
|
||||
INPUT_PR_NUMBER: ${{ inputs.pr_number }}
|
||||
EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
if [ -n "$INPUT_PR_NUMBER" ]; then
|
||||
PR_NUM="$INPUT_PR_NUMBER"
|
||||
else
|
||||
PR_NUM="$EVENT_PR_NUMBER"
|
||||
fi
|
||||
if ! [[ "$PR_NUM" =~ ^[0-9]+$ ]]; then
|
||||
echo "::error::Invalid PR number: $PR_NUM"
|
||||
exit 1
|
||||
fi
|
||||
echo "number=$PR_NUM" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Analyze PR for documentation needs
|
||||
id: analyze
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: |
|
||||
# Ensure gh CLI is authenticated (GH_TOKEN may not be auto-detected)
|
||||
# Unset GH_TOKEN first to allow gh auth login to store credentials
|
||||
echo "$GH_TOKEN" | (unset GH_TOKEN && gh auth login --with-token)
|
||||
|
||||
OUTPUT_FILE="${RUNNER_TEMP}/suggestions.md"
|
||||
|
||||
# Cherry-picks don't get preview callout
|
||||
# Retry with exponential backoff for transient Factory API failures
|
||||
MAX_RETRIES=3
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
echo "Attempt $i of $MAX_RETRIES to analyze PR..."
|
||||
if ./script/docs-suggest \
|
||||
--pr "$PR_NUMBER" \
|
||||
--immediate \
|
||||
--no-preview \
|
||||
--output "$OUTPUT_FILE" \
|
||||
--verbose; then
|
||||
echo "Analysis completed successfully"
|
||||
break
|
||||
fi
|
||||
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
echo "Analysis failed after $MAX_RETRIES attempts"
|
||||
exit 1
|
||||
fi
|
||||
echo "Retrying in $((i * 5)) seconds..."
|
||||
sleep $((i * 5))
|
||||
done
|
||||
|
||||
# Check if we got actionable suggestions
|
||||
if [ -s "$OUTPUT_FILE" ] && \
|
||||
grep -q "Documentation Suggestions" "$OUTPUT_FILE" && \
|
||||
! grep -q "No Documentation Updates Needed" "$OUTPUT_FILE"; then
|
||||
echo "has_suggestions=true" >> "$GITHUB_OUTPUT"
|
||||
echo "suggestions_file=$OUTPUT_FILE" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "has_suggestions=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Post suggestions as PR comment
|
||||
if: steps.analyze.outputs.has_suggestions == 'true'
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
||||
env:
|
||||
SUGGESTIONS_FILE: ${{ steps.analyze.outputs.suggestions_file }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
|
||||
// Read suggestions from file
|
||||
const suggestionsRaw = fs.readFileSync(process.env.SUGGESTIONS_FILE, 'utf8');
|
||||
|
||||
// Sanitize AI-generated content
|
||||
let sanitized = suggestionsRaw
|
||||
// Strip HTML tags
|
||||
.replace(/<[^>]*>/g, '')
|
||||
// Strip markdown links but keep display text
|
||||
.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
|
||||
// Strip raw URLs
|
||||
.replace(/https?:\/\/[^\s)>\]]+/g, '[link removed]')
|
||||
// Strip protocol-relative URLs
|
||||
.replace(/\/\/[^\s)>\]]+\.[^\s)>\]]+/g, '[link removed]')
|
||||
// Neutralize @-mentions (preserve JSDoc-style annotations)
|
||||
.replace(/@(?!param\b|returns?\b|throws?\b|typedef\b|type\b|see\b|example\b|since\b|deprecated\b|default\b)(\w+)/g, '`@$1`')
|
||||
// Strip cross-repo references that could be confused with real links
|
||||
.replace(/[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+#\d+/g, '[ref removed]');
|
||||
|
||||
// Truncate to 20,000 characters
|
||||
if (sanitized.length > 20000) {
|
||||
sanitized = sanitized.substring(0, 20000) + '\n\n…(truncated)';
|
||||
}
|
||||
|
||||
// Parse and validate PR number
|
||||
const prNumber = parseInt(process.env.PR_NUMBER, 10);
|
||||
if (isNaN(prNumber) || prNumber <= 0) {
|
||||
core.setFailed(`Invalid PR number: ${process.env.PR_NUMBER}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const body = `## 📚 Documentation Suggestions
|
||||
|
||||
This cherry-pick contains changes that may need documentation updates.
|
||||
|
||||
${sanitized}
|
||||
|
||||
---
|
||||
> **Note:** This comment was generated automatically by an AI model analyzing
|
||||
> code changes. Suggestions may contain inaccuracies — please verify before acting.
|
||||
|
||||
<details>
|
||||
<summary>About this comment</summary>
|
||||
|
||||
This comment was generated automatically by analyzing code changes in this cherry-pick.
|
||||
Cherry-picks typically don't need new documentation since the feature was already
|
||||
documented when merged to main, but please verify.
|
||||
|
||||
</details>`;
|
||||
|
||||
// Find existing comment to update (avoid spam)
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber
|
||||
});
|
||||
|
||||
const botComment = comments.find(c =>
|
||||
c.user.type === 'Bot' &&
|
||||
c.body.includes('Documentation Suggestions')
|
||||
);
|
||||
|
||||
if (botComment) {
|
||||
await github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: botComment.id,
|
||||
body: body
|
||||
});
|
||||
} else {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
body: body
|
||||
});
|
||||
}
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
env:
|
||||
HAS_SUGGESTIONS: ${{ steps.analyze.outputs.has_suggestions }}
|
||||
PR_NUM: ${{ steps.pr.outputs.number }}
|
||||
run: |
|
||||
{
|
||||
echo "## 📚 Documentation Suggestions (Cherry-pick)"
|
||||
echo ""
|
||||
if [ "$HAS_SUGGESTIONS" == "true" ]; then
|
||||
echo "Suggestions posted as PR comment on #${PR_NUM}."
|
||||
else
|
||||
echo "No documentation suggestions for this cherry-pick."
|
||||
fi
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
80
.github/workflows/extension_auto_bump.yml
vendored
Normal file
80
.github/workflows/extension_auto_bump.yml
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# Generated from xtask::workflows::extension_auto_bump
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: extension_auto_bump
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- extensions/**
|
||||
- '!extensions/test-extension/**'
|
||||
- '!extensions/workflows/**'
|
||||
- '!extensions/*.md'
|
||||
jobs:
|
||||
detect_changed_extensions:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 2
|
||||
- id: detect
|
||||
name: extension_auto_bump::detect_changed_extensions
|
||||
run: |
|
||||
COMPARE_REV="$(git rev-parse HEAD~1)"
|
||||
CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" "$GITHUB_SHA")"
|
||||
# Detect changed extension directories (excluding extensions/workflows)
|
||||
CHANGED_EXTENSIONS=$(echo "$CHANGED_FILES" | grep -oP '^extensions/[^/]+(?=/)' | sort -u | grep -v '^extensions/workflows$' || true)
|
||||
# Filter out deleted extensions
|
||||
EXISTING_EXTENSIONS=""
|
||||
for ext in $CHANGED_EXTENSIONS; do
|
||||
if [ -f "$ext/extension.toml" ]; then
|
||||
EXISTING_EXTENSIONS=$(printf '%s\n%s' "$EXISTING_EXTENSIONS" "$ext")
|
||||
fi
|
||||
done
|
||||
CHANGED_EXTENSIONS=$(echo "$EXISTING_EXTENSIONS" | sed '/^$/d')
|
||||
if [ -n "$CHANGED_EXTENSIONS" ]; then
|
||||
EXTENSIONS_JSON=$(echo "$CHANGED_EXTENSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
else
|
||||
EXTENSIONS_JSON="[]"
|
||||
fi
|
||||
# Filter out newly added extensions
|
||||
FILTERED="[]"
|
||||
for ext in $(echo "$EXTENSIONS_JSON" | jq -r '.[]'); do
|
||||
if git show HEAD~1:"$ext/extension.toml" >/dev/null 2>&1; then
|
||||
FILTERED=$(echo "$FILTERED" | jq -c --arg e "$ext" '. + [$e]')
|
||||
fi
|
||||
done
|
||||
echo "changed_extensions=$FILTERED" >> "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
changed_extensions: ${{ steps.detect.outputs.changed_extensions }}
|
||||
timeout-minutes: 5
|
||||
bump_extension_versions:
|
||||
needs:
|
||||
- detect_changed_extensions
|
||||
if: needs.detect_changed_extensions.outputs.changed_extensions != '[]'
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
strategy:
|
||||
matrix:
|
||||
extension: ${{ fromJson(needs.detect_changed_extensions.outputs.changed_extensions) }}
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
uses: ./.github/workflows/extension_bump.yml
|
||||
secrets:
|
||||
app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
app-secret: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
with:
|
||||
working-directory: ${{ matrix.extension }}
|
||||
force-bump: false
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
315
.github/workflows/extension_bump.yml
vendored
Normal file
315
.github/workflows/extension_bump.yml
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
# Generated from xtask::workflows::extension_bump
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: extension_bump
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
CARGO_INCREMENTAL: '0'
|
||||
ZED_EXTENSION_CLI_SHA: 1fa7f1a3ec28ea1eae6db2e937d7a538fb10c0c7
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
bump-type:
|
||||
description: bump-type
|
||||
type: string
|
||||
default: patch
|
||||
force-bump:
|
||||
description: force-bump
|
||||
required: true
|
||||
type: boolean
|
||||
working-directory:
|
||||
description: working-directory
|
||||
type: string
|
||||
default: .
|
||||
secrets:
|
||||
app-id:
|
||||
description: The app ID used to create the PR
|
||||
required: true
|
||||
app-secret:
|
||||
description: The app secret for the corresponding app ID
|
||||
required: true
|
||||
jobs:
|
||||
check_version_changed:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- id: compare-versions-check
|
||||
name: extension_bump::compare_versions
|
||||
run: |
|
||||
CURRENT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||
PR_FORK_POINT="$(git merge-base origin/main HEAD)"
|
||||
git checkout "$PR_FORK_POINT"
|
||||
else
|
||||
git checkout "$(git log -1 --format=%H)"~1
|
||||
fi
|
||||
|
||||
PARENT_COMMIT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
|
||||
|
||||
[[ "$CURRENT_VERSION" == "$PARENT_COMMIT_VERSION" ]] && \
|
||||
echo "version_changed=false" >> "$GITHUB_OUTPUT" || \
|
||||
echo "version_changed=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
version_changed: ${{ steps.compare-versions-check.outputs.version_changed }}
|
||||
current_version: ${{ steps.compare-versions-check.outputs.current_version }}
|
||||
timeout-minutes: 1
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
bump_extension_version:
|
||||
needs:
|
||||
- check_version_changed
|
||||
if: |-
|
||||
(github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') &&
|
||||
(inputs.force-bump == true || needs.check_version_changed.outputs.version_changed == 'false')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.app-id }}
|
||||
private-key: ${{ secrets.app-secret }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: extension_bump::install_bump_2_version
|
||||
run: pip install bump2version --break-system-packages
|
||||
- id: bump-version
|
||||
name: extension_bump::bump_version
|
||||
run: |
|
||||
BUMP_FILES=("extension.toml")
|
||||
if [[ -f "Cargo.toml" ]]; then
|
||||
BUMP_FILES+=("Cargo.toml")
|
||||
fi
|
||||
|
||||
bump2version \
|
||||
--search "version = \"{current_version}"\" \
|
||||
--replace "version = \"{new_version}"\" \
|
||||
--current-version "$OLD_VERSION" \
|
||||
--no-configured-files "$BUMP_TYPE" "${BUMP_FILES[@]}"
|
||||
|
||||
if [[ -f "Cargo.toml" ]]; then
|
||||
cargo +stable update --workspace
|
||||
fi
|
||||
|
||||
NEW_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
|
||||
EXTENSION_ID="$(sed -n 's/^id = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
|
||||
EXTENSION_NAME="$(sed -n 's/^name = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
|
||||
|
||||
if [[ "$WORKING_DIR" == "." || -z "$WORKING_DIR" ]]; then
|
||||
{
|
||||
echo "title=Bump version to ${NEW_VERSION}";
|
||||
echo "body=This PR bumps the version of this extension to v${NEW_VERSION}";
|
||||
echo "branch_name=zed-zippy-autobump";
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
{
|
||||
echo "title=${EXTENSION_ID}: Bump to v${NEW_VERSION}";
|
||||
echo "body<<EOF";
|
||||
echo "This PR bumps the version of the ${EXTENSION_NAME} extension to v${NEW_VERSION}.";
|
||||
echo "";
|
||||
echo "Release Notes:";
|
||||
echo "";
|
||||
echo "- N/A";
|
||||
echo "EOF";
|
||||
echo "branch_name=zed-zippy-${EXTENSION_ID}-autobump";
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
echo "new_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
OLD_VERSION: ${{ needs.check_version_changed.outputs.current_version }}
|
||||
BUMP_TYPE: ${{ inputs.bump-type }}
|
||||
WORKING_DIR: ${{ inputs.working-directory }}
|
||||
- name: steps::create_pull_request
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: ${{ steps.bump-version.outputs.title }}
|
||||
body: ${{ steps.bump-version.outputs.body }}
|
||||
commit-message: ${{ steps.bump-version.outputs.title }}
|
||||
branch: ${{ steps.bump-version.outputs.branch_name }}
|
||||
committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
base: main
|
||||
delete-branch: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
sign-commits: true
|
||||
assignees: ${{ github.actor }}
|
||||
timeout-minutes: 5
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
create_version_label:
|
||||
needs:
|
||||
- check_version_changed
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check_version_changed.outputs.version_changed == 'true'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.app-id }}
|
||||
private-key: ${{ secrets.app-secret }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- id: determine-tag
|
||||
name: extension_bump::determine_tag
|
||||
run: |
|
||||
EXTENSION_ID="$(sed -n 's/^id = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
|
||||
|
||||
if [[ "$WORKING_DIR" == "." || -z "$WORKING_DIR" ]]; then
|
||||
TAG="v${CURRENT_VERSION}"
|
||||
else
|
||||
TAG="${EXTENSION_ID}-v${CURRENT_VERSION}"
|
||||
fi
|
||||
|
||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
CURRENT_VERSION: ${{ needs.check_version_changed.outputs.current_version }}
|
||||
WORKING_DIR: ${{ inputs.working-directory }}
|
||||
- name: extension_bump::create_version_tag
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |-
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/${{ steps.determine-tag.outputs.tag }}',
|
||||
sha: context.sha
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
outputs:
|
||||
tag: ${{ steps.determine-tag.outputs.tag }}
|
||||
timeout-minutes: 1
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
trigger_release:
|
||||
needs:
|
||||
- check_version_changed
|
||||
- create_version_label
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.app-id }}
|
||||
private-key: ${{ secrets.app-secret }}
|
||||
owner: zed-industries
|
||||
repositories: extensions
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- id: get-extension-id
|
||||
name: extension_bump::get_extension_id
|
||||
run: |
|
||||
EXTENSION_ID="$(sed -n 's/id = \"\(.*\)\"/\1/p' < extension.toml)"
|
||||
|
||||
echo "extension_id=${EXTENSION_ID}" >> "$GITHUB_OUTPUT"
|
||||
- id: extension-update
|
||||
name: extension_bump::release_action
|
||||
uses: huacnlee/zed-extension-action@82920ff0876879f65ffbcfa3403589114a8919c6
|
||||
with:
|
||||
extension-name: ${{ steps.get-extension-id.outputs.extension_id }}
|
||||
push-to: zed-industries/extensions
|
||||
tag: ${{ needs.create_version_label.outputs.tag }}
|
||||
env:
|
||||
COMMITTER_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
- name: extension_bump::enable_automerge_if_staff
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
script: |
|
||||
const prNumber = process.env.PR_NUMBER;
|
||||
if (!prNumber) {
|
||||
console.log('No pull request number set, skipping automerge.');
|
||||
return;
|
||||
}
|
||||
|
||||
const author = process.env.GITHUB_ACTOR;
|
||||
let isStaff = false;
|
||||
try {
|
||||
const response = await github.rest.teams.getMembershipForUserInOrg({
|
||||
org: 'zed-industries',
|
||||
team_slug: 'staff',
|
||||
username: author
|
||||
});
|
||||
isStaff = response.data.state === 'active';
|
||||
} catch (error) {
|
||||
if (error.status !== 404) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isStaff) {
|
||||
console.log(`Actor ${author} is not a staff member, skipping automerge.`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Assign staff member responsible for the bump
|
||||
const pullNumber = parseInt(prNumber);
|
||||
|
||||
await github.rest.issues.addAssignees({
|
||||
owner: 'zed-industries',
|
||||
repo: 'extensions',
|
||||
issue_number: pullNumber,
|
||||
assignees: [author]
|
||||
});
|
||||
console.log(`Assigned ${author} to PR #${prNumber} in zed-industries/extensions`);
|
||||
|
||||
// Get the GraphQL node ID
|
||||
const { data: pr } = await github.rest.pulls.get({
|
||||
owner: 'zed-industries',
|
||||
repo: 'extensions',
|
||||
pull_number: pullNumber
|
||||
});
|
||||
|
||||
await github.graphql(`
|
||||
mutation($pullRequestId: ID!) {
|
||||
enablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, mergeMethod: SQUASH }) {
|
||||
pullRequest {
|
||||
autoMergeRequest {
|
||||
enabledAt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, { pullRequestId: pr.node_id });
|
||||
|
||||
console.log(`Automerge enabled for PR #${prNumber} in zed-industries/extensions`);
|
||||
env:
|
||||
PR_NUMBER: ${{ steps.extension-update.outputs.pull-request-number }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}extension-bump
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
224
.github/workflows/extension_tests.yml
vendored
Normal file
224
.github/workflows/extension_tests.yml
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
# Generated from xtask::workflows::extension_tests
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: extension_tests
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
CARGO_INCREMENTAL: '0'
|
||||
ZED_EXTENSION_CLI_SHA: 1fa7f1a3ec28ea1eae6db2e937d7a538fb10c0c7
|
||||
RUSTUP_TOOLCHAIN: stable
|
||||
CARGO_BUILD_TARGET: wasm32-wasip2
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
description: working-directory
|
||||
type: string
|
||||
default: .
|
||||
jobs:
|
||||
orchestrate:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
|
||||
- id: filter
|
||||
name: filter
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$GITHUB_BASE_REF" ]; then
|
||||
echo "Not in a PR context (i.e., push to main/stable/preview)"
|
||||
COMPARE_REV="$(git rev-parse HEAD~1)"
|
||||
else
|
||||
echo "In a PR context comparing to pull_request.base.ref"
|
||||
git fetch origin "$GITHUB_BASE_REF" --depth=350
|
||||
COMPARE_REV="$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)"
|
||||
fi
|
||||
CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" "$GITHUB_SHA")"
|
||||
|
||||
# When running from a subdirectory, git diff returns repo-root-relative paths.
|
||||
# Filter to only files within the current working directory and strip the prefix.
|
||||
REPO_SUBDIR="$(git rev-parse --show-prefix)"
|
||||
REPO_SUBDIR="${REPO_SUBDIR%/}"
|
||||
if [ -n "$REPO_SUBDIR" ]; then
|
||||
CHANGED_FILES="$(echo "$CHANGED_FILES" | grep "^${REPO_SUBDIR}/" | sed "s|^${REPO_SUBDIR}/||" || true)"
|
||||
fi
|
||||
|
||||
check_pattern() {
|
||||
local output_name="$1"
|
||||
local pattern="$2"
|
||||
local grep_arg="$3"
|
||||
|
||||
echo "$CHANGED_FILES" | grep "$grep_arg" "$pattern" && \
|
||||
echo "${output_name}=true" >> "$GITHUB_OUTPUT" || \
|
||||
echo "${output_name}=false" >> "$GITHUB_OUTPUT"
|
||||
}
|
||||
|
||||
check_pattern "check_rust" '^(Cargo.lock|Cargo.toml|.*\.rs)$' -qP
|
||||
check_pattern "check_extension" '^(extension\.toml|.*\.scm)$' -qP
|
||||
outputs:
|
||||
check_rust: ${{ steps.filter.outputs.check_rust }}
|
||||
check_extension: ${{ steps.filter.outputs.check_extension }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
check_rust:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.check_rust == 'true'
|
||||
runs-on: namespace-profile-8x32-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: extension_tests::install_rust_target
|
||||
run: rustup target add wasm32-wasip2
|
||||
- id: get-package-name
|
||||
name: extension_tests::get_package_name
|
||||
run: |
|
||||
PACKAGE_NAME="$(sed -n 's/^name = "\(.*\)"/\1/p' < Cargo.toml | head -1 | tr -d '[:space:]')"
|
||||
echo "package_name=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"
|
||||
- name: extension_tests::cargo_fmt_package
|
||||
run: cargo fmt -p "$PACKAGE_NAME" -- --check
|
||||
env:
|
||||
PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
|
||||
- name: extension_tests::run_clippy
|
||||
run: cargo clippy -p "$PACKAGE_NAME" --release --all-features -- --deny warnings
|
||||
env:
|
||||
PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
|
||||
- name: steps::cargo_install_nextest
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
|
||||
- name: extension_tests::run_nextest
|
||||
run: 'cargo nextest run -p "$PACKAGE_NAME" --no-fail-fast --no-tests=warn --target "$(rustc -vV | sed -n ''s|host: ||p'')"'
|
||||
env:
|
||||
PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
|
||||
NEXTEST_NO_TESTS: warn
|
||||
timeout-minutes: 6
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
check_extension:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.check_extension == 'true'
|
||||
runs-on: namespace-profile-8x32-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- id: cache-zed-extension-cli
|
||||
name: extension_tests::cache_zed_extension_cli
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
|
||||
with:
|
||||
path: zed-extension
|
||||
key: zed-extension-${{ env.ZED_EXTENSION_CLI_SHA }}
|
||||
- name: extension_tests::download_zed_extension_cli
|
||||
if: steps.cache-zed-extension-cli.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget --quiet "https://zed-extension-cli.nyc3.digitaloceanspaces.com/$ZED_EXTENSION_CLI_SHA/x86_64-unknown-linux-gnu/zed-extension" -O "$GITHUB_WORKSPACE/zed-extension"
|
||||
chmod +x "$GITHUB_WORKSPACE/zed-extension"
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: extension_tests::check
|
||||
run: |
|
||||
mkdir -p /tmp/ext-scratch
|
||||
mkdir -p /tmp/ext-output
|
||||
"$GITHUB_WORKSPACE/zed-extension" --source-dir . --scratch-dir /tmp/ext-scratch --output-dir /tmp/ext-output
|
||||
- name: run_tests::fetch_ts_query_ls
|
||||
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
|
||||
with:
|
||||
repo: ribru17/ts_query_ls
|
||||
version: tags/v3.15.1
|
||||
file: ts_query_ls-x86_64-unknown-linux-gnu.tar.gz
|
||||
- name: run_tests::run_ts_query_ls
|
||||
run: |-
|
||||
tar -xf "$GITHUB_WORKSPACE/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz" -C "$GITHUB_WORKSPACE"
|
||||
"$GITHUB_WORKSPACE/ts_query_ls" format --check . || {
|
||||
echo "Found unformatted queries, please format them with ts_query_ls."
|
||||
echo "For easy use, install the Tree-sitter query extension:"
|
||||
echo "zed://extension/tree-sitter-query"
|
||||
false
|
||||
}
|
||||
- id: compare-versions-check
|
||||
name: extension_bump::compare_versions
|
||||
run: |
|
||||
CURRENT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||
PR_FORK_POINT="$(git merge-base origin/main HEAD)"
|
||||
git checkout "$PR_FORK_POINT"
|
||||
else
|
||||
git checkout "$(git log -1 --format=%H)"~1
|
||||
fi
|
||||
|
||||
PARENT_COMMIT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
|
||||
|
||||
[[ "$CURRENT_VERSION" == "$PARENT_COMMIT_VERSION" ]] && \
|
||||
echo "version_changed=false" >> "$GITHUB_OUTPUT" || \
|
||||
echo "version_changed=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
- name: extension_tests::verify_version_did_not_change
|
||||
run: |
|
||||
if [[ "$VERSION_CHANGED" == "true" && "$GITHUB_EVENT_NAME" == "pull_request" && "$PR_USER_LOGIN" != "zed-zippy[bot]" ]] ; then
|
||||
echo "Version change detected in your change!"
|
||||
echo "Version changes happen in separate PRs and will be performed by the zed-zippy bot"
|
||||
exit 42
|
||||
fi
|
||||
env:
|
||||
VERSION_CHANGED: ${{ steps.compare-versions-check.outputs.version_changed }}
|
||||
PR_USER_LOGIN: ${{ github.event.pull_request.user.login }}
|
||||
timeout-minutes: 6
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
tests_pass:
|
||||
needs:
|
||||
- orchestrate
|
||||
- check_rust
|
||||
- check_extension
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: run_tests::tests_pass
|
||||
run: |
|
||||
set +x
|
||||
EXIT_CODE=0
|
||||
|
||||
check_result() {
|
||||
echo "* $1: $2"
|
||||
if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
|
||||
}
|
||||
|
||||
check_result "orchestrate" "$RESULT_ORCHESTRATE"
|
||||
check_result "check_rust" "$RESULT_CHECK_RUST"
|
||||
check_result "check_extension" "$RESULT_CHECK_EXTENSION"
|
||||
|
||||
exit $EXIT_CODE
|
||||
env:
|
||||
RESULT_ORCHESTRATE: ${{ needs.orchestrate.result }}
|
||||
RESULT_CHECK_RUST: ${{ needs.check_rust.result }}
|
||||
RESULT_CHECK_EXTENSION: ${{ needs.check_extension.result }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}extension-tests
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
240
.github/workflows/extension_workflow_rollout.yml
vendored
Normal file
240
.github/workflows/extension_workflow_rollout.yml
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
# Generated from xtask::workflows::extension_workflow_rollout
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: extension_workflow_rollout
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
filter-repos:
|
||||
description: Comma-separated list of repository names to rollout to. Leave empty for all repos.
|
||||
type: string
|
||||
default: ''
|
||||
change-description:
|
||||
description: Description for the changes to be expected with this rollout
|
||||
type: string
|
||||
default: ''
|
||||
jobs:
|
||||
fetch_extension_repos:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && github.ref == 'refs/heads/main'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: checkout_zed_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- id: prev-tag
|
||||
name: extension_workflow_rollout::fetch_extension_repos::get_previous_tag_commit
|
||||
run: |
|
||||
PREV_COMMIT=$(git rev-parse "extension-workflows^{commit}" 2>/dev/null || echo "")
|
||||
if [ -z "$PREV_COMMIT" ]; then
|
||||
echo "::error::No previous rollout tag 'extension-workflows' found. Cannot determine file changes."
|
||||
exit 1
|
||||
fi
|
||||
echo "Found previous rollout at commit: $PREV_COMMIT"
|
||||
echo "prev_commit=$PREV_COMMIT" >> "$GITHUB_OUTPUT"
|
||||
- id: calc-changes
|
||||
name: extension_workflow_rollout::fetch_extension_repos::get_removed_files
|
||||
run: |
|
||||
for workflow_type in "ci" "shared"; do
|
||||
if [ "$workflow_type" = "ci" ]; then
|
||||
WORKFLOW_DIR="extensions/workflows"
|
||||
else
|
||||
WORKFLOW_DIR="extensions/workflows/shared"
|
||||
fi
|
||||
|
||||
REMOVED=$(git diff --name-status -M "$PREV_COMMIT" HEAD -- "$WORKFLOW_DIR" | \
|
||||
awk '/^D/ { print $2 } /^R/ { print $2 }' | \
|
||||
xargs -I{} basename {} 2>/dev/null | \
|
||||
tr '\n' ' ' || echo "")
|
||||
REMOVED=$(echo "$REMOVED" | xargs)
|
||||
|
||||
echo "Removed files for $workflow_type: $REMOVED"
|
||||
echo "removed_${workflow_type}=$REMOVED" >> "$GITHUB_OUTPUT"
|
||||
done
|
||||
env:
|
||||
PREV_COMMIT: ${{ steps.prev-tag.outputs.prev_commit }}
|
||||
- id: list-repos
|
||||
name: extension_workflow_rollout::fetch_extension_repos::get_repositories
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
const repos = await github.paginate(github.rest.repos.listForOrg, {
|
||||
org: 'zed-extensions',
|
||||
type: 'public',
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
let filteredRepos = repos
|
||||
.filter(repo => !repo.archived)
|
||||
.map(repo => repo.name);
|
||||
|
||||
const filterInput = `${{ inputs.filter-repos }}`.trim();
|
||||
if (filterInput.length > 0) {
|
||||
const allowedNames = filterInput.split(',').map(s => s.trim()).filter(s => s.length > 0);
|
||||
filteredRepos = filteredRepos.filter(name => allowedNames.includes(name));
|
||||
console.log(`Filter applied. Matched ${filteredRepos.length} repos from ${allowedNames.length} requested.`);
|
||||
}
|
||||
|
||||
console.log(`Found ${filteredRepos.length} extension repos`);
|
||||
return filteredRepos;
|
||||
result-encoding: json
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: extension_workflow_rollout::fetch_extension_repos::generate_workflow_files
|
||||
run: |
|
||||
cargo xtask workflows "$COMMIT_SHA"
|
||||
env:
|
||||
COMMIT_SHA: ${{ github.sha }}
|
||||
- name: extension_workflow_rollout::fetch_extension_repos::upload_workflow_files
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: extension-workflow-files
|
||||
path: extensions/workflows/**/*.yml
|
||||
if-no-files-found: error
|
||||
outputs:
|
||||
repos: ${{ steps.list-repos.outputs.result }}
|
||||
prev_commit: ${{ steps.prev-tag.outputs.prev_commit }}
|
||||
removed_ci: ${{ steps.calc-changes.outputs.removed_ci }}
|
||||
removed_shared: ${{ steps.calc-changes.outputs.removed_shared }}
|
||||
timeout-minutes: 10
|
||||
rollout_workflows_to_extension:
|
||||
needs:
|
||||
- fetch_extension_repos
|
||||
if: needs.fetch_extension_repos.outputs.repos != '[]'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
strategy:
|
||||
matrix:
|
||||
repo: ${{ fromJson(needs.fetch_extension_repos.outputs.repos) }}
|
||||
fail-fast: false
|
||||
max-parallel: 10
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
owner: zed-extensions
|
||||
repositories: ${{ matrix.repo }}
|
||||
permission-pull-requests: write
|
||||
permission-contents: write
|
||||
permission-workflows: write
|
||||
- name: checkout_extension_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
path: extension
|
||||
repository: zed-extensions/${{ matrix.repo }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: extension_workflow_rollout::rollout_workflows_to_extension::download_workflow_files
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
with:
|
||||
name: extension-workflow-files
|
||||
path: workflow-files
|
||||
- name: extension_workflow_rollout::rollout_workflows_to_extension::sync_workflow_files
|
||||
run: |
|
||||
mkdir -p extension/.github/workflows
|
||||
|
||||
if [ "$MATRIX_REPO" = "workflows" ]; then
|
||||
REMOVED_FILES="$REMOVED_CI"
|
||||
else
|
||||
REMOVED_FILES="$REMOVED_SHARED"
|
||||
fi
|
||||
|
||||
cd extension/.github/workflows
|
||||
|
||||
if [ -n "$REMOVED_FILES" ]; then
|
||||
for file in $REMOVED_FILES; do
|
||||
if [ -f "$file" ]; then
|
||||
rm -f "$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
cd - > /dev/null
|
||||
|
||||
if [ "$MATRIX_REPO" = "workflows" ]; then
|
||||
cp workflow-files/*.yml extension/.github/workflows/
|
||||
else
|
||||
cp workflow-files/shared/*.yml extension/.github/workflows/
|
||||
fi
|
||||
env:
|
||||
REMOVED_CI: ${{ needs.fetch_extension_repos.outputs.removed_ci }}
|
||||
REMOVED_SHARED: ${{ needs.fetch_extension_repos.outputs.removed_shared }}
|
||||
MATRIX_REPO: ${{ matrix.repo }}
|
||||
- id: short-sha
|
||||
name: extension_workflow_rollout::rollout_workflows_to_extension::get_short_sha
|
||||
run: |
|
||||
echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
|
||||
- id: create-pr
|
||||
name: steps::create_pull_request
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: Update CI workflows to `${{ steps.short-sha.outputs.sha_short }}`
|
||||
body: |
|
||||
This PR updates the CI workflow files from the main Zed repository
|
||||
based on the commit zed-industries/zed@${{ github.sha }}
|
||||
|
||||
${{ inputs.change-description }}
|
||||
commit-message: Update CI workflows to `${{ steps.short-sha.outputs.sha_short }}`
|
||||
branch: update-workflows
|
||||
committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
base: main
|
||||
delete-branch: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
sign-commits: true
|
||||
assignees: ${{ inputs.filter-repos != '' && github.actor || '' }}
|
||||
path: extension
|
||||
- name: extension_workflow_rollout::rollout_workflows_to_extension::enable_auto_merge
|
||||
run: |
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
gh pr merge "$PR_NUMBER" --auto --squash
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
|
||||
working-directory: extension
|
||||
timeout-minutes: 10
|
||||
create_rollout_tag:
|
||||
needs:
|
||||
- rollout_workflows_to_extension
|
||||
if: inputs.filter-repos == ''
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
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_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
token: ${{ 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_tag
|
||||
run: |
|
||||
if git rev-parse "extension-workflows" >/dev/null 2>&1; then
|
||||
git tag -d "extension-workflows"
|
||||
git push origin ":refs/tags/extension-workflows" || true
|
||||
fi
|
||||
|
||||
echo "Creating new tag 'extension-workflows' at $(git rev-parse --short HEAD)"
|
||||
git tag "extension-workflows"
|
||||
git push origin "extension-workflows"
|
||||
timeout-minutes: 1
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
36
.github/workflows/good_first_issue_notifier.yml
vendored
Normal file
36
.github/workflows/good_first_issue_notifier.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Good First Issue Notifier
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
handle-good-first-issue:
|
||||
if: github.event.label.name == '.contrib/good first issue' && github.repository_owner == 'zed-industries'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
|
||||
- name: Prepare Discord message
|
||||
id: prepare-message
|
||||
env:
|
||||
ISSUE_TITLE: ${{ github.event.issue.title }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
ISSUE_URL: ${{ github.event.issue.html_url }}
|
||||
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
|
||||
run: |
|
||||
MESSAGE="[${ISSUE_TITLE} (#${ISSUE_NUMBER})](<${ISSUE_URL}>)"
|
||||
|
||||
{
|
||||
echo "message<<EOF"
|
||||
echo "$MESSAGE"
|
||||
echo "EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Discord Webhook Action
|
||||
uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164 # v5.3.0
|
||||
with:
|
||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_GOOD_FIRST_ISSUE }}
|
||||
content: ${{ steps.prepare-message.outputs.message }}
|
||||
114
.github/workflows/hotfix-review-monitor.yml
vendored
Normal file
114
.github/workflows/hotfix-review-monitor.yml
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
# Hotfix Review Monitor
|
||||
#
|
||||
# Runs daily and checks for merged PRs with the 'hotfix' label that have not
|
||||
# received a post-merge review approval within one business day. Posts a summary to
|
||||
# Slack if any are found. This is a SOC2 compensating control for the
|
||||
# emergency hotfix fast path.
|
||||
#
|
||||
# Security note: No untrusted input (PR titles, bodies, etc.) is interpolated
|
||||
# into shell commands. All PR metadata is read via gh API + jq, not via
|
||||
# github.event context expressions.
|
||||
#
|
||||
# Required secrets:
|
||||
# SLACK_WEBHOOK_PR_REVIEW_BOT - Incoming webhook URL for the #pr-review-ops channel
|
||||
|
||||
name: Hotfix Review Monitor
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 13 * * 1-5" # 1:30 PM UTC weekdays
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
check-hotfix-reviews:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
REPO: ${{ github.repository }}
|
||||
steps:
|
||||
- name: Find unreviewed hotfixes
|
||||
id: check
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# 80h lookback covers the Friday-to-Monday gap (72h) with buffer.
|
||||
# Overlap on weekdays is harmless — reviewed PRs are filtered out below.
|
||||
SINCE=$(date -u -v-80H +%Y-%m-%dT%H:%M:%SZ 2>/dev/null \
|
||||
|| date -u -d '80 hours ago' +%Y-%m-%dT%H:%M:%SZ)
|
||||
SINCE_DATE=$(echo "$SINCE" | cut -dT -f1)
|
||||
|
||||
# Use the Search API to find hotfix PRs merged in the lookback window.
|
||||
# The Pulls API with state=closed paginates through all closed PRs in
|
||||
# the repo, which times out on large repos. The Search API supports
|
||||
# merged:>DATE natively so GitHub does the filtering server-side.
|
||||
gh api --paginate \
|
||||
"search/issues?q=repo:${REPO}+is:pr+is:merged+label:hotfix+merged:>${SINCE_DATE}&per_page=100" \
|
||||
--jq '[.items[] | {number, title, merged_at: .pull_request.merged_at}]' \
|
||||
> /tmp/hotfix_prs.json
|
||||
|
||||
# Check each hotfix PR for a post-merge approving review
|
||||
jq -r '.[].number' /tmp/hotfix_prs.json | while read -r PR_NUMBER; do
|
||||
APPROVALS=$(gh api \
|
||||
"repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
|
||||
--jq "[.[] | select(.state == \"APPROVED\")] | length")
|
||||
|
||||
if [ "$APPROVALS" -eq 0 ]; then
|
||||
jq ".[] | select(.number == ${PR_NUMBER})" /tmp/hotfix_prs.json
|
||||
fi
|
||||
done | jq -s '.' > /tmp/unreviewed.json
|
||||
|
||||
COUNT=$(jq 'length' /tmp/unreviewed.json)
|
||||
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Notify Slack
|
||||
if: steps.check.outputs.count != '0'
|
||||
env:
|
||||
SLACK_WEBHOOK_PR_REVIEW_BOT: ${{ secrets.SLACK_WEBHOOK_PR_REVIEW_BOT }}
|
||||
COUNT: ${{ steps.check.outputs.count }}
|
||||
run: |
|
||||
# Build Block Kit payload from JSON — no shell interpolation of PR titles.
|
||||
# Why jq? PR titles are attacker-controllable input. By reading them
|
||||
# through jq -r from the JSON file and passing the result to jq --arg,
|
||||
# the content stays safely JSON-encoded in the final payload. Block Kit
|
||||
# doesn't change this — the same jq pipeline feeds into the blocks
|
||||
# structure instead of plain text.
|
||||
PRS=$(jq -r '.[] | "• <https://github.com/'"${REPO}"'/pull/\(.number)|#\(.number)> — \(.title) (merged \(.merged_at | split("T")[0]))"' /tmp/unreviewed.json)
|
||||
|
||||
jq -n \
|
||||
--arg count "$COUNT" \
|
||||
--arg prs "$PRS" \
|
||||
'{
|
||||
text: ($count + " hotfix PR(s) still need post-merge review"),
|
||||
blocks: [
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "mrkdwn",
|
||||
text: (":rotating_light: *" + $count + " Hotfix PR(s) Need Post-Merge Review*")
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "section",
|
||||
text: { type: "mrkdwn", text: $prs }
|
||||
},
|
||||
{ type: "divider" },
|
||||
{
|
||||
type: "context",
|
||||
elements: [{
|
||||
type: "mrkdwn",
|
||||
text: "Hotfix PRs require review within one business day of merge."
|
||||
}]
|
||||
}
|
||||
]
|
||||
}' | \
|
||||
curl -s -X POST "$SLACK_WEBHOOK_PR_REVIEW_BOT" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d @-
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
150
.github/workflows/pr_labeler.yml
vendored
Normal file
150
.github/workflows/pr_labeler.yml
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
# Labels pull requests by author: 'bot' for bot accounts, 'staff' for
|
||||
# staff team members, 'guild' for guild members, 'first contribution' for
|
||||
# first-time external contributors.
|
||||
name: PR Labeler
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-authorship-and-label:
|
||||
if: github.repository == 'zed-industries/zed'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- id: apply-authorship-label
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||
script: |
|
||||
const BOT_LABEL = 'bot';
|
||||
const STAFF_LABEL = 'staff';
|
||||
const GUILD_LABEL = 'guild';
|
||||
const FIRST_CONTRIBUTION_LABEL = 'first contribution';
|
||||
const STAFF_TEAM_SLUG = 'staff';
|
||||
const GUILD_MEMBERS = [
|
||||
'11happy',
|
||||
'AidanV',
|
||||
'AmaanBilwar',
|
||||
'MostlyKIGuess',
|
||||
'OmChillure',
|
||||
'Palanikannan1437',
|
||||
'Shivansh-25',
|
||||
'SkandaBhat',
|
||||
'TwistingTwists',
|
||||
'YEDASAVG',
|
||||
'Ziqi-Yang',
|
||||
'alanpjohn',
|
||||
'arjunkomath',
|
||||
'austincummings',
|
||||
'ayushk-1801',
|
||||
'criticic',
|
||||
'dongdong867',
|
||||
'emamulandalib',
|
||||
'eureka928',
|
||||
'feitreim',
|
||||
'iam-liam',
|
||||
'iksuddle',
|
||||
'ishaksebsib',
|
||||
'lingyaochu',
|
||||
'loadingalias',
|
||||
'marcocondrache',
|
||||
'mchisolm0',
|
||||
'nairadithya',
|
||||
'nihalxkumar',
|
||||
'notJoon',
|
||||
'polyesterswing',
|
||||
'prayanshchh',
|
||||
'razeghi71',
|
||||
'sarmadgulzar',
|
||||
'seanstrom',
|
||||
'th0jensen',
|
||||
'tommyming',
|
||||
'transitoryangel',
|
||||
'virajbhartiya',
|
||||
];
|
||||
|
||||
const pr = context.payload.pull_request;
|
||||
const author = pr.user.login;
|
||||
|
||||
if (pr.user.type === 'Bot') {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: [BOT_LABEL]
|
||||
});
|
||||
console.log(`PR #${pr.number} by ${author}: labeled '${BOT_LABEL}' (user type: '${pr.user.type}')`);
|
||||
return;
|
||||
}
|
||||
|
||||
let isStaff = false;
|
||||
try {
|
||||
const response = await github.rest.teams.getMembershipForUserInOrg({
|
||||
org: 'zed-industries',
|
||||
team_slug: STAFF_TEAM_SLUG,
|
||||
username: author
|
||||
});
|
||||
isStaff = response.data.state === 'active';
|
||||
} catch (error) {
|
||||
if (error.status !== 404) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (isStaff) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: [STAFF_LABEL]
|
||||
});
|
||||
console.log(`PR #${pr.number} by ${author}: labeled '${STAFF_LABEL}' (staff team member)`);
|
||||
return;
|
||||
}
|
||||
|
||||
const authorLower = author.toLowerCase();
|
||||
const isGuildMember = GUILD_MEMBERS.some(
|
||||
(member) => member.toLowerCase() === authorLower
|
||||
);
|
||||
if (isGuildMember) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: [GUILD_LABEL]
|
||||
});
|
||||
console.log(`PR #${pr.number} by ${author}: labeled '${GUILD_LABEL}' (guild member)`);
|
||||
// No early return: guild members can also get 'first contribution'
|
||||
}
|
||||
|
||||
// We use inverted logic here due to a suspected GitHub bug where first-time contributors
|
||||
// get 'NONE' instead of 'FIRST_TIME_CONTRIBUTOR' or 'FIRST_TIMER'.
|
||||
// https://github.com/orgs/community/discussions/78038
|
||||
// This will break if GitHub ever adds new associations.
|
||||
const association = pr.author_association;
|
||||
const knownAssociations = ['CONTRIBUTOR', 'COLLABORATOR', 'MEMBER', 'OWNER', 'MANNEQUIN'];
|
||||
|
||||
if (knownAssociations.includes(association)) {
|
||||
console.log(`PR #${pr.number} by ${author}: not a first-time contributor (association: '${association}')`);
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: [FIRST_CONTRIBUTION_LABEL]
|
||||
});
|
||||
console.log(`PR #${pr.number} by ${author}: labeled '${FIRST_CONTRIBUTION_LABEL}' (association: '${association}')`);
|
||||
129
.github/workflows/publish_extension_cli.yml
vendored
Normal file
129
.github/workflows/publish_extension_cli.yml
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
# Generated from xtask::workflows::publish_extension_cli
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: publish_extension_cli
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: '0'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- extension-cli
|
||||
jobs:
|
||||
publish_job:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- 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: publish_extension_cli::publish_job::build_extension_cli
|
||||
run: cargo build --release --package extension_cli
|
||||
- name: publish_extension_cli::publish_job::upload_binary
|
||||
run: script/upload-extension-cli "$GITHUB_SHA"
|
||||
env:
|
||||
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
|
||||
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
|
||||
update_sha_in_zed:
|
||||
needs:
|
||||
- publish_job
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- id: short-sha
|
||||
name: publish_extension_cli::get_short_sha
|
||||
run: |
|
||||
echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
|
||||
- name: publish_extension_cli::update_sha_in_zed::replace_sha
|
||||
run: |
|
||||
sed -i "s/ZED_EXTENSION_CLI_SHA: &str = \"[a-f0-9]*\"/ZED_EXTENSION_CLI_SHA: \&str = \"$GITHUB_SHA\"/" \
|
||||
tooling/xtask/src/tasks/workflows/extension_tests.rs
|
||||
- name: publish_extension_cli::update_sha_in_zed::regenerate_workflows
|
||||
run: cargo xtask workflows
|
||||
- name: steps::create_pull_request
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: 'extension_ci: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`'
|
||||
body: |
|
||||
This PR bumps the extension CLI version used in the extension workflows to `${{ github.sha }}`.
|
||||
|
||||
Release Notes:
|
||||
|
||||
- N/A
|
||||
commit-message: 'extension_ci: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`'
|
||||
branch: update-extension-cli-sha
|
||||
committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
base: main
|
||||
delete-branch: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
sign-commits: true
|
||||
assignees: ${{ github.actor }}
|
||||
update_sha_in_extensions:
|
||||
needs:
|
||||
- publish_job
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-token
|
||||
name: steps::generate_token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
repositories: extensions
|
||||
- id: short-sha
|
||||
name: publish_extension_cli::get_short_sha
|
||||
run: |
|
||||
echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
|
||||
- name: publish_extension_cli::update_sha_in_extensions::checkout_extensions_repo
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
repository: zed-industries/extensions
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: publish_extension_cli::update_sha_in_extensions::replace_sha
|
||||
run: |
|
||||
sed -i "s/ZED_EXTENSION_CLI_SHA: [a-f0-9]*/ZED_EXTENSION_CLI_SHA: $GITHUB_SHA/" \
|
||||
.github/workflows/ci.yml
|
||||
- name: steps::create_pull_request
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
|
||||
body: |
|
||||
This PR bumps the extension CLI version to https://github.com/zed-industries/zed/commit/${{ github.sha }}.
|
||||
commit-message: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
|
||||
branch: update-extension-cli-sha
|
||||
committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
|
||||
base: main
|
||||
delete-branch: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
sign-commits: true
|
||||
assignees: ${{ github.actor }}
|
||||
labels: allow-no-extension
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
36
.github/workflows/randomized_tests.yml
vendored
Normal file
36
.github/workflows/randomized_tests.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Randomized Tests
|
||||
|
||||
concurrency: randomized-tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- randomized-tests-runner
|
||||
# schedule:
|
||||
# - cron: '0 * * * *'
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: 0
|
||||
RUST_BACKTRACE: 1
|
||||
ZED_SERVER_URL: https://zed.dev
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Run randomized tests
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on:
|
||||
- namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
clean: false
|
||||
|
||||
- name: Run randomized tests
|
||||
run: script/randomized-test-ci
|
||||
892
.github/workflows/release.yml
vendored
Normal file
892
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,892 @@
|
||||
# Generated from xtask::workflows::release
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: release
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
jobs:
|
||||
run_tests_mac:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
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 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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::cargo_nextest
|
||||
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-minutes: 60
|
||||
run_tests_linux:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
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 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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::cargo_nextest
|
||||
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-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 10
|
||||
run_tests_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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than.ps1 350 200
|
||||
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::cargo_nextest
|
||||
run: 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
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
|
||||
shell: pwsh
|
||||
timeout-minutes: 60
|
||||
clippy_mac:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_sccache
|
||||
run: ./script/setup-sccache
|
||||
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
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
timeout-minutes: 60
|
||||
clippy_linux:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_sccache
|
||||
run: ./script/setup-sccache
|
||||
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
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
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
|
||||
timeout-minutes: 60
|
||||
check_scripts:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_tests::check_scripts::run_shellcheck
|
||||
run: ./script/shellcheck-scripts error
|
||||
- id: get_actionlint
|
||||
name: run_tests::check_scripts::download_actionlint
|
||||
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
||||
- name: run_tests::check_scripts::run_actionlint
|
||||
run: '"$ACTIONLINT_BIN" -color'
|
||||
env:
|
||||
ACTIONLINT_BIN: ${{ steps.get_actionlint.outputs.executable }}
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: run_tests::check_scripts::check_xtask_workflows
|
||||
run: |
|
||||
cargo xtask workflows
|
||||
if ! git diff --exit-code .github; then
|
||||
echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
|
||||
echo "Please run 'cargo xtask workflows' locally and commit the changes"
|
||||
exit 1
|
||||
fi
|
||||
timeout-minutes: 60
|
||||
create_draft_release:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- 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_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 25
|
||||
ref: ${{ github.ref }}
|
||||
- name: script/determine-release-channel
|
||||
run: script/determine-release-channel
|
||||
- name: mkdir -p target/
|
||||
run: mkdir -p target/
|
||||
- name: release::create_draft_release::generate_release_notes
|
||||
run: node --redirect-warnings=/dev/null ./script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md
|
||||
- name: release::create_draft_release::create_release
|
||||
run: script/create-draft-release target/release-notes.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
timeout-minutes: 60
|
||||
compliance_check:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- id: run-compliance-check
|
||||
name: release::add_compliance_steps::run_compliance_check
|
||||
run: |
|
||||
cargo xtask compliance version "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
|
||||
env:
|
||||
GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
continue-on-error: true
|
||||
- name: '@actions/upload-artifact compliance-report-${{ github.ref_name }}.md'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: compliance-report-${{ github.ref_name }}.md
|
||||
path: compliance-report-${{ github.ref_name }}.md
|
||||
if-no-files-found: error
|
||||
- name: send_compliance_slack_notification
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
|
||||
STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s" "$STATUS" "$ARTIFACT_URL")
|
||||
else
|
||||
STATUS="❌ Preliminary compliance check failed (but this can still be fixed while the builds are running!) for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22")
|
||||
fi
|
||||
|
||||
curl -X POST -H 'Content-type: application/json' \
|
||||
--data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
|
||||
"$SLACK_WEBHOOK"
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
|
||||
COMPLIANCE_TAG: ${{ github.ref_name }}
|
||||
ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
|
||||
outputs:
|
||||
outcome: ${{ steps.run-compliance-check.outputs.outcome }}
|
||||
timeout-minutes: 60
|
||||
bundle_linux_aarch64:
|
||||
needs:
|
||||
- run_tests_linux
|
||||
- clippy_linux
|
||||
- check_scripts
|
||||
runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-aarch64.tar.gz
|
||||
path: target/release/zed-linux-aarch64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-aarch64.gz
|
||||
path: target/zed-remote-server-linux-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_linux_x86_64:
|
||||
needs:
|
||||
- run_tests_linux
|
||||
- clippy_linux
|
||||
- check_scripts
|
||||
runs-on: namespace-profile-32x64-ubuntu-2004
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-x86_64.tar.gz
|
||||
path: target/release/zed-linux-x86_64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-x86_64.gz
|
||||
path: target/zed-remote-server-linux-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_aarch64:
|
||||
needs:
|
||||
- run_tests_mac
|
||||
- clippy_mac
|
||||
- check_scripts
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac aarch64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-aarch64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.dmg
|
||||
path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-aarch64.gz
|
||||
path: target/zed-remote-server-macos-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_x86_64:
|
||||
needs:
|
||||
- run_tests_mac
|
||||
- clippy_mac
|
||||
- check_scripts
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac x86_64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-x86_64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.dmg
|
||||
path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-x86_64.gz
|
||||
path: target/zed-remote-server-macos-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_aarch64:
|
||||
needs:
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
- check_scripts
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture aarch64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-aarch64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.exe
|
||||
path: target/Zed-aarch64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-aarch64.zip
|
||||
path: target/zed-remote-server-windows-aarch64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_x86_64:
|
||||
needs:
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
- check_scripts
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture x86_64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-x86_64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.exe
|
||||
path: target/Zed-x86_64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-x86_64.zip
|
||||
path: target/zed-remote-server-windows-x86_64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
upload_release_assets:
|
||||
needs:
|
||||
- create_draft_release
|
||||
- bundle_linux_aarch64
|
||||
- bundle_linux_x86_64
|
||||
- bundle_mac_aarch64
|
||||
- bundle_mac_x86_64
|
||||
- bundle_windows_aarch64
|
||||
- bundle_windows_x86_64
|
||||
runs-on: namespace-profile-4x8-ubuntu-2204
|
||||
steps:
|
||||
- name: release::download_workflow_artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
with:
|
||||
path: ./artifacts/
|
||||
- name: ls -lR ./artifacts
|
||||
run: ls -lR ./artifacts
|
||||
- name: release::prep_release_artifacts
|
||||
run: |-
|
||||
mkdir -p release-artifacts/
|
||||
|
||||
mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
|
||||
mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
|
||||
mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
|
||||
mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
|
||||
mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
|
||||
mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
|
||||
mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
|
||||
mv ./artifacts/zed-remote-server-macos-x86_64.gz/zed-remote-server-macos-x86_64.gz release-artifacts/zed-remote-server-macos-x86_64.gz
|
||||
mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
|
||||
mv ./artifacts/zed-remote-server-linux-x86_64.gz/zed-remote-server-linux-x86_64.gz release-artifacts/zed-remote-server-linux-x86_64.gz
|
||||
mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
|
||||
mv ./artifacts/zed-remote-server-windows-x86_64.zip/zed-remote-server-windows-x86_64.zip release-artifacts/zed-remote-server-windows-x86_64.zip
|
||||
- name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
|
||||
run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
validate_release_assets:
|
||||
needs:
|
||||
- upload_release_assets
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: release::validate_release_assets
|
||||
run: |
|
||||
EXPECTED_ASSETS='["Zed-aarch64.dmg", "Zed-x86_64.dmg", "zed-linux-aarch64.tar.gz", "zed-linux-x86_64.tar.gz", "Zed-x86_64.exe", "Zed-aarch64.exe", "zed-remote-server-macos-aarch64.gz", "zed-remote-server-macos-x86_64.gz", "zed-remote-server-linux-aarch64.gz", "zed-remote-server-linux-x86_64.gz", "zed-remote-server-windows-aarch64.zip", "zed-remote-server-windows-x86_64.zip"]'
|
||||
TAG="$GITHUB_REF_NAME"
|
||||
|
||||
ACTUAL_ASSETS=$(gh release view "$TAG" --repo=zed-industries/zed --json assets -q '[.assets[].name]')
|
||||
|
||||
MISSING_ASSETS=$(echo "$EXPECTED_ASSETS" | jq -r --argjson actual "$ACTUAL_ASSETS" '. - $actual | .[]')
|
||||
|
||||
if [ -n "$MISSING_ASSETS" ]; then
|
||||
echo "Error: The following assets are missing from the release:"
|
||||
echo "$MISSING_ASSETS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All expected assets are present in the release."
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
release_compliance_check:
|
||||
needs:
|
||||
- upload_release_assets
|
||||
- compliance_check
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- id: run-compliance-check
|
||||
name: release::add_compliance_steps::run_compliance_check
|
||||
run: |
|
||||
cargo xtask compliance version "$GITHUB_REF_NAME" --report-path "compliance-report-${GITHUB_REF_NAME}.md"
|
||||
env:
|
||||
GITHUB_APP_ID: ${{ secrets.ZED_ZIPPY_APP_ID }}
|
||||
GITHUB_APP_KEY: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
|
||||
- name: '@actions/upload-artifact compliance-report-${{ github.ref_name }}.md'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: compliance-report-${{ github.ref_name }}.md
|
||||
path: compliance-report-${{ github.ref_name }}.md
|
||||
if-no-files-found: error
|
||||
overwrite: true
|
||||
- name: send_compliance_slack_notification
|
||||
if: ${{ failure() || needs.compliance_check.outputs.outcome != 'success' }}
|
||||
run: |
|
||||
if [ "$COMPLIANCE_OUTCOME" == "success" ]; then
|
||||
STATUS="✅ Compliance check passed for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s" "$STATUS" "$ARTIFACT_URL")
|
||||
else
|
||||
STATUS="❌ Compliance check failed for $COMPLIANCE_TAG"
|
||||
MESSAGE=$(printf "%s\n\nReport: %s\nPRs needing review: %s" "$STATUS" "$ARTIFACT_URL" "https://github.com/zed-industries/zed/pulls?q=is%3Apr+is%3Aclosed+label%3A%22PR+state%3Aneeds+review%22")
|
||||
fi
|
||||
|
||||
curl -X POST -H 'Content-type: application/json' \
|
||||
--data "$(jq -n --arg text "$MESSAGE" '{"text": $text}')" \
|
||||
"$SLACK_WEBHOOK"
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
COMPLIANCE_OUTCOME: ${{ steps.run-compliance-check.outcome }}
|
||||
COMPLIANCE_TAG: ${{ github.ref_name }}
|
||||
ARTIFACT_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts
|
||||
auto_release_preview:
|
||||
needs:
|
||||
- validate_release_assets
|
||||
- release_compliance_check
|
||||
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- 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 }}
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
ref: ${{ github.ref }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: auto-release-preview
|
||||
name: release::auto_release_preview::auto_release_preview
|
||||
run: |
|
||||
tag="$GITHUB_REF_NAME"
|
||||
release_published=false
|
||||
|
||||
if [[ ! "$tag" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)-pre$ ]]; then
|
||||
echo "::error::expected preview release tag in the form vMAJOR.MINOR.PATCH-pre, got $tag"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
major="${BASH_REMATCH[1]}"
|
||||
minor="${BASH_REMATCH[2]}"
|
||||
should_release=true
|
||||
|
||||
released_preview="$(script/get-released-version preview)"
|
||||
if [[ -z "$released_preview" || "$released_preview" == "null" ]]; then
|
||||
echo "::error::could not determine released preview version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
released_preview_major="$(echo "$released_preview" | cut -d. -f1)"
|
||||
released_preview_minor="$(echo "$released_preview" | cut -d. -f2)"
|
||||
|
||||
if [[ "$released_preview_major" != "$major" || "$released_preview_minor" != "$minor" ]]; then
|
||||
should_release=false
|
||||
echo "Leaving $tag as a draft because it is the first preview release for v${major}.${minor}.x"
|
||||
fi
|
||||
|
||||
if [[ "$should_release" == "true" ]]; then
|
||||
gh release edit "$tag" --repo=zed-industries/zed --draft=false
|
||||
release_published=true
|
||||
fi
|
||||
|
||||
echo "release_published=$release_published" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
outputs:
|
||||
release_published: ${{ steps.auto-release-preview.outputs.release_published }}
|
||||
push_release_update_notification:
|
||||
needs:
|
||||
- create_draft_release
|
||||
- upload_release_assets
|
||||
- validate_release_assets
|
||||
- release_compliance_check
|
||||
- auto_release_preview
|
||||
- run_tests_mac
|
||||
- run_tests_linux
|
||||
- run_tests_windows
|
||||
- clippy_mac
|
||||
- clippy_linux
|
||||
- clippy_windows
|
||||
- check_scripts
|
||||
- bundle_linux_aarch64
|
||||
- bundle_linux_x86_64
|
||||
- bundle_mac_aarch64
|
||||
- bundle_mac_x86_64
|
||||
- bundle_windows_aarch64
|
||||
- bundle_windows_x86_64
|
||||
if: always()
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- id: generate-webhook-message
|
||||
name: release::generate_slack_message
|
||||
run: |
|
||||
MESSAGE=$(if [ "$DRAFT_RESULT" == "failure" ]; then
|
||||
echo "❌ Draft release creation failed for $TAG: $RUN_URL"
|
||||
else
|
||||
RELEASE_URL=$(gh release view "$TAG" --repo=zed-industries/zed --json url -q '.url')
|
||||
if [ "$UPLOAD_RESULT" == "failure" ]; then
|
||||
echo "❌ Release asset upload failed for $TAG: $RELEASE_URL"
|
||||
elif [ "$UPLOAD_RESULT" == "cancelled" ] || [ "$UPLOAD_RESULT" == "skipped" ]; then
|
||||
FAILED_JOBS=""
|
||||
if [ "$RESULT_RUN_TESTS_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_mac"; fi
|
||||
if [ "$RESULT_RUN_TESTS_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_linux"; fi
|
||||
if [ "$RESULT_RUN_TESTS_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS run_tests_windows"; fi
|
||||
if [ "$RESULT_CLIPPY_MAC" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_mac"; fi
|
||||
if [ "$RESULT_CLIPPY_LINUX" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_linux"; fi
|
||||
if [ "$RESULT_CLIPPY_WINDOWS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS clippy_windows"; fi
|
||||
if [ "$RESULT_CHECK_SCRIPTS" == "failure" ];then FAILED_JOBS="$FAILED_JOBS check_scripts"; fi
|
||||
if [ "$RESULT_BUNDLE_LINUX_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_aarch64"; fi
|
||||
if [ "$RESULT_BUNDLE_LINUX_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_linux_x86_64"; fi
|
||||
if [ "$RESULT_BUNDLE_MAC_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_aarch64"; fi
|
||||
if [ "$RESULT_BUNDLE_MAC_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_mac_x86_64"; fi
|
||||
if [ "$RESULT_BUNDLE_WINDOWS_AARCH64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_aarch64"; fi
|
||||
if [ "$RESULT_BUNDLE_WINDOWS_X86_64" == "failure" ];then FAILED_JOBS="$FAILED_JOBS bundle_windows_x86_64"; fi
|
||||
FAILED_JOBS=$(echo "$FAILED_JOBS" | xargs)
|
||||
if [ "$UPLOAD_RESULT" == "cancelled" ]; then
|
||||
if [ -n "$FAILED_JOBS" ]; then
|
||||
echo "❌ Release job for $TAG was cancelled, most likely because tests \`$FAILED_JOBS\` failed: $RUN_URL"
|
||||
else
|
||||
echo "❌ Release job for $TAG was cancelled: $RUN_URL"
|
||||
fi
|
||||
else
|
||||
if [ -n "$FAILED_JOBS" ]; then
|
||||
echo "❌ Tests \`$FAILED_JOBS\` for $TAG failed: $RUN_URL"
|
||||
else
|
||||
echo "❌ Tests for $TAG failed: $RUN_URL"
|
||||
fi
|
||||
fi
|
||||
elif [ "$COMPLIANCE_RESULT" == "failure" ]; then
|
||||
# We already notify within that job
|
||||
echo ""
|
||||
elif [ "$VALIDATE_RESULT" == "failure" ]; then
|
||||
echo "❌ Release validation failed for $TAG: missing assets: $RUN_URL"
|
||||
elif [ "$AUTO_RELEASE_RESULT" == "failure" ]; then
|
||||
echo "❌ Auto release failed for $TAG: $RUN_URL"
|
||||
elif [ "$AUTO_RELEASE_RESULT" == "success" ] && [ "$AUTO_RELEASE_PUBLISHED" == "true" ]; then
|
||||
echo "✅ Release $TAG was auto-released successfully: $RELEASE_URL"
|
||||
else
|
||||
echo "👀 Release $TAG sitting freshly baked in the oven and waiting to be published: $RELEASE_URL"
|
||||
fi
|
||||
fi
|
||||
)
|
||||
echo "message=$MESSAGE" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
DRAFT_RESULT: ${{ needs.create_draft_release.result }}
|
||||
UPLOAD_RESULT: ${{ needs.upload_release_assets.result }}
|
||||
VALIDATE_RESULT: ${{ needs.validate_release_assets.result }}
|
||||
COMPLIANCE_RESULT: ${{ needs.release_compliance_check.result }}
|
||||
AUTO_RELEASE_RESULT: ${{ needs.auto_release_preview.result }}
|
||||
AUTO_RELEASE_PUBLISHED: ${{ needs.auto_release_preview.outputs.release_published }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
RESULT_RUN_TESTS_MAC: ${{ needs.run_tests_mac.result }}
|
||||
RESULT_RUN_TESTS_LINUX: ${{ needs.run_tests_linux.result }}
|
||||
RESULT_RUN_TESTS_WINDOWS: ${{ needs.run_tests_windows.result }}
|
||||
RESULT_CLIPPY_MAC: ${{ needs.clippy_mac.result }}
|
||||
RESULT_CLIPPY_LINUX: ${{ needs.clippy_linux.result }}
|
||||
RESULT_CLIPPY_WINDOWS: ${{ needs.clippy_windows.result }}
|
||||
RESULT_CHECK_SCRIPTS: ${{ needs.check_scripts.result }}
|
||||
RESULT_BUNDLE_LINUX_AARCH64: ${{ needs.bundle_linux_aarch64.result }}
|
||||
RESULT_BUNDLE_LINUX_X86_64: ${{ needs.bundle_linux_x86_64.result }}
|
||||
RESULT_BUNDLE_MAC_AARCH64: ${{ needs.bundle_mac_aarch64.result }}
|
||||
RESULT_BUNDLE_MAC_X86_64: ${{ needs.bundle_mac_x86_64.result }}
|
||||
RESULT_BUNDLE_WINDOWS_AARCH64: ${{ needs.bundle_windows_aarch64.result }}
|
||||
RESULT_BUNDLE_WINDOWS_X86_64: ${{ needs.bundle_windows_x86_64.result }}
|
||||
- name: release::send_slack_message
|
||||
if: steps.generate-webhook-message.outputs.message != ''
|
||||
run: 'curl -X POST -H ''Content-type: application/json'' --data "$(jq -n --arg text "$SLACK_MESSAGE" ''{"text": $text}'')" "$SLACK_WEBHOOK"'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
SLACK_MESSAGE: ${{ steps.generate-webhook-message.outputs.message }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
559
.github/workflows/release_nightly.yml
vendored
Normal file
559
.github/workflows/release_nightly.yml
vendored
Normal file
@@ -0,0 +1,559 @@
|
||||
# Generated from xtask::workflows::release_nightly
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: release_nightly
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- nightly
|
||||
schedule:
|
||||
- cron: 0 7 * * *
|
||||
jobs:
|
||||
check_style:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
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
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than.ps1 350 200
|
||||
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::cargo_nextest
|
||||
run: 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
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: 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
|
||||
timeout-minutes: 60
|
||||
bundle_linux_aarch64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
set -eu
|
||||
version=$(git rev-parse --short HEAD)
|
||||
echo "Publishing version: ${version} on release channel nightly"
|
||||
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-aarch64.tar.gz
|
||||
path: target/release/zed-linux-aarch64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-aarch64.gz
|
||||
path: target/zed-remote-server-linux-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_linux_x86_64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: namespace-profile-32x64-ubuntu-2004
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
set -eu
|
||||
version=$(git rev-parse --short HEAD)
|
||||
echo "Publishing version: ${version} on release channel nightly"
|
||||
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-x86_64.tar.gz
|
||||
path: target/release/zed-linux-x86_64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-x86_64.gz
|
||||
path: target/zed-remote-server-linux-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_aarch64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
set -eu
|
||||
version=$(git rev-parse --short HEAD)
|
||||
echo "Publishing version: ${version} on release channel nightly"
|
||||
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac aarch64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-aarch64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.dmg
|
||||
path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-aarch64.gz
|
||||
path: target/zed-remote-server-macos-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_x86_64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
set -eu
|
||||
version=$(git rev-parse --short HEAD)
|
||||
echo "Publishing version: ${version} on release channel nightly"
|
||||
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac x86_64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-x86_64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.dmg
|
||||
path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-x86_64.gz
|
||||
path: target/zed-remote-server-macos-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_aarch64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
$version = git rev-parse --short HEAD
|
||||
Write-Host "Publishing version: $version on release channel nightly"
|
||||
"nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture aarch64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-aarch64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.exe
|
||||
path: target/Zed-aarch64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-aarch64.zip
|
||||
path: target/zed-remote-server-windows-aarch64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_x86_64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
- clippy_windows
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_bundling::set_release_channel_to_nightly
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
$version = git rev-parse --short HEAD
|
||||
Write-Host "Publishing version: $version on release channel nightly"
|
||||
"nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL"
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture x86_64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-x86_64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.exe
|
||||
path: target/Zed-x86_64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-x86_64.zip
|
||||
path: target/zed-remote-server-windows-x86_64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
build_nix_linux_x86_64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_nix_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: nix
|
||||
- name: nix_build::build_nix::install_nix
|
||||
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- 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_nix::build
|
||||
run: nix build .#default -L --accept-flake-config
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
build_nix_mac_aarch64:
|
||||
needs:
|
||||
- check_style
|
||||
- run_tests_windows
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-mac-large
|
||||
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_nix_store_macos
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
path: ~/nix-cache
|
||||
- name: nix_build::build_nix::install_nix
|
||||
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: nix_build::build_nix::configure_local_nix_cache
|
||||
run: |
|
||||
mkdir -p ~/nix-cache
|
||||
echo "extra-substituters = file://$HOME/nix-cache?priority=10" | sudo tee -a /etc/nix/nix.conf
|
||||
echo "require-sigs = false" | sudo tee -a /etc/nix/nix.conf
|
||||
sudo launchctl kickstart -k system/org.nixos.nix-daemon
|
||||
- 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_nix::build
|
||||
run: nix build .#default -L --accept-flake-config
|
||||
- name: nix_build::build_nix::export_to_local_nix_cache
|
||||
if: always()
|
||||
run: |
|
||||
if [ -L result ]; then
|
||||
echo "Copying build closure to local binary cache..."
|
||||
nix copy --to "file://$HOME/nix-cache" ./result || echo "Warning: nix copy to local cache failed"
|
||||
else
|
||||
echo "No build result found, skipping cache export."
|
||||
fi
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
update_nightly_tag:
|
||||
needs:
|
||||
- bundle_linux_aarch64
|
||||
- bundle_linux_x86_64
|
||||
- bundle_mac_aarch64
|
||||
- bundle_mac_x86_64
|
||||
- bundle_windows_aarch64
|
||||
- bundle_windows_x86_64
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-4x8-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- name: release::download_workflow_artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
with:
|
||||
path: ./artifacts/
|
||||
- name: ls -lR ./artifacts
|
||||
run: ls -lR ./artifacts
|
||||
- name: release::prep_release_artifacts
|
||||
run: |-
|
||||
mkdir -p release-artifacts/
|
||||
|
||||
mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg
|
||||
mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg
|
||||
mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz
|
||||
mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz
|
||||
mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe
|
||||
mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe
|
||||
mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz
|
||||
mv ./artifacts/zed-remote-server-macos-x86_64.gz/zed-remote-server-macos-x86_64.gz release-artifacts/zed-remote-server-macos-x86_64.gz
|
||||
mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz
|
||||
mv ./artifacts/zed-remote-server-linux-x86_64.gz/zed-remote-server-linux-x86_64.gz release-artifacts/zed-remote-server-linux-x86_64.gz
|
||||
mv ./artifacts/zed-remote-server-windows-aarch64.zip/zed-remote-server-windows-aarch64.zip release-artifacts/zed-remote-server-windows-aarch64.zip
|
||||
mv ./artifacts/zed-remote-server-windows-x86_64.zip/zed-remote-server-windows-x86_64.zip release-artifacts/zed-remote-server-windows-x86_64.zip
|
||||
- name: ./script/upload-nightly
|
||||
run: ./script/upload-nightly
|
||||
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 github-actions@github.com
|
||||
git tag -f nightly
|
||||
git push origin nightly --force
|
||||
- name: release::create_sentry_release
|
||||
uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c
|
||||
with:
|
||||
environment: production
|
||||
env:
|
||||
SENTRY_ORG: zed-dev
|
||||
SENTRY_PROJECT: zed
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
timeout-minutes: 60
|
||||
notify_on_failure:
|
||||
needs:
|
||||
- bundle_linux_aarch64
|
||||
- bundle_linux_x86_64
|
||||
- bundle_mac_aarch64
|
||||
- bundle_mac_x86_64
|
||||
- bundle_windows_aarch64
|
||||
- bundle_windows_x86_64
|
||||
if: failure()
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: release::send_slack_message
|
||||
run: 'curl -X POST -H ''Content-type: application/json'' --data "$(jq -n --arg text "$SLACK_MESSAGE" ''{"text": $text}'')" "$SLACK_WEBHOOK"'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
||||
SLACK_MESSAGE: '❌ ${{ github.workflow }} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
351
.github/workflows/run_bundling.yml
vendored
Normal file
351
.github/workflows/run_bundling.yml
vendored
Normal file
@@ -0,0 +1,351 @@
|
||||
# Generated from xtask::workflows::run_bundling
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: run_bundling
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
- synchronize
|
||||
jobs:
|
||||
bundle_linux_aarch64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-aarch64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-aarch64.tar.gz
|
||||
path: target/release/zed-linux-aarch64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-aarch64.gz
|
||||
path: target/zed-remote-server-linux-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_linux_x86_64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: namespace-profile-32x64-ubuntu-2004
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
CC: clang-18
|
||||
CXX: clang++-18
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::setup_linux
|
||||
run: ./script/linux
|
||||
- name: steps::download_wasi_sdk
|
||||
run: ./script/download-wasi-sdk
|
||||
- name: ./script/bundle-linux
|
||||
run: ./script/bundle-linux
|
||||
- name: '@actions/upload-artifact zed-linux-x86_64.tar.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-linux-x86_64.tar.gz
|
||||
path: target/release/zed-linux-x86_64.tar.gz
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-linux-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-linux-x86_64.gz
|
||||
path: target/zed-remote-server-linux-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_aarch64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac aarch64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-aarch64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.dmg
|
||||
path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-aarch64.gz
|
||||
path: target/zed-remote-server-macos-aarch64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_mac_x86_64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: namespace-profile-mac-large
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
|
||||
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
|
||||
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: run_bundling::bundle_mac::bundle_mac
|
||||
run: ./script/bundle-mac x86_64-apple-darwin
|
||||
- name: '@actions/upload-artifact Zed-x86_64.dmg'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.dmg
|
||||
path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-macos-x86_64.gz'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-macos-x86_64.gz
|
||||
path: target/zed-remote-server-macos-x86_64.gz
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_aarch64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture aarch64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-aarch64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-aarch64.exe
|
||||
path: target/Zed-aarch64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-aarch64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-aarch64.zip
|
||||
path: target/zed-remote-server-windows-aarch64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
bundle_windows_x86_64:
|
||||
if: |-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
|
||||
runs-on: self-32vcpu-windows-2022
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
|
||||
ACCOUNT_NAME: ${{ vars.AZURE_SIGNING_ACCOUNT_NAME }}
|
||||
CERT_PROFILE_NAME: ${{ vars.AZURE_SIGNING_CERT_PROFILE_NAME }}
|
||||
ENDPOINT: ${{ vars.AZURE_SIGNING_ENDPOINT }}
|
||||
FILE_DIGEST: SHA256
|
||||
TIMESTAMP_DIGEST: SHA256
|
||||
TIMESTAMP_SERVER: http://timestamp.acs.microsoft.com
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_sentry
|
||||
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
|
||||
with:
|
||||
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
- name: run_bundling::bundle_windows::bundle_windows
|
||||
run: script/bundle-windows.ps1 -Architecture x86_64
|
||||
shell: pwsh
|
||||
working-directory: ${{ env.ZED_WORKSPACE }}
|
||||
- name: '@actions/upload-artifact Zed-x86_64.exe'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: Zed-x86_64.exe
|
||||
path: target/Zed-x86_64.exe
|
||||
if-no-files-found: error
|
||||
- name: '@actions/upload-artifact zed-remote-server-windows-x86_64.zip'
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
with:
|
||||
name: zed-remote-server-windows-x86_64.zip
|
||||
path: target/zed-remote-server-windows-x86_64.zip
|
||||
if-no-files-found: error
|
||||
timeout-minutes: 60
|
||||
build_nix_linux_x86_64:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && github.event.label.name == 'run-bundling') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling')))
|
||||
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_nix_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: nix
|
||||
- name: nix_build::build_nix::install_nix
|
||||
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- 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.]*
|
||||
- name: nix_build::build_nix::build
|
||||
run: nix build .#default -L --accept-flake-config
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
build_nix_mac_aarch64:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && github.event.label.name == 'run-bundling') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling')))
|
||||
runs-on: namespace-profile-mac-large
|
||||
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_nix_store_macos
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
path: ~/nix-cache
|
||||
- name: nix_build::build_nix::install_nix
|
||||
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: nix_build::build_nix::configure_local_nix_cache
|
||||
run: |
|
||||
mkdir -p ~/nix-cache
|
||||
echo "extra-substituters = file://$HOME/nix-cache?priority=10" | sudo tee -a /etc/nix/nix.conf
|
||||
echo "require-sigs = false" | sudo tee -a /etc/nix/nix.conf
|
||||
sudo launchctl kickstart -k system/org.nixos.nix-daemon
|
||||
- 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.]*
|
||||
- name: nix_build::build_nix::build
|
||||
run: nix build .#default -L --accept-flake-config
|
||||
- name: nix_build::build_nix::export_to_local_nix_cache
|
||||
if: always()
|
||||
run: |
|
||||
if [ -L result ]; then
|
||||
echo "Copying build closure to local binary cache..."
|
||||
nix copy --to "file://$HOME/nix-cache" ./result || echo "Warning: nix copy to local cache failed"
|
||||
else
|
||||
echo "No build result found, skipping cache export."
|
||||
fi
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
79
.github/workflows/run_cron_unit_evals.yml
vendored
Normal file
79
.github/workflows/run_cron_unit_evals.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# Generated from xtask::workflows::run_cron_unit_evals
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: run_cron_unit_evals
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: '0'
|
||||
RUST_BACKTRACE: '1'
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
cron_unit_evals:
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
strategy:
|
||||
matrix:
|
||||
model:
|
||||
- anthropic/claude-sonnet-4-5-latest
|
||||
- anthropic/claude-opus-4-5-latest
|
||||
- google/gemini-3.1-pro
|
||||
- openai/gpt-5
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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::cargo_install_nextest
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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: ./script/run-unit-evals
|
||||
run: ./script/run-unit-evals
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
GOOGLE_AI_API_KEY: ${{ secrets.GOOGLE_AI_API_KEY }}
|
||||
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
|
||||
ZED_AGENT_MODEL: ${{ matrix.model }}
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
- name: run_agent_evals::cron_unit_evals::send_failure_to_slack
|
||||
if: ${{ failure() }}
|
||||
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52
|
||||
with:
|
||||
method: chat.postMessage
|
||||
token: ${{ secrets.SLACK_APP_ZED_UNIT_EVALS_BOT_TOKEN }}
|
||||
payload: |
|
||||
channel: C04UDRNNJFQ
|
||||
text: "Unit Evals Failed: https://github.com/zed-industries/zed/actions/runs/${{ github.run_id }}"
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
873
.github/workflows/run_tests.yml
vendored
Normal file
873
.github/workflows/run_tests.yml
vendored
Normal file
@@ -0,0 +1,873 @@
|
||||
# Generated from xtask::workflows::run_tests
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: run_tests
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: '1'
|
||||
CARGO_INCREMENTAL: '0'
|
||||
on:
|
||||
merge_group: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v[0-9]+.[0-9]+.x
|
||||
jobs:
|
||||
orchestrate:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
|
||||
- id: filter
|
||||
name: filter
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$GITHUB_BASE_REF" ]; then
|
||||
echo "Not in a PR context (i.e., push to main/stable/preview)"
|
||||
COMPARE_REV="$(git rev-parse HEAD~1)"
|
||||
else
|
||||
echo "In a PR context comparing to pull_request.base.ref"
|
||||
git fetch origin "$GITHUB_BASE_REF" --depth=350
|
||||
COMPARE_REV="$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)"
|
||||
fi
|
||||
CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" "$GITHUB_SHA")"
|
||||
|
||||
check_pattern() {
|
||||
local output_name="$1"
|
||||
local pattern="$2"
|
||||
local grep_arg="$3"
|
||||
|
||||
echo "$CHANGED_FILES" | grep "$grep_arg" "$pattern" && \
|
||||
echo "${output_name}=true" >> "$GITHUB_OUTPUT" || \
|
||||
echo "${output_name}=false" >> "$GITHUB_OUTPUT"
|
||||
}
|
||||
|
||||
# Check for changes that require full rebuild (no filter)
|
||||
# Direct pushes to main/stable/preview always run full suite
|
||||
if [ -z "$GITHUB_BASE_REF" ]; then
|
||||
echo "Not a PR, running full test suite"
|
||||
echo "changed_packages=" >> "$GITHUB_OUTPUT"
|
||||
elif echo "$CHANGED_FILES" | grep -qP '^(rust-toolchain\.toml|\.cargo/|\.github/|Cargo\.(toml|lock)$)'; then
|
||||
echo "Toolchain, cargo config, or root Cargo files changed, will run all tests"
|
||||
echo "changed_packages=" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
# Extract changed directories from file paths
|
||||
CHANGED_DIRS=$(echo "$CHANGED_FILES" | \
|
||||
grep -oP '^(crates|tooling)/\K[^/]+' | \
|
||||
sort -u || true)
|
||||
|
||||
# Build directory-to-package mapping using cargo metadata
|
||||
DIR_TO_PKG=$(cargo metadata --format-version=1 --no-deps 2>/dev/null | \
|
||||
jq -r '.packages[] | select(.manifest_path | test("crates/|tooling/")) | "\(.manifest_path | capture("(crates|tooling)/(?<dir>[^/]+)") | .dir)=\(.name)"')
|
||||
|
||||
# Map directory names to package names
|
||||
FILE_CHANGED_PKGS=""
|
||||
for dir in $CHANGED_DIRS; do
|
||||
pkg=$(echo "$DIR_TO_PKG" | grep "^${dir}=" | cut -d= -f2 | head -1)
|
||||
if [ -n "$pkg" ]; then
|
||||
FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg")
|
||||
else
|
||||
# Fall back to directory name if no mapping found
|
||||
FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$dir")
|
||||
fi
|
||||
done
|
||||
FILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)
|
||||
|
||||
# If assets/ changed, add crates that depend on those assets
|
||||
if echo "$CHANGED_FILES" | grep -qP '^assets/'; then
|
||||
FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "assets" | sort -u)
|
||||
fi
|
||||
|
||||
# Combine all changed packages
|
||||
ALL_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' || true)
|
||||
|
||||
if [ -z "$ALL_CHANGED_PKGS" ]; then
|
||||
echo "No package changes detected, will run all tests"
|
||||
echo "changed_packages=" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
# Build nextest filterset with rdeps for each package
|
||||
FILTERSET=$(echo "$ALL_CHANGED_PKGS" | \
|
||||
sed 's/.*/rdeps(&)/' | \
|
||||
tr '\n' '|' | \
|
||||
sed 's/|$//')
|
||||
echo "Changed packages filterset: $FILTERSET"
|
||||
echo "changed_packages=$FILTERSET" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
fi
|
||||
|
||||
check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP
|
||||
check_pattern "run_docs" '^(docs/|crates/.*\.rs)' -qP
|
||||
check_pattern "run_licenses" '^(Cargo.lock|script/.*licenses)' -qP
|
||||
check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|extensions/)' -qvP
|
||||
# Detect changed extension directories (excluding extensions/workflows)
|
||||
CHANGED_EXTENSIONS=$(echo "$CHANGED_FILES" | grep -oP '^extensions/[^/]+(?=/)' | sort -u | grep -v '^extensions/workflows$' || true)
|
||||
# Filter out deleted extensions
|
||||
EXISTING_EXTENSIONS=""
|
||||
for ext in $CHANGED_EXTENSIONS; do
|
||||
if [ -f "$ext/extension.toml" ]; then
|
||||
EXISTING_EXTENSIONS=$(printf '%s\n%s' "$EXISTING_EXTENSIONS" "$ext")
|
||||
fi
|
||||
done
|
||||
CHANGED_EXTENSIONS=$(echo "$EXISTING_EXTENSIONS" | sed '/^$/d')
|
||||
if [ -n "$CHANGED_EXTENSIONS" ]; then
|
||||
EXTENSIONS_JSON=$(echo "$CHANGED_EXTENSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
else
|
||||
EXTENSIONS_JSON="[]"
|
||||
fi
|
||||
echo "changed_extensions=$EXTENSIONS_JSON" >> "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
changed_packages: ${{ steps.filter.outputs.changed_packages }}
|
||||
run_action_checks: ${{ steps.filter.outputs.run_action_checks }}
|
||||
run_docs: ${{ steps.filter.outputs.run_docs }}
|
||||
run_licenses: ${{ steps.filter.outputs.run_licenses }}
|
||||
run_tests: ${{ steps.filter.outputs.run_tests }}
|
||||
changed_extensions: ${{ steps.filter.outputs.changed_extensions }}
|
||||
check_style:
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-4x8-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: steps::setup_pnpm
|
||||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
|
||||
with:
|
||||
version: '9'
|
||||
- name: steps::prettier
|
||||
run: ./script/prettier
|
||||
- name: steps::cargo_fmt
|
||||
run: cargo fmt --all -- --check
|
||||
- name: ./script/check-todos
|
||||
run: ./script/check-todos
|
||||
- name: ./script/check-keymaps
|
||||
run: ./script/check-keymaps
|
||||
- name: run_tests::check_style::check_for_typos
|
||||
uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06
|
||||
with:
|
||||
config: ./typos.toml
|
||||
- name: run_tests::fetch_ts_query_ls
|
||||
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
|
||||
with:
|
||||
repo: ribru17/ts_query_ls
|
||||
version: tags/v3.15.1
|
||||
file: ts_query_ls-x86_64-unknown-linux-gnu.tar.gz
|
||||
- name: run_tests::run_ts_query_ls
|
||||
run: |-
|
||||
tar -xf "$GITHUB_WORKSPACE/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz" -C "$GITHUB_WORKSPACE"
|
||||
"$GITHUB_WORKSPACE/ts_query_ls" format --check . || {
|
||||
echo "Found unformatted queries, please format them with ts_query_ls."
|
||||
echo "For easy use, install the Tree-sitter query extension:"
|
||||
echo "zed://extension/tree-sitter-query"
|
||||
false
|
||||
}
|
||||
timeout-minutes: 60
|
||||
clippy_windows:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
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
|
||||
timeout-minutes: 60
|
||||
clippy_linux:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_sccache
|
||||
run: ./script/setup-sccache
|
||||
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
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
timeout-minutes: 60
|
||||
clippy_mac:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_sccache
|
||||
run: ./script/setup-sccache
|
||||
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
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
timeout-minutes: 60
|
||||
clippy_mac_x86_64:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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::install_rustup_target
|
||||
run: rustup target add x86_64-apple-darwin
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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 --target x86_64-apple-darwin
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
timeout-minutes: 60
|
||||
run_tests_windows:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than.ps1 350 200
|
||||
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::cargo_nextest
|
||||
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
|
||||
shell: pwsh
|
||||
- name: steps::show_sccache_stats
|
||||
run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
|
||||
shell: pwsh
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
|
||||
shell: pwsh
|
||||
timeout-minutes: 60
|
||||
run_tests_linux:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
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 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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::cargo_nextest
|
||||
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-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 10
|
||||
run_tests_mac:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
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 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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::cargo_nextest
|
||||
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-minutes: 60
|
||||
doctests:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- 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_cargo_config
|
||||
run: |
|
||||
mkdir -p ./../.cargo
|
||||
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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
|
||||
- id: run_doctests
|
||||
name: run_tests::doctests::run_doctests
|
||||
run: |
|
||||
cargo test --workspace --doc --no-fail-fast
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-minutes: 60
|
||||
check_workspace_binaries:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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_sccache
|
||||
run: ./script/setup-sccache
|
||||
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: cargo build -p collab
|
||||
run: cargo build -p collab
|
||||
- name: cargo build --workspace --bins --examples
|
||||
run: cargo build --workspace --bins --examples
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-minutes: 60
|
||||
build_visual_tests_binary:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-mac-large
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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: run_tests::build_visual_tests_binary::cargo_build_visual_tests
|
||||
run: cargo build -p zed --bin zed_visual_test_runner --features visual-tests
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
check_wasm:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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: run_tests::check_wasm::install_nightly_wasm_toolchain
|
||||
run: rustup toolchain install nightly --component rust-src --target wasm32-unknown-unknown
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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: run_tests::check_wasm::cargo_check_wasm
|
||||
run: cargo -Zbuild-std=std,panic_abort check --target wasm32-unknown-unknown -p gpui_platform
|
||||
env:
|
||||
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS: -C target-feature=+atomics,+bulk-memory,+mutable-globals
|
||||
RUSTC_BOOTSTRAP: '1'
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
timeout-minutes: 60
|
||||
check_dependencies:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: run_tests::check_dependencies::install_cargo_machete
|
||||
uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507
|
||||
with:
|
||||
tool: cargo-machete@0.7.0
|
||||
- name: run_tests::check_dependencies::run_cargo_machete
|
||||
run: cargo machete
|
||||
- name: run_tests::check_dependencies::check_cargo_lock
|
||||
run: cargo update --locked --workspace
|
||||
- name: run_tests::check_dependencies::check_vulnerable_dependencies
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8
|
||||
with:
|
||||
license-check: false
|
||||
timeout-minutes: 60
|
||||
check_docs:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_docs == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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: ./script/generate-action-metadata
|
||||
run: ./script/generate-action-metadata
|
||||
- name: deploy_docs::lychee_link_check
|
||||
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
|
||||
with:
|
||||
args: --no-progress --exclude '^http' './docs/src/**/*'
|
||||
fail: true
|
||||
jobSummary: false
|
||||
- name: deploy_docs::install_mdbook
|
||||
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08
|
||||
with:
|
||||
mdbook-version: 0.4.37
|
||||
- name: deploy_docs::build_docs_book
|
||||
run: |
|
||||
mkdir -p target/deploy
|
||||
mdbook build ./docs --dest-dir=../target/deploy/docs/
|
||||
env:
|
||||
DOCS_CHANNEL: stable
|
||||
MDBOOK_BOOK__SITE_URL: /docs/
|
||||
- name: deploy_docs::lychee_link_check
|
||||
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
|
||||
with:
|
||||
args: --no-progress --exclude '^http' 'target/deploy/docs'
|
||||
fail: true
|
||||
jobSummary: false
|
||||
timeout-minutes: 60
|
||||
check_licenses:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_licenses == 'true' && github.event_name != 'merge_group'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: ./script/check-licenses
|
||||
run: ./script/check-licenses
|
||||
- name: ./script/generate-licenses
|
||||
run: ./script/generate-licenses
|
||||
check_scripts:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_action_checks == 'true'
|
||||
runs-on: namespace-profile-8x16-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: run_tests::check_scripts::run_shellcheck
|
||||
run: ./script/shellcheck-scripts error
|
||||
- id: get_actionlint
|
||||
name: run_tests::check_scripts::download_actionlint
|
||||
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
||||
- name: run_tests::check_scripts::run_actionlint
|
||||
run: '"$ACTIONLINT_BIN" -color'
|
||||
env:
|
||||
ACTIONLINT_BIN: ${{ steps.get_actionlint.outputs.executable }}
|
||||
- name: steps::cache_rust_dependencies_namespace
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
||||
with:
|
||||
cache: rust
|
||||
path: ~/.rustup
|
||||
- name: run_tests::check_scripts::check_xtask_workflows
|
||||
run: |
|
||||
cargo xtask workflows
|
||||
if ! git diff --exit-code .github; then
|
||||
echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
|
||||
echo "Please run 'cargo xtask workflows' locally and commit the changes"
|
||||
exit 1
|
||||
fi
|
||||
timeout-minutes: 60
|
||||
check_postgres_and_protobuf_migrations:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.run_tests == 'true'
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
env:
|
||||
GIT_AUTHOR_NAME: Protobuf Action
|
||||
GIT_AUTHOR_EMAIL: ci@zed.dev
|
||||
GIT_COMMITTER_NAME: Protobuf Action
|
||||
GIT_COMMITTER_EMAIL: ci@zed.dev
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
fetch-depth: 0
|
||||
- name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
|
||||
run: |
|
||||
if [ -z "$GITHUB_BASE_REF" ];
|
||||
then
|
||||
echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
|
||||
else
|
||||
git checkout -B temp
|
||||
git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
|
||||
echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
|
||||
fi
|
||||
- name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
|
||||
uses: bufbuild/buf-setup-action@v1
|
||||
with:
|
||||
version: v1.29.0
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
|
||||
uses: bufbuild/buf-breaking-action@v1
|
||||
with:
|
||||
input: crates/proto/proto/
|
||||
against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
|
||||
- name: run_tests::check_postgres_and_protobuf_migrations::buf_lint
|
||||
run: buf lint crates/proto/proto
|
||||
- name: run_tests::check_postgres_and_protobuf_migrations::check_protobuf_formatting
|
||||
run: buf format --diff --exit-code crates/proto/proto
|
||||
timeout-minutes: 60
|
||||
extension_tests:
|
||||
needs:
|
||||
- orchestrate
|
||||
if: needs.orchestrate.outputs.changed_extensions != '[]'
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
matrix:
|
||||
extension: ${{ fromJson(needs.orchestrate.outputs.changed_extensions) }}
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
uses: ./.github/workflows/extension_tests.yml
|
||||
with:
|
||||
working-directory: ${{ matrix.extension }}
|
||||
tests_pass:
|
||||
needs:
|
||||
- orchestrate
|
||||
- check_style
|
||||
- clippy_windows
|
||||
- clippy_linux
|
||||
- clippy_mac
|
||||
- clippy_mac_x86_64
|
||||
- run_tests_windows
|
||||
- run_tests_linux
|
||||
- run_tests_mac
|
||||
- doctests
|
||||
- check_workspace_binaries
|
||||
- build_visual_tests_binary
|
||||
- check_wasm
|
||||
- check_dependencies
|
||||
- check_docs
|
||||
- check_licenses
|
||||
- check_scripts
|
||||
- extension_tests
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
steps:
|
||||
- name: run_tests::tests_pass
|
||||
run: |
|
||||
set +x
|
||||
EXIT_CODE=0
|
||||
|
||||
check_result() {
|
||||
echo "* $1: $2"
|
||||
if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
|
||||
}
|
||||
|
||||
check_result "orchestrate" "$RESULT_ORCHESTRATE"
|
||||
check_result "check_style" "$RESULT_CHECK_STYLE"
|
||||
check_result "clippy_windows" "$RESULT_CLIPPY_WINDOWS"
|
||||
check_result "clippy_linux" "$RESULT_CLIPPY_LINUX"
|
||||
check_result "clippy_mac" "$RESULT_CLIPPY_MAC"
|
||||
check_result "clippy_mac_x86_64" "$RESULT_CLIPPY_MAC_X86_64"
|
||||
check_result "run_tests_windows" "$RESULT_RUN_TESTS_WINDOWS"
|
||||
check_result "run_tests_linux" "$RESULT_RUN_TESTS_LINUX"
|
||||
check_result "run_tests_mac" "$RESULT_RUN_TESTS_MAC"
|
||||
check_result "doctests" "$RESULT_DOCTESTS"
|
||||
check_result "check_workspace_binaries" "$RESULT_CHECK_WORKSPACE_BINARIES"
|
||||
check_result "build_visual_tests_binary" "$RESULT_BUILD_VISUAL_TESTS_BINARY"
|
||||
check_result "check_wasm" "$RESULT_CHECK_WASM"
|
||||
check_result "check_dependencies" "$RESULT_CHECK_DEPENDENCIES"
|
||||
check_result "check_docs" "$RESULT_CHECK_DOCS"
|
||||
check_result "check_licenses" "$RESULT_CHECK_LICENSES"
|
||||
check_result "check_scripts" "$RESULT_CHECK_SCRIPTS"
|
||||
check_result "extension_tests" "$RESULT_EXTENSION_TESTS"
|
||||
|
||||
exit $EXIT_CODE
|
||||
env:
|
||||
RESULT_ORCHESTRATE: ${{ needs.orchestrate.result }}
|
||||
RESULT_CHECK_STYLE: ${{ needs.check_style.result }}
|
||||
RESULT_CLIPPY_WINDOWS: ${{ needs.clippy_windows.result }}
|
||||
RESULT_CLIPPY_LINUX: ${{ needs.clippy_linux.result }}
|
||||
RESULT_CLIPPY_MAC: ${{ needs.clippy_mac.result }}
|
||||
RESULT_CLIPPY_MAC_X86_64: ${{ needs.clippy_mac_x86_64.result }}
|
||||
RESULT_RUN_TESTS_WINDOWS: ${{ needs.run_tests_windows.result }}
|
||||
RESULT_RUN_TESTS_LINUX: ${{ needs.run_tests_linux.result }}
|
||||
RESULT_RUN_TESTS_MAC: ${{ needs.run_tests_mac.result }}
|
||||
RESULT_DOCTESTS: ${{ needs.doctests.result }}
|
||||
RESULT_CHECK_WORKSPACE_BINARIES: ${{ needs.check_workspace_binaries.result }}
|
||||
RESULT_BUILD_VISUAL_TESTS_BINARY: ${{ needs.build_visual_tests_binary.result }}
|
||||
RESULT_CHECK_WASM: ${{ needs.check_wasm.result }}
|
||||
RESULT_CHECK_DEPENDENCIES: ${{ needs.check_dependencies.result }}
|
||||
RESULT_CHECK_DOCS: ${{ needs.check_docs.result }}
|
||||
RESULT_CHECK_LICENSES: ${{ needs.check_licenses.result }}
|
||||
RESULT_CHECK_SCRIPTS: ${{ needs.check_scripts.result }}
|
||||
RESULT_EXTENSION_TESTS: ${{ needs.extension_tests.result }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
73
.github/workflows/run_unit_evals.yml
vendored
Normal file
73
.github/workflows/run_unit_evals.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Generated from xtask::workflows::run_unit_evals
|
||||
# Rebuild with `cargo xtask workflows`.
|
||||
name: run_unit_evals
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: '0'
|
||||
RUST_BACKTRACE: '1'
|
||||
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
||||
ZED_EVAL_TELEMETRY: '1'
|
||||
MODEL_NAME: ${{ inputs.model_name }}
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
model_name:
|
||||
description: model_name
|
||||
required: true
|
||||
type: string
|
||||
commit_sha:
|
||||
description: commit_sha
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
run_unit_evals:
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- name: steps::checkout_repo
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
||||
with:
|
||||
clean: false
|
||||
- name: steps::setup_cargo_config
|
||||
run: |
|
||||
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::cargo_install_nextest
|
||||
uses: taiki-e/install-action@921e2c9f7148d7ba14cd819f417db338f63e733c
|
||||
- name: steps::clear_target_dir_if_large
|
||||
run: ./script/clear-target-dir-if-larger-than 350 200
|
||||
- name: steps::setup_sccache
|
||||
run: ./script/setup-sccache
|
||||
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: ./script/run-unit-evals
|
||||
run: ./script/run-unit-evals
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
GOOGLE_AI_API_KEY: ${{ secrets.GOOGLE_AI_API_KEY }}
|
||||
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
|
||||
UNIT_EVAL_COMMIT: ${{ inputs.commit_sha }}
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ./../.cargo
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.run_id }}
|
||||
cancel-in-progress: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
104
.github/workflows/slack_notify_first_responders.yml
vendored
Normal file
104
.github/workflows/slack_notify_first_responders.yml
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
name: Slack Notify First Responders
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
env:
|
||||
FIRST_RESPONDER_LABELS: '["priority:P0", "priority:P1"]'
|
||||
|
||||
jobs:
|
||||
notify-slack:
|
||||
if: github.repository_owner == 'zed-industries' && github.event.issue.state == 'open'
|
||||
runs-on: namespace-profile-2x4-ubuntu-2404
|
||||
|
||||
steps:
|
||||
- name: Check if label requires first responder notification
|
||||
id: check-label
|
||||
env:
|
||||
LABEL_NAME: ${{ github.event.label.name }}
|
||||
FIRST_RESPONDER_LABELS: ${{ env.FIRST_RESPONDER_LABELS }}
|
||||
run: |
|
||||
if echo "$FIRST_RESPONDER_LABELS" | jq -e --arg label "$LABEL_NAME" 'index($label) != null' > /dev/null; then
|
||||
echo "should_notify=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Label '$LABEL_NAME' requires first responder notification"
|
||||
else
|
||||
echo "should_notify=false" >> "$GITHUB_OUTPUT"
|
||||
echo "Label '$LABEL_NAME' does not require first responder notification, skipping"
|
||||
fi
|
||||
|
||||
- name: Build Slack message payload
|
||||
if: steps.check-label.outputs.should_notify == 'true'
|
||||
env:
|
||||
ISSUE_TITLE: ${{ github.event.issue.title }}
|
||||
ISSUE_URL: ${{ github.event.issue.html_url }}
|
||||
LABELED_BY: ${{ github.event.sender.login }}
|
||||
LABEL_NAME: ${{ github.event.label.name }}
|
||||
LABELS_JSON: ${{ toJson(github.event.issue.labels.*.name) }}
|
||||
run: |
|
||||
LABELS=$(echo "$LABELS_JSON" | jq -r 'join(", ")')
|
||||
|
||||
jq -n \
|
||||
--arg label_name "$LABEL_NAME" \
|
||||
--arg issue_title "$ISSUE_TITLE" \
|
||||
--arg issue_url "$ISSUE_URL" \
|
||||
--arg labeled_by "$LABELED_BY" \
|
||||
--arg labels "$LABELS" \
|
||||
'{
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "<!subteam^S096CPUUGLF> Issue labeled *\($label_name)*"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Issue:*\n<\($issue_url)|\($issue_title)>"
|
||||
},
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Labeled by:*\n\($labeled_by)"
|
||||
},
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Labels:*\n\($labels)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}' > payload.json
|
||||
|
||||
echo "Payload built successfully:"
|
||||
cat payload.json
|
||||
|
||||
- name: Send Slack notification
|
||||
if: steps.check-label.outputs.should_notify == 'true'
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_FIRST_RESPONDERS }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
||||
echo "::error::SLACK_WEBHOOK_FIRST_RESPONDERS secret is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HTTP_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$SLACK_WEBHOOK_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @payload.json)
|
||||
|
||||
HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed '$d')
|
||||
HTTP_STATUS=$(echo "$HTTP_RESPONSE" | tail -n 1)
|
||||
|
||||
echo "Slack API response status: $HTTP_STATUS"
|
||||
echo "Slack API response body: $HTTP_BODY"
|
||||
|
||||
if [ "$HTTP_STATUS" -ne 200 ]; then
|
||||
echo "::error::Slack notification failed with status $HTTP_STATUS: $HTTP_BODY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Slack notification sent successfully"
|
||||
115
.github/workflows/stale-pr-reminder.yml
vendored
Normal file
115
.github/workflows/stale-pr-reminder.yml
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
# Stale PR Review Reminder
|
||||
#
|
||||
# Runs daily on weekdays (second run at 8 PM UTC disabled during rollout) and posts a Slack summary of open PRs that
|
||||
# have been awaiting review for more than 72 hours. Team-level signal only —
|
||||
# no individual shaming.
|
||||
#
|
||||
# Security note: No untrusted input is interpolated into shell commands.
|
||||
# All PR metadata is read via gh API + jq.
|
||||
#
|
||||
# Required secrets:
|
||||
# SLACK_WEBHOOK_PR_REVIEW_BOT - Incoming webhook URL for the #pr-review-ops channel
|
||||
|
||||
name: Stale PR Review Reminder
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 14 * * 1-5" # 2 PM UTC weekdays
|
||||
# - cron: "0 20 * * 1-5" # 8 PM UTC weekdays — enable after initial rollout
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
check-stale-prs:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
REPO: ${{ github.repository }}
|
||||
# Only surface PRs created on or after this date. Update this if the
|
||||
# review process enforcement date changes.
|
||||
PROCESS_START_DATE: "2026-03-19T00:00:00Z"
|
||||
steps:
|
||||
- name: Find PRs awaiting review longer than 72h
|
||||
id: stale
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
CUTOFF=$(date -u -v-72H +%Y-%m-%dT%H:%M:%SZ 2>/dev/null \
|
||||
|| date -u -d '72 hours ago' +%Y-%m-%dT%H:%M:%SZ)
|
||||
|
||||
# Get open, non-draft PRs with pending review requests, created before cutoff
|
||||
# but after the review process start date (to exclude pre-existing backlog)
|
||||
gh api --paginate \
|
||||
"repos/${REPO}/pulls?state=open&sort=updated&direction=asc&per_page=100" \
|
||||
--jq "[
|
||||
.[] |
|
||||
select(.draft == false) |
|
||||
select(.created_at > \"$PROCESS_START_DATE\") |
|
||||
select(.created_at < \"$CUTOFF\") |
|
||||
select((.requested_reviewers | length > 0) or (.requested_teams | length > 0))
|
||||
]" > /tmp/candidates.json
|
||||
|
||||
# Filter to PRs with zero approving reviews
|
||||
jq -r '.[].number' /tmp/candidates.json | while read -r PR_NUMBER; do
|
||||
APPROVALS=$(gh api \
|
||||
"repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
|
||||
--jq "[.[] | select(.state == \"APPROVED\")] | length" 2>/dev/null || echo "0")
|
||||
|
||||
if [ "$APPROVALS" -eq 0 ]; then
|
||||
jq ".[] | select(.number == ${PR_NUMBER}) | {number, title, author: .user.login, created_at}" \
|
||||
/tmp/candidates.json
|
||||
fi
|
||||
done | jq -s '.' > /tmp/awaiting.json
|
||||
|
||||
COUNT=$(jq 'length' /tmp/awaiting.json)
|
||||
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Notify Slack
|
||||
if: steps.stale.outputs.count != '0'
|
||||
env:
|
||||
SLACK_WEBHOOK_PR_REVIEW_BOT: ${{ secrets.SLACK_WEBHOOK_PR_REVIEW_BOT }}
|
||||
COUNT: ${{ steps.stale.outputs.count }}
|
||||
run: |
|
||||
# Build Block Kit payload from JSON — no shell interpolation of PR titles.
|
||||
# Why jq? PR titles are attacker-controllable input. By reading them
|
||||
# through jq -r from the JSON file and passing the result to jq --arg,
|
||||
# the content stays safely JSON-encoded in the final payload.
|
||||
PRS=$(jq -r '.[] | "• <https://github.com/'"${REPO}"'/pull/\(.number)|#\(.number)> — \(.title) (by \(.author), opened \(.created_at | split("T")[0]))"' /tmp/awaiting.json)
|
||||
|
||||
jq -n \
|
||||
--arg count "$COUNT" \
|
||||
--arg prs "$PRS" \
|
||||
'{
|
||||
text: ($count + " PR(s) awaiting review for >72 hours"),
|
||||
blocks: [
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "mrkdwn",
|
||||
text: (":hourglass_flowing_sand: *" + $count + " PR(s) Awaiting Review >72 Hours*")
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "section",
|
||||
text: { type: "mrkdwn", text: $prs }
|
||||
},
|
||||
{ type: "divider" },
|
||||
{
|
||||
type: "context",
|
||||
elements: [{
|
||||
type: "mrkdwn",
|
||||
text: "PRs awaiting review are surfaced daily. Reviewers: pick one up or reassign."
|
||||
}]
|
||||
}
|
||||
]
|
||||
}' | \
|
||||
curl -s -X POST "$SLACK_WEBHOOK_PR_REVIEW_BOT" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d @-
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -euxo pipefail {0}
|
||||
89
.github/workflows/track_duplicate_bot_effectiveness.yml
vendored
Normal file
89
.github/workflows/track_duplicate_bot_effectiveness.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
name: Track duplicate bot effectiveness
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [closed]
|
||||
schedule:
|
||||
- cron: "0 8 */2 * *" # every 2 days at 8 AM UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
classify-closed-issue:
|
||||
if: >
|
||||
github.event_name == 'issues' &&
|
||||
github.repository == 'zed-industries/zed' &&
|
||||
github.event.issue.pull_request == null &&
|
||||
github.event.issue.type != null &&
|
||||
(github.event.issue.type.name == 'Bug' || github.event.issue.type.name == 'Crash')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: script/github-track-duplicate-bot-effectiveness.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Get github app token
|
||||
id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Classify closed issue
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
CLOSER_LOGIN: ${{ github.event.sender.login }}
|
||||
STATE_REASON: ${{ github.event.issue.state_reason }}
|
||||
run: |
|
||||
python script/github-track-duplicate-bot-effectiveness.py \
|
||||
classify-closed "$ISSUE_NUMBER" "$CLOSER_LOGIN" "$STATE_REASON"
|
||||
|
||||
classify-open:
|
||||
if: >
|
||||
github.repository == 'zed-industries/zed' &&
|
||||
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: script/github-track-duplicate-bot-effectiveness.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Get github app token
|
||||
id: get-app-token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
owner: zed-industries
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Classify open issues
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
|
||||
run: |
|
||||
python script/github-track-duplicate-bot-effectiveness.py classify-open
|
||||
173
.github/workflows/triage_project_sync.yml
vendored
Normal file
173
.github/workflows/triage_project_sync.yml
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
# Sync triage state into "Zed weekly triage" (project #84).
|
||||
#
|
||||
# Runs in two modes:
|
||||
# 1. Event-driven (primary): fires on issue events + new issue comments.
|
||||
# Re-derives Status / Stale since / Aged? / Intake week for that one
|
||||
# issue. Latency: ~10–30 seconds end-to-end.
|
||||
# 2. Daily cron (safety net): re-derives across all project items at 06:00
|
||||
# UTC. Catches any events that GH dropped under load.
|
||||
#
|
||||
# Auth: GitHub App `ZED_COMMUNITY_BOT_APP_ID` with
|
||||
# `Organization Projects: Read and write` permission added. Token is
|
||||
# requested with `owner: zed-industries` so it can mutate org-level project
|
||||
# items (the default repo-scoped token is insufficient for org projects).
|
||||
#
|
||||
# This workflow only mutates the triage project (#84). It does not write
|
||||
# labels, comments, or any issue metadata. Adding any other write capability
|
||||
# requires a separate workflow.
|
||||
|
||||
name: Triage Project Sync (#84)
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- closed
|
||||
- labeled
|
||||
- unlabeled
|
||||
- assigned
|
||||
- unassigned
|
||||
- edited
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
- cron: "0 6 * * *" # daily 06:00 UTC
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: "Issue number to sync (leave blank to sync all)"
|
||||
type: number
|
||||
required: false
|
||||
dry_run:
|
||||
description: "Dry run (compute but don't mutate)"
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
# Coalesce rapid event bursts on the same issue (e.g., 5 labels added at once
|
||||
# = 5 events). Cancel any in-progress run for the same issue when a new event
|
||||
# arrives — the latest run will compute the most up-to-date state.
|
||||
concurrency:
|
||||
group: triage-sync-${{ github.event.issue.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Default to no permissions for any job in this workflow. The single job below
|
||||
# explicitly opts back in to `contents: read` for the sparse checkout. If a
|
||||
# future job is added without its own `permissions:` block, it will inherit
|
||||
# this empty default rather than the repo-wide token defaults.
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Sync triage project
|
||||
# Run only on the canonical repo (not forks); skip PR comments since this
|
||||
# workflow is for issues only.
|
||||
if: |
|
||||
github.repository == 'zed-industries/zed' &&
|
||||
(github.event_name != 'issue_comment' || github.event.issue.pull_request == null)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Checkout (sparse — script only)
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
sparse-checkout: script/triage_project_sync.py
|
||||
sparse-checkout-cone-mode: false
|
||||
# Don't write GITHUB_TOKEN into .git/config. We never push from this
|
||||
# workflow; we only read one file. Keeps the token out of any
|
||||
# filesystem state that subsequent steps could access.
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get App installation token
|
||||
id: token
|
||||
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
||||
with:
|
||||
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
||||
# IMPORTANT: org-scoped token is required for org-level project
|
||||
# mutations. Without `owner:`, the default token is repo-scoped and
|
||||
# cannot write to org projects.
|
||||
owner: zed-industries
|
||||
# Scope the token down to the minimum needed for this workflow.
|
||||
# Even though the App may have broader permissions for other
|
||||
# automations (e.g., Issues:Write for the dupe-bot), this token
|
||||
# only carries what we list below. Per the action's docs, an
|
||||
# unrequested permission is *not* available on the resulting token.
|
||||
#
|
||||
# Required:
|
||||
# - organization-projects:write — mutate project items + read
|
||||
# project schema
|
||||
# - members:read — query the `staff` team membership
|
||||
# - issues:read — fetch issue body, labels, comments
|
||||
# - metadata:read — always required for any GH API access
|
||||
permission-organization-projects: write
|
||||
permission-members: read
|
||||
permission-issues: read
|
||||
permission-metadata: read
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Sync (event-driven, single issue)
|
||||
if: github.event_name == 'issues' || github.event_name == 'issue_comment'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
python script/triage_project_sync.py --issue "$ISSUE_NUMBER"
|
||||
|
||||
- name: Sync (cron, all items)
|
||||
if: github.event_name == 'schedule'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
|
||||
run: |
|
||||
python script/triage_project_sync.py --all
|
||||
|
||||
- name: Sync (manual dispatch — single)
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.issue_number != ''
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
|
||||
ISSUE_NUMBER: ${{ inputs.issue_number }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
run: |
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
python script/triage_project_sync.py --issue "$ISSUE_NUMBER" --dry-run
|
||||
else
|
||||
python script/triage_project_sync.py --issue "$ISSUE_NUMBER"
|
||||
fi
|
||||
|
||||
- name: Sync (manual dispatch — all)
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.issue_number == ''
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
run: |
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
python script/triage_project_sync.py --all --dry-run
|
||||
else
|
||||
python script/triage_project_sync.py --all
|
||||
fi
|
||||
|
||||
- name: Write summary
|
||||
if: always()
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
{
|
||||
echo "## Triage sync summary"
|
||||
echo ""
|
||||
echo "- Event: \`$EVENT_NAME\`"
|
||||
if [ -n "$ISSUE_NUMBER" ]; then
|
||||
echo "- Issue: #$ISSUE_NUMBER"
|
||||
fi
|
||||
echo "- Project: [#84 Zed weekly triage](https://github.com/orgs/zed-industries/projects/84)"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
29
.github/workflows/update_duplicate_magnets.yml
vendored
Normal file
29
.github/workflows/update_duplicate_magnets.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Update Duplicate Magnets Issue
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 6 * * 1,4" # Mondays and Thursdays at 6 AM UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-duplicate-magnets:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zed-industries/zed'
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Update duplicate magnets issue
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python script/github-find-top-duplicated-bugs.py \
|
||||
--github-token "$GITHUB_TOKEN" \
|
||||
--issue-number 46355
|
||||
Reference in New Issue
Block a user