diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beff013a..2e546985 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,60 @@ on: branches: [main] jobs: + # Verify all packages have consistent versions + version-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check version consistency + run: | + echo "Checking version consistency across all packages..." + + # Get the main version from apps/skillkit + MAIN_VERSION=$(node -p "require('./apps/skillkit/package.json').version") + echo "Main version: $MAIN_VERSION" + + # List of all packages to check + PACKAGES=( + "package.json" + "apps/skillkit/package.json" + "packages/cli/package.json" + "packages/core/package.json" + "packages/tui/package.json" + "packages/agents/package.json" + "packages/memory/package.json" + "packages/mesh/package.json" + "packages/messaging/package.json" + "packages/mcp-memory/package.json" + "packages/resources/package.json" + "docs/skillkit/package.json" + "docs/fumadocs/package.json" + ) + + FAILED=0 + for pkg in "${PACKAGES[@]}"; do + if [ -f "$pkg" ]; then + PKG_VERSION=$(node -p "require('./$pkg').version") + if [ "$PKG_VERSION" != "$MAIN_VERSION" ]; then + echo "❌ Version mismatch: $pkg has $PKG_VERSION (expected $MAIN_VERSION)" + FAILED=1 + else + echo "✓ $pkg: $PKG_VERSION" + fi + fi + done + + if [ $FAILED -eq 1 ]; then + echo "" + echo "Version mismatch detected!" + echo "Run: ./scripts/bump-version.sh $MAIN_VERSION" + exit 1 + fi + + echo "" + echo "All packages have consistent version: $MAIN_VERSION" + # Unit tests run on all Node versions test: runs-on: ubuntu-latest @@ -78,12 +132,14 @@ jobs: # Final status check for branch protection ci-success: runs-on: ubuntu-latest - needs: [test, e2e] + needs: [version-check, test, e2e] if: always() steps: - name: Check all jobs passed run: | - if [[ "${{ needs.test.result }}" != "success" ]] || [[ "${{ needs.e2e.result }}" != "success" ]]; then + if [[ "${{ needs.version-check.result }}" != "success" ]] || \ + [[ "${{ needs.test.result }}" != "success" ]] || \ + [[ "${{ needs.e2e.result }}" != "success" ]]; then echo "One or more jobs failed" exit 1 fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9d3d1b7..ad91e807 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,6 +16,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Verify tag matches package version + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/v}" + PKG_VERSION=$(node -p "require('./apps/skillkit/package.json').version") + echo "Tag version: $TAG_VERSION" + echo "Package version: $PKG_VERSION" + if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then + echo "❌ Tag version ($TAG_VERSION) doesn't match package version ($PKG_VERSION)" + echo "Please update package versions before creating the release tag." + exit 1 + fi + echo "✓ Version check passed" + - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/VERSIONING.md b/VERSIONING.md new file mode 100644 index 00000000..4fb4f6ad --- /dev/null +++ b/VERSIONING.md @@ -0,0 +1,93 @@ +# Versioning + +SkillKit uses **synchronized versioning** - all packages share the same version number. + +## Package List + +All these packages are kept in sync: + +| Package | Location | +|---------|----------| +| `skillkit` | `apps/skillkit/` | +| `@skillkit/cli` | `packages/cli/` | +| `@skillkit/core` | `packages/core/` | +| `@skillkit/tui` | `packages/tui/` | +| `@skillkit/agents` | `packages/agents/` | +| `@skillkit/memory` | `packages/memory/` | +| `@skillkit/mesh` | `packages/mesh/` | +| `@skillkit/messaging` | `packages/messaging/` | +| `@skillkit/mcp-memory` | `packages/mcp-memory/` | +| `@skillkit/resources` | `packages/resources/` | +| `skillkit-docs` | `docs/fumadocs/` | +| Website | `docs/skillkit/` | + +## How to Release + +### 1. Bump Version + +Use the version bump script: + +```bash +./scripts/bump-version.sh 1.8.1 +``` + +This updates all package.json files to the same version. + +### 2. Commit Changes + +```bash +git add -A +git commit -m "chore: bump version to 1.8.1" +git push origin main +``` + +### 3. Create Release + +```bash +gh release create v1.8.1 --generate-notes +``` + +Or with custom notes: + +```bash +gh release create v1.8.1 --title "v1.8.1 - Bug fixes" --notes "Release notes here" +``` + +### 4. Automated Publishing + +When you push a tag starting with `v`, the CI automatically: + +1. Verifies tag matches package versions +2. Runs tests +3. Publishes to npm +4. Publishes to GitHub Packages +5. Creates GitHub Release + +## CI Checks + +The CI validates version consistency on every PR: + +- **version-check** job compares all package versions +- Fails if any package has a different version +- Run `./scripts/bump-version.sh ` to fix mismatches + +## Semantic Versioning + +We follow [semver](https://semver.org/): + +- **MAJOR** (x.0.0): Breaking changes +- **MINOR** (0.x.0): New features, backward compatible +- **PATCH** (0.0.x): Bug fixes, backward compatible + +## Quick Commands + +```bash +# Check current versions +grep -r '"version"' apps/skillkit/package.json + +# Bump all packages +./scripts/bump-version.sh 1.8.1 + +# Create release +gh release create v1.8.1 --generate-notes +``` diff --git a/docs/fumadocs/package.json b/docs/fumadocs/package.json index 05d667c7..8bdf477b 100644 --- a/docs/fumadocs/package.json +++ b/docs/fumadocs/package.json @@ -1,6 +1,6 @@ { "name": "skillkit-docs", - "version": "1.0.0", + "version": "1.8.0", "private": true, "scripts": { "build": "next build", diff --git a/docs/skillkit/package.json b/docs/skillkit/package.json index 4c2192e5..6cf34687 100644 --- a/docs/skillkit/package.json +++ b/docs/skillkit/package.json @@ -1,7 +1,7 @@ { "name": "skillkit", "private": true, - "version": "0.0.0", + "version": "1.8.0", "type": "module", "scripts": { "dev": "vite", diff --git a/package.json b/package.json index 980e5c58..bda2d5a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "skillkit-monorepo", - "version": "2.0.0", + "version": "1.8.0", "private": true, "description": "Universal skills loader for AI coding agents - Monorepo", "type": "module", diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh new file mode 100755 index 00000000..cfaad748 --- /dev/null +++ b/scripts/bump-version.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +if [ -z "$1" ]; then + echo "Usage: ./scripts/bump-version.sh " + echo "Example: ./scripts/bump-version.sh 1.8.1" + exit 1 +fi + +VERSION=$1 + +echo "Bumping all packages to version $VERSION..." + +PACKAGES=( + "package.json" + "apps/skillkit/package.json" + "packages/cli/package.json" + "packages/core/package.json" + "packages/tui/package.json" + "packages/agents/package.json" + "packages/memory/package.json" + "packages/mesh/package.json" + "packages/messaging/package.json" + "packages/mcp-memory/package.json" + "packages/resources/package.json" + "docs/skillkit/package.json" + "docs/fumadocs/package.json" +) + +for pkg in "${PACKAGES[@]}"; do + if [ -f "$pkg" ]; then + npx -y json -I -f "$pkg" -e "this.version=\"$VERSION\"" + echo "✓ Updated $pkg" + else + echo "⚠ Skipped $pkg (not found)" + fi +done + +echo "" +echo "All packages updated to version $VERSION" +echo "" +echo "Next steps:" +echo " 1. git add -A" +echo " 2. git commit -m \"chore: bump version to $VERSION\"" +echo " 3. git push origin main" +echo " 4. gh release create v$VERSION --generate-notes"