Get your CI/CD pipeline up and running in under 10 minutes.
- Git repository initialized
- Node.js 18+ installed
- npm account created (https://www.npmjs.com/)
- GitHub repository created (ooples/token-optimizer-mcp)
cd C:\Users\cheat\source\repos\token-optimizer-mcp
npm installThis installs all CI/CD dependencies including:
- semantic-release
- commitlint
- conventional-changelog
-
Get your npm token:
- Go to https://www.npmjs.com/settings/ooples/tokens
- Click "Generate New Token" → "Classic Token"
- Select type: Automation
- Copy the token (starts with
npm_)
-
Add to GitHub:
- Go to https://github.com/ooples/token-optimizer-mcp/settings/secrets/actions
- Click "New repository secret"
- Name:
NPM_TOKEN - Value: Paste your token
- Click "Add secret"
.\.github\verify-setup.ps1chmod +x .github/verify-setup.sh
./.github/verify-setup.shExpected Output: All checks should pass ✓
# Create test branch
git checkout -b test/ci-verification
# Make a small change
echo "# CI/CD Pipeline Active" >> .github/CI_VERIFIED.md
# Commit with conventional format
git add .
git commit -m "docs: verify CI/CD pipeline setup"
# Push
git push origin test/ci-verificationgh pr create --title "docs: verify CI/CD pipeline" \
--body "This PR verifies the CI/CD pipeline is working correctly."- Go to https://github.com/ooples/token-optimizer-mcp/pulls
- Click "New pull request"
- Base: master, Compare: test/ci-verification
- Click "Create pull request"
What to expect:
- ✅ CI workflow runs (~10-15 min)
- ✅ Quality gates workflow runs (~10 min)
- ✅ Commitlint workflow runs (~1 min)
- ✅ All checks should pass
View progress:
- Go to: https://github.com/ooples/token-optimizer-mcp/settings/branches
- Click "Add rule"
- Branch name pattern:
master - Enable:
- ✅ Require a pull request before merging (1 approval)
- ✅ Require status checks to pass before merging
- ✅ Require branches to be up to date
- ✅ Require conversation resolution
- ✅ Require linear history
- ✅ Do not allow bypassing
- ❌ Allow force pushes (DISABLED)
- ❌ Allow deletions (DISABLED)
- Select these required checks:
- lint-and-format
- build
- test (18)
- test (20)
- test (22)
- performance-benchmarks
- integration-test
- bundle-size
- security-audit
- license-compliance
- commitlint
- Click "Create" or "Save changes"
- Get PR approval: Get a team member to review and approve
- Merge PR: Click "Squash and merge" on GitHub
- Watch release: Go to Actions tab, watch release workflow run
- Verify release:
- Check GitHub Releases: https://github.com/ooples/token-optimizer-mcp/releases
- Check npm:
npm view token-optimizer-mcp - Check CHANGELOG.md was updated
Solution: Wait for workflows to run at least once, then refresh branch protection settings.
Solution:
- Verify NPM_TOKEN is correct
- Check token hasn't expired
- Ensure token is "Automation" type
Solution:
- Ensure commits follow conventional format (
feat:,fix:, etc.) - Check
.releaserc.jsonis valid - Review workflow logs for errors
- CI/CD pipeline is active
- First release published
- Create bundle size baseline:
npm run build && du -sb dist | cut -f1 > .github/bundle-size-baseline.txt - Add Codecov token (optional)
- Set up Discord/Slack notifications (optional)
- Add more tests to reach 80% coverage
- Create integration tests
- Create benchmark tests
- Train team on conventional commits
- Review Dependabot PRs weekly
- Monitor CI success rate
- Track bundle size trends
- Keep dependencies up to date
# Run tests locally
npm test
npm run test:coverage
# Build locally
npm run build
# Lint locally
npm run lint
npm run format:check
# Commit with conventional format
git commit -m "feat(scope): description"
git commit -m "fix(scope): description"
git commit -m "docs: description"
# Create release manually (emergency)
npm version patch # or minor, major
git push && git push --tags
npm publish- Full Documentation: .github/CI_CD.md
- Setup Guide: .github/setup-ci.md
- Branch Protection: .github/BRANCH_PROTECTION.md
- Release Flow: .github/RELEASE_FLOW.md
- Secrets Template: .github/SECRETS_TEMPLATE.md
- Issues: https://github.com/ooples/token-optimizer-mcp/issues
- Discussions: https://github.com/ooples/token-optimizer-mcp/discussions
Total Setup Time: ~10 minutes (plus ~25 minutes waiting for CI/release)
Ready to go! Your CI/CD pipeline is now fully automated. 🎉