Commit Graph
32 Commits
Author SHA1 Message Date
kaitranntt 36386209be ci: improve issue tagging and label management in release workflows 2025-12-21 18:57:46 -05:00
kaitranntt df77745eca fix(update): correct dev version comparison semantic
- dev versions (X.Y.Z-dev.N) now treated as newer than base release (X.Y.Z)
- reflects convention that dev work is AFTER the release, not before
- update GH Actions message to use 'ccs update --dev' instead of npm install
- update tests to match new semantic
2025-12-20 19:48:05 -05:00
kaitranntt dce4b36fc6 fix(ci): use custom dev versioning to preserve stable version coupling
Replaces semantic-release for dev branch with custom script that:
- Bases dev versions on current stable (e.g., 6.7.1-dev.N)
- Increments only the dev number, not the base version
- Keeps GitHub releases, issue tagging, Discord notifications
2025-12-20 19:05:44 -05:00
kaitranntt cff38ac53d fix(ci): use built-in GITHUB_TOKEN for release comments
Changes semantic-release to use the built-in GITHUB_TOKEN instead of
PAT_TOKEN so that release comments appear from github-actions[bot]
instead of the repository owner's personal account.

PAT_TOKEN is still used for checkout to ensure downstream workflows
can be triggered by the release commits.
2025-12-19 04:07:45 -05:00
kaitranntt 0f590c80d6 feat(ci): add semantic-release for dev branch with rich Discord notifications
- add .releaserc.cjs with branch-aware config (dev=prerelease, main=stable)

- add scripts/send-discord-release.cjs that parses CHANGELOG.md

- replace custom VERSION bumping with semantic-release

- add Discord webhook URL validation

- add release detection to prevent false notifications
2025-12-19 01:00:41 -05:00
kaitranntt ee76d663ae feat(ci): add Discord notifications for releases
- stable releases: fetch GH release, post green embed with changelog

- dev releases: post orange embed with version info

- graceful skip if webhook not configured
2025-12-19 00:26:22 -05:00
kaitranntt 4b969b6870 fix(ci): remove deprecated installer references from dev-release workflow
The native shell installers (install.sh, install.ps1) were removed in the
recent refactor, but the dev-release workflow still tried to update and
commit them, causing CI failures.
2025-12-18 18:16:39 -05:00
kaitranntt 5a8db2c1ee fix(ci): prevent shell injection from PR body markdown
Pass PR title and body via env vars instead of direct interpolation.
Prevents backticks in markdown code blocks from being executed as shell commands.
2025-12-13 23:31:52 -05:00
kaitranntt 27f9ea8f0f fix(ci): improve issue tagging - use bot, skip duplicates, simpler msg
- Use GITHUB_TOKEN for comments (posts as github-actions[bot])
- Skip issues already labeled released-dev (avoid spam)
- Simpler one-line comment format
2025-12-12 16:14:48 -05:00
kaitranntt 99f3a674b8 perf(ci): add HUSKY=0 to release workflow 2025-12-12 16:11:46 -05:00
kaitranntt d39095c7d6 perf(ci): reduce test redundancy from 4x to 1x per release
- Remove tests from pre-commit hook (keep typecheck+lint only)
- Remove build+validate from prepublishOnly/prepack (CI handles it)
- Add HUSKY=0 to CI commit step to skip hooks

