mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 22:21:20 +00:00
* feat: implement native multi-account switching with isolated instances Add account-based profile management system that enables users to run multiple Claude accounts concurrently with complete isolation. Key features: - Profile registry (~/.ccs/profiles.json) tracks account profiles - Instance isolation (~/.ccs/instances/<profile>/) for each account - Auth commands: create, list, show, remove, default - Backward compatible with settings-based profiles (GLM, Kimi) - Auto-copies global .claude configs to new instances Implementation: - Phase 1: Profile detection logic (account vs settings-based) - Phase 2: Instance management (initialization, validation) - Phase 3: Auth CLI commands - Phase 4: Profile registry CRUD operations - Phase 5: Execution routing based on profile type Both lib/ccs (bash) and lib/ccs.ps1 (PowerShell) updated for cross-platform support. * fix(ci): add pull_request trigger to satisfy branch protection The branch protection rule requires "Deploy ccs-installer to CloudFlare" status check to pass, but the workflow only ran on push to main branch. This caused PRs to wait indefinitely for a status that never reported. Changes: - Add pull_request trigger with same path filters - Split deployment into conditional steps: - PR mode: dry-run validation only (--dry-run flag) - Production: actual deployment (push to main only) - Keeps same job name to satisfy branch protection requirement Security: - No deployment from PR branches (dry-run only) - Production deploy only when push to main AND ref check - Secrets used safely in both contexts This fixes PR #3 which was stuck waiting for status. * fix(ci): remove path filter from pull_request trigger The path filter prevented workflow from running on PRs that don't modify worker/installer files, causing required status check to never report. This blocked PR #3 indefinitely. Changes: - Remove paths filter from pull_request trigger - Keep paths filter on push to main (optimize deployments) - Workflow now runs on ALL PRs to satisfy branch protection Trade-off: - PRs changing non-worker files will trigger unnecessary dry-run - But this ensures required status check always reports - Small cost for reliability and simpler configuration Alternatives considered: - Path-aware required checks: Not supported by GitHub - Remove required check: Loses CI validation - Add all paths to filter: Makes config brittle
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Deploy CCS CloudFlare Worker
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'scripts/worker.js'
|
|
- 'scripts/wrangler.toml'
|
|
- 'installers/**'
|
|
|
|
# Run on all PRs to satisfy branch protection (no path filter)
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# Allow manual trigger
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Deploy ccs-installer to CloudFlare
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Validate Worker (PR Mode)
|
|
if: github.event_name == 'pull_request'
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
workingDirectory: scripts
|
|
wranglerVersion: "4.45.3"
|
|
command: deploy --dry-run
|
|
|
|
- name: Deploy Worker (Production)
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
workingDirectory: scripts
|
|
wranglerVersion: "4.45.3"
|
|
command: deploy
|