diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml deleted file mode 100644 index 47cf20d8d..000000000 --- a/.github/workflows/build-desktop.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Build Desktop (Linux) - -on: - pull_request: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build-linux: - name: Tauri Build (Linux) - # Set OPENWORK_LINUX_X64_RUNNER_LABEL to route this job to a larger GitHub-hosted runner. - runs-on: ${{ vars.OPENWORK_LINUX_X64_RUNNER_LABEL != '' && vars.OPENWORK_LINUX_X64_RUNNER_LABEL || 'ubuntu-22.04' }} - - steps: - - name: Log runner selection - run: | - echo "Requested larger runner label: ${RUNNER_LABEL:-}" - echo "Effective runs-on: ${EFFECTIVE_RUNS_ON}" - env: - RUNNER_LABEL: ${{ vars.OPENWORK_LINUX_X64_RUNNER_LABEL }} - EFFECTIVE_RUNS_ON: ${{ vars.OPENWORK_LINUX_X64_RUNNER_LABEL != '' && vars.OPENWORK_LINUX_X64_RUNNER_LABEL || 'ubuntu-22.04' }} - - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.27.0 - - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: 1.3.5 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install Linux build dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - libgtk-3-dev \ - libglib2.0-dev \ - libayatana-appindicator3-dev \ - libsoup-3.0-dev \ - libwebkit2gtk-4.1-dev \ - libssl-dev \ - rpm \ - libdbus-1-dev \ - librsvg2-dev - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-unknown-linux-gnu - - - name: Create CI Tauri config (no updater artifacts) - run: | - node -e "const fs=require('fs'); const configPath='apps/desktop/src-tauri/tauri.conf.json'; const ciPath='apps/desktop/src-tauri/tauri.conf.ci.json'; const config=JSON.parse(fs.readFileSync(configPath,'utf8')); config.bundle={...config.bundle, createUpdaterArtifacts:false}; fs.writeFileSync(ciPath, JSON.stringify(config, null, 2));" - - - name: Download OpenCode sidecar - shell: bash - env: - GITHUB_TOKEN: ${{ github.token }} - OPENCODE_GITHUB_REPO: ${{ vars.OPENCODE_GITHUB_REPO || 'anomalyco/opencode' }} - run: | - set -euo pipefail - - repo="${OPENCODE_GITHUB_REPO:-anomalyco/opencode}" - version="$(node -e "const fs=require('fs'); const parsed=JSON.parse(fs.readFileSync('constants.json','utf8')); process.stdout.write(String(parsed.opencodeVersion||'').trim().replace(/^v/,''));")" - version="$(echo "$version" | tr -d '\r\n' | sed 's/^v//')" - - if [ -z "$version" ]; then - echo "Unable to resolve OpenCode version from constants.json." >&2 - exit 1 - fi - - opencode_asset="opencode-linux-x64-baseline.tar.gz" - url="https://github.com/${repo}/releases/download/v${version}/${opencode_asset}" - tmp_dir="$RUNNER_TEMP/opencode" - extract_dir="$tmp_dir/extracted" - rm -rf "$tmp_dir" - mkdir -p "$extract_dir" - - curl_headers=() - if [ -n "${GITHUB_TOKEN:-}" ]; then - curl_headers+=( -H "Authorization: Bearer ${GITHUB_TOKEN}" ) - fi - curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${curl_headers[@]}" -o "$tmp_dir/$opencode_asset" "$url" - tar -xzf "$tmp_dir/$opencode_asset" -C "$extract_dir" - - if [ -f "$extract_dir/opencode" ]; then - bin_path="$extract_dir/opencode" - else - echo "OpenCode binary not found in archive" - ls -la "$extract_dir" - exit 1 - fi - - target_name="opencode-x86_64-unknown-linux-gnu" - mkdir -p apps/desktop/src-tauri/sidecars - cp "$bin_path" "apps/desktop/src-tauri/sidecars/${target_name}" - chmod 755 "apps/desktop/src-tauri/sidecars/${target_name}" - - - name: Prepare desktop sidecars - run: pnpm -C apps/desktop prepare:sidecar - - - name: Run Rust tests (engine + sidecar resolution) - run: cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml --locked - - - name: Build desktop app - run: pnpm --filter @openwork/desktop exec tauri build --config src-tauri/tauri.conf.ci.json --target x86_64-unknown-linux-gnu --bundles deb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f241cbd26..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: CI - -on: - push: - branches: - - dev - pull_request: - branches: - - dev - -permissions: - contents: read - -jobs: - build-web: - name: Build Web - runs-on: blacksmith-4vcpu-ubuntu-2404 - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.27.0 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build web - run: pnpm --filter @openwork-ee/den-web build - - build-den: - name: Build Den services - runs-on: blacksmith-4vcpu-ubuntu-2404 - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.27.0 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build den-api - run: pnpm --filter @openwork-ee/den-api build - - - name: Build den-worker-proxy - run: pnpm --filter @openwork-ee/den-worker-proxy build - - build-orchestrator-binary: - name: Build openwork orchestrator binary - runs-on: blacksmith-4vcpu-ubuntu-2404 - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.27.0 - - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: 1.3.9 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Typecheck openwork-orchestrator - run: pnpm --filter openwork-orchestrator typecheck - - - name: Build openwork orchestrator binary - run: pnpm --filter openwork-orchestrator build:bin - - - name: Validate compiled binary - run: | - ./apps/orchestrator/dist/bin/openwork --version - ./apps/orchestrator/dist/bin/openwork --help >/dev/null diff --git a/.github/workflows/opencode-agents.yml b/.github/workflows/opencode-agents.yml index b8adb12d7..8abafe429 100644 --- a/.github/workflows/opencode-agents.yml +++ b/.github/workflows/opencode-agents.yml @@ -1,14 +1,23 @@ name: Opencode Agents on: - issues: - types: [opened] - pull_request_target: - types: [opened] + workflow_dispatch: + inputs: + target: + description: Run issue triage or duplicate PR check + required: true + type: choice + options: + - issue + - pull_request + number: + description: Issue or pull request number + required: true + type: number jobs: triage-issue: - if: github.event_name == 'issues' + if: inputs.target == 'issue' runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: read @@ -33,17 +42,18 @@ jobs: env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_TITLE: ${{ github.event.issue.title }} - ISSUE_BODY: ${{ github.event.issue.body }} + ISSUE_NUMBER: ${{ inputs.number }} run: | cat > /tmp/issue_prompt.txt <<'PROMPT_EOF' The following issue was just opened, triage it: PROMPT_EOF + ISSUE_TITLE="$(gh issue view "$ISSUE_NUMBER" --json title --jq .title)" + ISSUE_BODY="$(gh issue view "$ISSUE_NUMBER" --json body --jq .body)" printf '\nTitle: %s\n\n%s\n' "$ISSUE_TITLE" "$ISSUE_BODY" >> /tmp/issue_prompt.txt opencode run --agent triage "$(cat /tmp/issue_prompt.txt)" duplicate-prs: - if: github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'opencode-agent[bot]' + if: inputs.target == 'pull_request' runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: read @@ -67,7 +77,7 @@ jobs: - name: Build prompt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} + PR_NUMBER: ${{ inputs.number }} run: | { echo "Check for duplicate PRs related to this new PR:" @@ -84,7 +94,7 @@ jobs: env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} + PR_NUMBER: ${{ inputs.number }} run: | opencode run --agent duplicate-pr "$(cat pr_info.txt)" > /tmp/comment_output.txt