Before: 4 test runs per release (pre-commit, CI validate, prepublishOnly, prepack)
After: 1 test run (CI validate only)
2025-12-12 16:11:06 -05:00
kaitranntt 763928f282 fix(ci): resolve YAML syntax error in dev-release workflow
Multi-line heredoc in issue comment was breaking YAML parsing.
Use inline multi-line string with proper indentation instead.
2025-12-12 15:57:24 -05:00
kaitranntt 5ef3e324f8 ci(release): add issue labeling for dev releases
- Add label-pending-release.yml workflow to tag issues when PR created
- Update dev-release.yml to comment and label issues after npm publish
- Labels: pending-release (yellow), released-dev (blue)
- Auto-removes pending-release when released-dev is applied
2025-12-12 05:57:58 -05:00
kaitranntt bff6acb2af chore: add GitHub Sponsors funding configuration
Add FUNDING.yml to enable "Sponsor" button on repository
2025-12-11 20:52:17 -05:00
kaitranntt 8095a4bc07 ci: optimize build pipeline to eliminate redundant builds
- validate now uses test:all directly (build already done)
- Added test:ci script for explicit CI usage
- ci.yml now builds UI deps and uses build:all
- dev-release.yml separates build and validate steps
- Reduces build count from 3-4 to 1 per release cycle
2025-12-09 17:47:33 -05:00
kaitranntt 8bffd5fc17 ci(release): update release workflows 2025-12-07 22:25:01 -05:00
kaitranntt 9063c11e1f ci: add pr validation workflow for install, build, and lint 2025-12-05 15:01:40 -05:00
kaitranntt 64a8e86db4 fix(ci): add path filtering to deploy-ccs-worker pull request trigger 2025-12-04 15:51:36 -05:00
kaitranntt 482f3a7fc6 fix(dev-release): find next available dev version from npm 2025-12-04 01:26:05 -05:00
kaitranntt 942b4b92cf feat(release): simplify dev versioning with stable base
- Remove dev branch from semantic-release (main only)
- Add dev-release.yml: simple X.Y.Z-dev.N bump workflow
- Update sync workflow: handle merge conflicts for version files
- Update release.yml: trigger only on main branch

Dev versions now stay at {stable}-dev.N until merged to main.
PR merge commit type (feat/fix) determines actual version bump.
2025-12-04 01:23:46 -05:00
kaitranntt 808a890db3 ci(workflow): add auto-sync dev after main release
Automatically merges main into dev after Release workflow completes.
Keeps dev ahead with next version number after stable releases.
2025-12-04 01:15:13 -05:00
kaitranntt 9f40a0e255 chore: rename integration branch from beta to dev
Update CI/CD configuration, documentation, and scripts to use dev as the
primary integration branch instead of beta. Changes include GitHub Actions
workflow triggers, semantic-release configuration, and all relevant
documentation and helper scripts.
2025-12-02 20:50:00 -05:00
kaitranntt d93a34b634 ci(release): add workflow_dispatch trigger for manual releases 2025-11-30 22:02:13 -05:00
kaitranntt 04af7e7c09 fix(ci): use pat token to bypass branch protection 2025-11-30 19:12:58 -05:00
kaitranntt d3d96371de feat(release): implement semantic versioning automation with conventional commits
- Add semantic-release for automated npm publishing
- Add commitlint + husky for commit message enforcement
- Add professional branching strategy (beta → main workflow)
- Create .releaserc.json with multi-branch config
- Create sync-version-plugin.cjs for VERSION file sync
- Update release.yml workflow (Node.js 22 required)
- Update CLAUDE.md and CONTRIBUTING.md with new workflow
- Deprecate manual bump-version.sh script
2025-11-30 18:56:02 -05:00
kaitranntt c7efce3432 fix(ci): add Bun setup and build steps to npm publish workflow
The npm publish was failing because:
1. Bun runtime was not installed (prepublishOnly uses bun commands)
2. dist/ was not built before publish

