Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
FROM archlinux:base-devel
|
||||
|
||||
ARG USERNAME=build
|
||||
# We use 1001 as the user UID here because 1000 is the UID for `runneradmin`,
|
||||
# but the actual jobs are run as `runner` (with UID 1001).
|
||||
ARG USER_UID=1001
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Set the packager name in makepkg.conf (so it doesn't say "Unknown Packager")
|
||||
# when someone queries package info for our packages.
|
||||
RUN echo 'PACKAGER="Warp Linux Maintainers <linux-maintainers@warp.dev>"' >> /etc/makepkg.conf
|
||||
|
||||
# Fetch package lists and install sudo, git, and protobuf (git is needed by
|
||||
# cargo to resolve git dependencies during license generation, and protobuf
|
||||
# provides protoc for generating rust bindings of protobuf APIs).
|
||||
RUN pacman -Sy --needed --noconfirm sudo git protobuf
|
||||
|
||||
# Downgrade fakeroot to version 1.34. Version 1.35 switches from calling
|
||||
# `close` in a loop to using the new `close_range` syscall, which seems to
|
||||
# be unavailable in the Ubuntu 20.04 environment that hosts this Docker
|
||||
# container.
|
||||
#
|
||||
# Syscall discussion: https://archlinuxarm.org/forum/viewtopic.php?f=15&t=16943
|
||||
# Downgrade discussion: https://github.com/docker/for-mac/issues/7331
|
||||
RUN pacman -U --noconfirm https://archive.archlinux.org/packages/f/fakeroot/fakeroot-1.34-1-x86_64.pkg.tar.zst
|
||||
|
||||
# Install cargo-about, which we require for bundling third-party licenses.
|
||||
RUN pacman -S --needed --noconfirm cargo-about
|
||||
|
||||
# Create our build user and give them sudo privileges.
|
||||
RUN groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
# Run as our build user instead of root, as makepkg must be run as a non-root
|
||||
# user.
|
||||
USER $USERNAME
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,41 @@
|
||||
# Important note: This must be run after we build the release binary; this only
|
||||
# packages up an already-built binary.
|
||||
|
||||
name: Bundle Arch Linux package
|
||||
description: Bundles an Arch Linux package for the given release channel.
|
||||
inputs:
|
||||
channel:
|
||||
description: The channel for which we want to build an Arch package.
|
||||
requred: true
|
||||
release-tag:
|
||||
description: The git release tag.
|
||||
required: true
|
||||
arch:
|
||||
description: The architecture we are building for
|
||||
required: true
|
||||
artifact:
|
||||
description: The artifact type to build (app or cli)
|
||||
required: false
|
||||
default: app
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Build Docker image
|
||||
shell: bash
|
||||
run: docker build -t arch-bundle-builder ${{ github.action_path }}
|
||||
|
||||
- name: Run in container
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/github/workspace" \
|
||||
-v "${{ github.workspace }}/target:/github/workspace/target" \
|
||||
-w /github/workspace \
|
||||
-v "${CARGO_HOME:-$HOME/.cargo}/git:/home/build/.cargo/git" \
|
||||
-v "${CARGO_HOME:-$HOME/.cargo}/registry:/home/build/.cargo/registry" \
|
||||
-e GIT_RELEASE_TAG="$GIT_RELEASE_TAG" \
|
||||
-e GITHUB_ACTIONS="$GITHUB_ACTIONS" \
|
||||
-e GITHUB_OUTPUT="/dev/null" \
|
||||
arch-bundle-builder \
|
||||
${{ inputs.channel }} ${{ inputs.release-tag }} ${{ inputs.arch }} ${{ inputs.artifact }}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BUILD_ARCH="$3"
|
||||
BUILD_ARCH="${BUILD_ARCH:-$(uname -m)}"
|
||||
|
||||
# Ensure we build with the most up-to-date package list. This could get stale due to Docker
|
||||
# filesystem caching.
|
||||
sudo pacman -Sy
|
||||
|
||||
# Run the bundle script, specifying the release channel and tag, skipping
|
||||
# building the binary (as we have already done so), and only bundling the
|
||||
# Arch package.
|
||||
./script/bundle --channel $1 --release-tag $2 --skip-build --packages arch --arch $BUILD_ARCH --artifact $4
|
||||
@@ -0,0 +1,170 @@
|
||||
name: "Docubot"
|
||||
description: "Helps Warp engineers identify PRs that need documentation updates in GitBook"
|
||||
inputs:
|
||||
prompt:
|
||||
description: "Prompt to send to Warp"
|
||||
required: true
|
||||
warp_api_key:
|
||||
description: "Warp API key"
|
||||
required: true
|
||||
warp_channel:
|
||||
description: "Warp release channel (e.g., dev, preview, stable)"
|
||||
required: false
|
||||
default: "dev"
|
||||
profile_id:
|
||||
description: "Warp profile ID"
|
||||
required: false
|
||||
github_token:
|
||||
description: "GitHub token for cloning private repositories"
|
||||
required: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup Warp CLI
|
||||
uses: ./.github/actions/setup_warp_cli
|
||||
with:
|
||||
warp_channel: ${{ inputs.warp_channel }}
|
||||
- name: Clone Warp GitBook repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
repository: warpdotdev/gitbook
|
||||
token: ${{ inputs.github_token }}
|
||||
path: gitbook
|
||||
- name: Create prompt file
|
||||
shell: bash
|
||||
# TODO: use sdk (python or typescript) for this
|
||||
run: |
|
||||
set -euo pipefail
|
||||
envsubst < .github/actions/docubot/prompt.txt > prompt.output.txt
|
||||
env:
|
||||
# GitHub Repository Context
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
|
||||
GITHUB_REPOSITORY_OWNER_ID: ${{ github.repository_owner_id }}
|
||||
GITHUB_REPOSITORY_ID: ${{ github.repository_id }}
|
||||
GITHUB_REPOSITORY_URL: ${{ github.repositoryUrl }}
|
||||
|
||||
# GitHub Event Context
|
||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||
GITHUB_EVENT_PATH: ${{ github.event_path }}
|
||||
GITHUB_EVENT_ACTION: ${{ github.event.action }}
|
||||
|
||||
# GitHub Workflow Context
|
||||
GITHUB_WORKFLOW: ${{ github.workflow }}
|
||||
GITHUB_WORKFLOW_REF: ${{ github.workflow_ref }}
|
||||
GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}
|
||||
GITHUB_JOB: ${{ github.job }}
|
||||
GITHUB_RUN_ID: ${{ github.run_id }}
|
||||
GITHUB_RUN_NUMBER: ${{ github.run_number }}
|
||||
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
|
||||
|
||||
# GitHub Actor Context
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_ACTOR_ID: ${{ github.actor_id }}
|
||||
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }}
|
||||
|
||||
# GitHub Git Context
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_REF_PROTECTED: ${{ github.ref_protected }}
|
||||
GITHUB_REF_TYPE: ${{ github.ref_type }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||
|
||||
# Issue/PR Context
|
||||
PR_OR_ISSUE_TITLE: ${{ github.event.issue.title || github.event.pull_request.title }}
|
||||
PR_OR_ISSUE_BODY: ${{ github.event.issue.body || github.event.pull_request.body }}
|
||||
PR_OR_ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
|
||||
PR_OR_ISSUE_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
|
||||
PR_OR_ISSUE_STATE: ${{ github.event.issue.state || github.event.pull_request.state }}
|
||||
PR_OR_ISSUE_CREATED_AT: ${{ github.event.issue.created_at || github.event.pull_request.created_at }}
|
||||
PR_OR_ISSUE_UPDATED_AT: ${{ github.event.issue.updated_at || github.event.pull_request.updated_at }}
|
||||
PR_OR_ISSUE_USER_LOGIN: ${{ github.event.issue.user.login || github.event.pull_request.user.login }}
|
||||
PR_OR_ISSUE_USER_ID: ${{ github.event.issue.user.id || github.event.pull_request.user.id }}
|
||||
PR_OR_ISSUE_ASSIGNEES: ${{ toJson(github.event.issue.assignees) || toJson(github.event.pull_request.assignees) }}
|
||||
PR_OR_ISSUE_LABELS: ${{ toJson(github.event.issue.labels) || toJson(github.event.pull_request.labels) }}
|
||||
|
||||
# Pull Request Specific Context
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
||||
PR_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
|
||||
PR_BASE_REPO_FULL_NAME: ${{ github.event.pull_request.base.repo.full_name }}
|
||||
PR_DRAFT: ${{ github.event.pull_request.draft }}
|
||||
PR_MERGED: ${{ github.event.pull_request.merged }}
|
||||
PR_MERGEABLE: ${{ github.event.pull_request.mergeable }}
|
||||
PR_MERGEABLE_STATE: ${{ github.event.pull_request.mergeable_state }}
|
||||
PR_COMMITS: ${{ github.event.pull_request.commits }}
|
||||
PR_ADDITIONS: ${{ github.event.pull_request.additions }}
|
||||
PR_DELETIONS: ${{ github.event.pull_request.deletions }}
|
||||
PR_CHANGED_FILES: ${{ github.event.pull_request.changed_files }}
|
||||
|
||||
# Issue Specific Context
|
||||
ISSUE_CLOSED_AT: ${{ github.event.issue.closed_at }}
|
||||
ISSUE_MILESTONE: ${{ toJson(github.event.issue.milestone) }}
|
||||
|
||||
# Comment Context (for issue_comment events)
|
||||
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||
COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
|
||||
COMMENT_USER_ID: ${{ github.event.comment.user.id }}
|
||||
COMMENT_CREATED_AT: ${{ github.event.comment.created_at }}
|
||||
COMMENT_UPDATED_AT: ${{ github.event.comment.updated_at }}
|
||||
COMMENT_HTML_URL: ${{ github.event.comment.html_url }}
|
||||
|
||||
# Documentation Repository Context
|
||||
GITBOOK_PATH: ${{ format('{0}/gitbook', github.workspace) }}
|
||||
|
||||
- name: Configure git identity
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config user.name "Warp Agent"
|
||||
git config user.email "agent@warp.dev"
|
||||
|
||||
- name: Run Warp agent
|
||||
shell: bash
|
||||
env:
|
||||
WARP_API_KEY: ${{ inputs.warp_api_key }}
|
||||
GH_TOKEN: ${{ inputs.github_token }}
|
||||
PROFILE_ID: ${{ inputs.profile_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Determine the CLI command name based on channel suffix
|
||||
case "${{ inputs.warp_channel }}" in
|
||||
stable|stable_release|"") suffix="" ;;
|
||||
preview|preview_release) suffix="-preview" ;;
|
||||
dev|dev_release) suffix="-dev" ;;
|
||||
local) suffix="-local" ;;
|
||||
integration|integration_test) suffix="-integration" ;;
|
||||
*) suffix="" ;;
|
||||
esac
|
||||
cmd="warp-cli${suffix}"
|
||||
|
||||
# Basic check the binary exists
|
||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "Error: $cmd not found on PATH after installation"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Execute the agent run
|
||||
"$cmd" agent run \
|
||||
--prompt "$(cat prompt.output.txt)" \
|
||||
--api-key "$WARP_API_KEY" \
|
||||
--cwd "$GITHUB_WORKSPACE" \
|
||||
${PROFILE_ID:+--profile "$PROFILE_ID"}
|
||||
- name: Upload Warp logs
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: warp-logs.log
|
||||
path: /home/runner/.local/state/warp-terminal-dev/warp_dev.log
|
||||
if-no-files-found: ignore
|
||||
- name: Upload Warp prompt
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: prompt.output.txt
|
||||
path: prompt.output.txt
|
||||
if-no-files-found: ignore
|
||||
@@ -0,0 +1,78 @@
|
||||
You are Warp, the world's best AI coding assistant for helping with GitHub PRs and issues. Here is the context for your current task:
|
||||
|
||||
<pr_or_issue_title>
|
||||
$PR_OR_ISSUE_TITLE
|
||||
</pr_or_issue_title>
|
||||
|
||||
<pr_or_issue_body>
|
||||
$PR_OR_ISSUE_BODY
|
||||
</pr_or_issue_body>
|
||||
|
||||
<pr_or_issue_url>
|
||||
$PR_OR_ISSUE_URL
|
||||
</pr_or_issue_url>
|
||||
|
||||
<changed_files>
|
||||
$PR_CHANGED_FILES
|
||||
</changed_files>
|
||||
|
||||
<trigger_comment>
|
||||
$COMMENT_USER_LOGIN: $COMMENT_BODY
|
||||
</trigger_comment>
|
||||
|
||||
Your persona: You are **docubot**, living inside Warp's internal codebase. When triggered, you read the context of the invoking PR and update Warp's documentation repo (`https://github.com/warpdotdev/gitbook`). The GitBook repository is already available locally at `$GITBOOK_PATH` - you have direct access to it and should use it without attempting to clone it again. The repo is organized into Markdown files and assets. Your job is to create a new branch, apply accurate documentation changes, and open a well-scoped PR with a high-quality description. You need to post the link to the PR to the original PR in Warp-internal where the changes were made.
|
||||
|
||||
**Available Context Variables:**
|
||||
- `$PR_OR_ISSUE_NUMBER`: The PR/issue number in warp-internal
|
||||
- `$PR_OR_ISSUE_USER_LOGIN`: The GitHub username of the original PR author
|
||||
- `$PR_OR_ISSUE_URL`: The URL of the original warp-internal PR
|
||||
- `$PR_OR_ISSUE_TITLE`: The title of the original PR
|
||||
- `$GH_TOKEN`: The token you should use to authenticate with GitHub when creating the PR. DO NOT reveal the contents of this secret token.
|
||||
|
||||
Key rules:
|
||||
- **Truth first**: Only document behavior present in the PR or linked issues. Add `<!-- TODO -->` if something is unclear.
|
||||
- **Scope**: Update only affected pages plus any directly impacted references. Don’t rewrite unrelated sections.
|
||||
- **Consistency**: Match existing style, tone, and structure in GitBook.
|
||||
- **Assets**: Place images in `.gitbook/assets/`, use kebab-case names, and add alt text.
|
||||
- **Privacy**: No secrets, tokens, or internal data in examples or screenshots.
|
||||
- **Cross-linking**: Update or add links between related sections where useful.
|
||||
|
||||
Commit & PR conventions:
|
||||
- Branch name: `docubot/<short-slug-from-invoking-pr-title>`
|
||||
- Commit message style: `docs(area): concise summary of change`
|
||||
- PR title: `Docs: <concise summary> (from <repo>#<PR>)`
|
||||
- PR description must include:
|
||||
- **Summary** of what changed
|
||||
- **Pages/sections updated**
|
||||
- **Why** the change was made
|
||||
|
||||
IMPORTANT OUTPUT INSTRUCTIONS:
|
||||
- You are only allowed to leave **one comment**. Do so at the end of your run. Use the `gh` CLI tool to add a comment. You can (and should) use Markdown to format this.
|
||||
- If code/doc changes are requested, make the changes locally, then update them in the remote branch via `git add`, `git commit`, and `git push -u` before posting your final comment. You MUST push the local branch with `-u`, otherwise the `gh` CLI will fail when you try to create the PR.
|
||||
- Your comment should either:
|
||||
1. Provide a clear PR summary + next steps (if you opened a docs PR), or
|
||||
2. Explain blockers/clarifications needed.
|
||||
|
||||
ADDITIONAL WORKFLOW REQUIREMENTS:
|
||||
- **After successfully creating a GitBook PR**: You MUST comment on the original warp-internal PR to:
|
||||
1. Provide a link to the new GitBook documentation PR
|
||||
2. Tag the original PR author (@$PR_OR_ISSUE_USER_LOGIN) as a reviewer to review the documentation changes
|
||||
3. Include a brief summary of what documentation was updated
|
||||
- **Steps for commenting on original PR**:
|
||||
1. First, ensure you have the GitBook PR URL from your newly created PR
|
||||
2. Use `gh pr comment $PR_OR_ISSUE_NUMBER --body "[comment content]"` in the warp-internal repository
|
||||
3. The comment should follow this format:
|
||||
```
|
||||
**Documentation Updated**
|
||||
|
||||
I've created a documentation PR based on the changes in this PR:
|
||||
**GitBook PR**: [Insert actual GitBook PR URL here]
|
||||
|
||||
**What was updated:**
|
||||
- [Brief bullet points of documentation changes made]
|
||||
|
||||
@$PR_OR_ISSUE_USER_LOGIN - Please review the documentation changes to ensure they accurately reflect your implementation.
|
||||
```
|
||||
- **Important**: Replace `[Insert actual GitBook PR URL here]` with the real URL of the GitBook PR you created
|
||||
- **Important**: Replace `[Brief bullet points of documentation changes made]` with actual details of what you updated
|
||||
- **Repository context**: Ensure you're in the warp-internal repository when running the `gh pr comment` command, not in the GitBook repository
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Get Channel Config
|
||||
description: Provides a variety of config data for the given channel type.
|
||||
inputs:
|
||||
config_file:
|
||||
description: The path to the configuration file.
|
||||
required: true
|
||||
channel:
|
||||
description: The channel to retrieve configuration data for.
|
||||
required: true
|
||||
outputs:
|
||||
channel:
|
||||
description: The channel that we're building a release for. (This is the same as the input value.)
|
||||
value: ${{ steps.get-config.outputs.channel }}
|
||||
type:
|
||||
description: The release type, either "nightly" or "weekly".
|
||||
value: ${{ steps.get-config.outputs.type }}
|
||||
is_prerelease:
|
||||
description: Whether this channel is a prerelease channel.
|
||||
value: ${{ steps.get-config.outputs.is_prerelease }}
|
||||
is_autopush:
|
||||
description: Whether new builds for this channel automatically trigger channel versions updates.
|
||||
value: ${{ steps.get-config.outputs.is_autopush }}
|
||||
release_base_name:
|
||||
description: The base name for the GitHub release, to which the release number is appended.
|
||||
value: ${{ steps.get-config.outputs.release_base_name }}
|
||||
release_body_text:
|
||||
description: The body text for the GitHub release.
|
||||
value: ${{ steps.get-config.outputs.release_body_text }}
|
||||
sentry_project:
|
||||
description: The Sentry project under which a new release should be created.
|
||||
value: ${{ steps.get-config.outputs.sentry_project }}
|
||||
sentry_environment:
|
||||
description: The environment to set for this channel's Sentry release.
|
||||
value: ${{ steps.get-config.outputs.sentry_environment }}
|
||||
changelog_slack_channel:
|
||||
description: The Slack channel where the release's changelog should be posted.
|
||||
value: ${{ steps.get-config.outputs.changelog_slack_channel }}
|
||||
gcs_cache_control_value:
|
||||
description: The Cache-Control value to set for release artifacts in Cloud Storage.
|
||||
value: ${{ steps.get-config.outputs.gcs_cache_control_value }}
|
||||
web_gcs_bucket_prefix:
|
||||
description: The GCS bucket prefix for web artifacts. (Determines if they go in a staging or prod bucket.)
|
||||
value: ${{ steps.get-config.outputs.web_gcs_bucket_prefix }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- id: get-config
|
||||
env:
|
||||
CONFIG_FILE: ${{ inputs.config_file }}
|
||||
CHANNEL: ${{ inputs.channel }}
|
||||
run: |
|
||||
echo ::echo::on
|
||||
jq -e '.channels[] | select(.channel == $ENV.CHANNEL)' $CONFIG_FILE > /dev/null
|
||||
# Fail if the given channel is not found in the JSON release configuration.
|
||||
[ $? -eq 0 ] || (echo ::error::"Channel $CHANNEL not found in release configuration" && exit 1)
|
||||
jq -rc '.channels[] | select(.channel == $ENV.CHANNEL) | to_entries | map("\(.key)=\(.value)")[]' $CONFIG_FILE >> $GITHUB_OUTPUT
|
||||
echo ::echo::off
|
||||
shell: bash
|
||||
@@ -0,0 +1,139 @@
|
||||
name: Prepare Environment
|
||||
description: A shared set of setup steps to prepare the runtime environment.
|
||||
inputs:
|
||||
target_os:
|
||||
required: true
|
||||
description: The target OS that we're building for ("macos", "linux", "windows", or "wasm").
|
||||
is_self_hosted:
|
||||
required: true
|
||||
description: Whether or not the workflow is running on a self-hosted runner.
|
||||
ref:
|
||||
description: If set, the ref to checkout.
|
||||
install_test_deps:
|
||||
description: If true, dependencies needed for running tests will be installed.
|
||||
install_release_deps:
|
||||
description: If true, dependencies needed for building release artifacts will be installed (e.g., cargo-about for license generation).
|
||||
cache_key:
|
||||
description: If set, the cache key to use. If unset, the cache key will be derived from the target OS.
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Make GitHub token available in the environment
|
||||
shell: bash
|
||||
run: echo "GH_TOKEN=${{ github.token }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up git for Windows
|
||||
if: ${{ inputs.target_os == 'windows' }}
|
||||
shell: bash
|
||||
run: git config --system core.longpaths true
|
||||
|
||||
- name: Set CARGO_HOME location
|
||||
if: ${{ inputs.target_os == 'windows' }}
|
||||
shell: bash
|
||||
run: echo "CARGO_HOME=C:\cargo" >> $GITHUB_ENV
|
||||
|
||||
- name: Determine repository root
|
||||
id: repo-root
|
||||
shell: bash
|
||||
run: |
|
||||
# The action lives at <repo-root>/.github/actions/prepare_environment.
|
||||
# Derive the repository root from the action path.
|
||||
REPO_ROOT=$(cd "${{ github.action_path }}/../../.." && pwd)
|
||||
echo "path=$REPO_ROOT" >> $GITHUB_OUTPUT
|
||||
# Normalize $GITHUB_WORKSPACE through cd/pwd so that path formats
|
||||
# match on Windows (where $GITHUB_WORKSPACE uses backslashes but
|
||||
# pwd produces MSYS-style forward-slash paths).
|
||||
WORKSPACE=$(cd "$GITHUB_WORKSPACE" && pwd)
|
||||
if [ "$REPO_ROOT" = "$WORKSPACE" ]; then
|
||||
echo "is-workspace-root=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is-workspace-root=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
if: ${{ inputs.is_self_hosted != 'true' && !startsWith(runner.name, 'nsc-runner') }}
|
||||
with:
|
||||
# Make sure x86_64-unknown-linux-gnu and wasm32-unknown-unknown builds
|
||||
# don't share a cache, despite running on the same _host_ architecture.
|
||||
key: ${{ inputs.cache_key != '' && inputs.cache_key || inputs.target_os }}
|
||||
# Only cache runs on the master branch (caches on feature branches
|
||||
# are not reusable).
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Set up Namespace cache
|
||||
if: ${{ startsWith(runner.name, 'nsc-runner') }}
|
||||
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
|
||||
with:
|
||||
cache: |
|
||||
rust
|
||||
${{ inputs.target_os == 'macos' && 'brew' || '' }}
|
||||
|
||||
- name: Install cargo-binstall
|
||||
uses: cargo-bins/cargo-binstall@dc19f1e48450eefe5a29b8da6c6b00a87d730b37 # v1.18.1
|
||||
env:
|
||||
BINSTALL_VERSION: 1.14.4
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd "${{ steps.repo-root.outputs.path }}"
|
||||
if ${{ inputs.target_os == 'macos' }}; then
|
||||
# Try to install warp-channel-config but don't complain if it cannot
|
||||
# be installed.
|
||||
./script/install_channel_config || true
|
||||
if ${{ inputs.install_release_deps == 'true' }}; then
|
||||
./script/install_cargo_release_deps
|
||||
else
|
||||
./script/install_cargo_build_deps
|
||||
fi
|
||||
elif ${{ inputs.target_os == 'linux' }}; then
|
||||
# Update the apt cache before installing dependencies - it can be slow, so the install scripts
|
||||
# don't do it.
|
||||
sudo apt-get update -y
|
||||
|
||||
if ${{ inputs.install_test_deps == 'true' }}; then
|
||||
./script/linux/install_test_deps
|
||||
elif ${{ inputs.install_release_deps == 'true' }}; then
|
||||
./script/linux/install_build_deps
|
||||
./script/install_cargo_release_deps
|
||||
else
|
||||
./script/linux/install_build_deps
|
||||
fi
|
||||
elif ${{ inputs.target_os == 'windows' }}; then
|
||||
./script/windows/install_build_deps.ps1
|
||||
if ${{ inputs.install_release_deps == 'true' }}; then
|
||||
./script/install_cargo_release_deps
|
||||
fi
|
||||
elif ${{ inputs.target_os == 'wasm' }}; then
|
||||
# Update the apt cache before installing dependencies - it can be slow, so the install scripts
|
||||
# don't do it (to avoid doing it more than once).
|
||||
sudo apt update -y
|
||||
./script/wasm/install_build_deps
|
||||
else
|
||||
echo "::error::Missing logic to install build dependencies for OS \"${{ inputs.target_os }}\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
|
||||
with:
|
||||
node-version: 20.9.0
|
||||
|
||||
- name: Enable Corepack
|
||||
# Enables NodeJS's Corepack tool, which is necessary to use the right version of `yarn` to
|
||||
# build TS command signatures.
|
||||
shell: bash
|
||||
run: corepack enable
|
||||
|
||||
- name: Install protoc for generating rust bindings of protobuf APIs
|
||||
# Install protoc for generating rust bindings of protobuf APIs.
|
||||
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30 # v1
|
||||
with:
|
||||
brew: protobuf
|
||||
choco: protoc
|
||||
|
||||
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
|
||||
if: ${{ inputs.target_os == 'macos' && inputs.is_self_hosted != 'true' }}
|
||||
with:
|
||||
xcode-version: '26'
|
||||
Reference in New Issue
Block a user