Added:
- oven-sh/setup-bun@v2 action
- bun install step
- bun run build step
2025-11-28 21:00:53 -05:00
Tam Nhu (Kai) TranandGitHub f034c25a61 feat: implement native multi-account switching with isolated instances (#3)
* 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
2025-11-09 18:26:49 -05:00
kaitranntt 7e2ee14f6f ci(npm): fix github release parameter name 2025-11-05 11:35:29 -05:00
kaitranntt 80a5200cae fix: terminal termination & simplified detection (v2.4.1)
Critical Fixes:
- Fixed PowerShell terminal closing when using `irm | iex` installation
  * Changed `exit 1` to `return` in install.ps1 (line 229)
  * Terminal now stays open on errors, showing full error messages
  * Affects: Windows PowerShell 5.1+, PowerShell 7+

- Fixed installation download path
  * Changed `/ccs.ps1` to `/lib/ccs.ps1` in install.ps1 (line 223)
  * Resolves standalone installation failures from GitHub

- Simplified Claude CLI detection logic across all platforms
  * Removed complex validation that failed with npm-installed Claude
  * Now trusts system PATH (standard case for users)
  * Falls back to CCS_CLAUDE_PATH for custom installations
  * Fixes: `where.exe claude` shows installed but CCS reports "not found"

Improvements:
- Simplified error messages (removed lengthy search location details)
- Reduced codebase by 332 lines (454 deleted, 122 added)
- npm package size reduced: 17.2 KB → 15.9 KB (7.6% smaller)

Cross-Platform Parity:
- bash (lib/ccs): Simplified detection, removed validate_claude_cli
- PowerShell (lib/ccs.ps1): Simplified detection, removed Test-ClaudeCli
- Node.js (bin/*.js): Simplified detection, removed validateClaudeCli
- All versions now use identical trust-the-PATH approach

Files Modified:
- installers/install.ps1: exit→return, download path fix
- lib/ccs.ps1: simplified detection (165 lines removed)
- lib/ccs: simplified detection (172 lines removed)
- bin/claude-detector.js: simplified detection (86 lines removed)
- bin/ccs.js: removed validation calls (31 lines removed)
- .github/workflows/publish-npm.yml: fixed package name
- CHANGELOG.md: comprehensive v2.4.1 release notes
- VERSION, package.json: bumped to 2.4.1

Testing: bash validated, npm syntax checked, manual Windows testing recommended
2025-11-04 21:54:05 -05:00
kaitranntt c17e3e8e3b feat(ccs): complete PowerShell 7+ fixes and Node.js standalone refactor
- Fix PowerShell 7 syntax errors (ampersand, pipe chars, regex patterns)
- Refactor bin/ccs.js to standalone Node.js implementation
- Add modular architecture (helpers, claude-detector, config-manager)
- Create comprehensive test suite with 95% coverage
- Add npm publishing workflow and documentation
- Enhance cross-platform compatibility and error handling
- Achieve 60% performance improvement over shell spawning

Breaking Change: Node.js npm package no longer spawns shell processes
2025-11-04 21:26:13 -05:00
kaitranntt edc89c4a12 fix(ci): add wrangler config and upgrade to v4.45.3
- Add wrangler.toml with compatibility_date to fix CI deployment
- Upgrade Wrangler from v3.90.0 to v4.45.3
- Simplify deploy command to use config file
- Add wrangler.toml to workflow trigger paths

Fixes CloudFlare Worker deployment failure due to missing compatibility_date parameter.
2025-11-02 20:33:55 -05:00
kaitrannttandClaude Code e9eb215d1f fix(core): add VERSION file handling and comprehensive test coverage
This commit fixes version management and argument parsing issues across
both Windows and Linux/macOS platforms, achieving 100% test coverage.

Changes:
- Add VERSION file installation to both installers (install.sh, install.ps1)
- Fix version/help command detection when using 'powershell -File' syntax
- Rename PowerShell param from $Profile to $ProfileOrFlag for clarity
- Add $FirstArg detection to check both ProfileOrFlag and RemainingArgs
- Create comprehensive edge case test suites for both platforms:
  * tests/edge-cases.ps1 - 31 tests for Windows (100% pass)
  * tests/edge-cases.sh - 37 tests for Linux/macOS (100% pass)
- Fix multiline regex matching in tests for error messages
- Update test expectations to match platform-specific behavior
- Reorganize project structure:
  * Move installers to installers/ directory
  * Add scripts/ directory for version management
  * Add config/ directory for configuration templates
  * Add docs/ directory for documentation

Test Results:
- Windows (PowerShell): 31/31 tests passing (100%)
- Linux/macOS (Bash): 37/37 tests passing (100%)

Breaking Changes: None
- Installers moved but GitHub URLs updated in README files
- All existing functionality preserved

Co-authored-by: Claude Code <claude@anthropic.com>
2025-11-02 20:27:45 -05:00