Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
9.9 KiB
JSON

{"content": "---\nallowed-tools: Read, Write, Edit, Bash\nargument-hint: [version-type] | patch | minor | major | --pre-release | --hotfix\ndescription: Prepare and validate release packages with comprehensive testing, documentation, and automation\n---\n\n# Release Preparation\n\nPrepare and validate release: $ARGUMENTS\n\n## Current Release Context\n\n- Current version: !`git describe --tags --abbrev=0 2>/dev/null || echo \"No previous releases\"`\n- Package version: @package.json or @setup.py or @pyproject.toml or @go.mod (if exists)\n- Unreleased changes: !`git log $(git describe --tags --abbrev=0)..HEAD --oneline 2>/dev/null | wc -l || echo \"All commits\"`\n- Branch status: !`git status --porcelain | wc -l || echo \"0\"` uncommitted changes\n- Build status: !`npm test 2>/dev/null || python -m pytest 2>/dev/null || go test ./... 2>/dev/null || echo \"Test framework detection needed\"`\n\n## Task\n\nSystematic release preparation: $ARGUMENTS\n\n1. **Release Planning and Validation**\n - Determine release version number (semantic versioning)\n - Review and validate all features included in release\n - Check that all planned issues and features are complete\n - Verify release criteria and acceptance requirements\n\n2. **Pre-Release Checklist**\n - Ensure all tests are passing (unit, integration, E2E)\n - Verify code coverage meets project standards\n - Complete security vulnerability scanning\n - Perform performance testing and validation\n - Review and approve all pending pull requests\n\n3. **Version Management**\n ```bash\n # Check current version\n git describe --tags --abbrev=0\n \n # Determine next version (semantic versioning)\n # MAJOR.MINOR.PATCH\n # MAJOR: Breaking changes\n # MINOR: New features (backward compatible)\n # PATCH: Bug fixes (backward compatible)\n \n # Example version updates\n # 1.2.3 -> 1.2.4 (patch)\n # 1.2.3 -> 1.3.0 (minor)\n # 1.2.3 -> 2.0.0 (major)\n ```\n\n4. **Code Freeze and Branch Management**\n ```bash\n # Create release branch from main\n git checkout main\n git pull origin main\n git checkout -b release/v1.2.3\n \n # Alternative: Use main branch directly for smaller releases\n # Ensure no new features are merged during release process\n ```\n\n5. **Version Number Updates**\n - Update package.json, setup.py, or equivalent version files\n - Update version in application configuration\n - Update version in documentation and README\n - Update API version if applicable\n\n ```bash\n # Node.js projects\n npm version patch # or minor, major\n \n # Python projects\n # Update version in setup.py, __init__.py, or pyproject.toml\n \n # Manual version update\n sed -i 's/\"version\": \"1.2.2\"/\"version\": \"1.2.3\"/' package.json\n ```\n\n6. **Changelog Generation**\n ```markdown\n # CHANGELOG.md\n \n ## [1.2.3] - 2024-01-15\n \n ### Added\n - New user authentication system\n - Dark mode support for UI\n - API rate limiting functionality\n \n ### Changed\n - Improved database query performance\n - Updated user interface design\n - Enhanced error handling\n \n ### Fixed\n - Fixed memory leak in background tasks\n - Resolved issue with file upload validation\n - Fixed timezone handling in date calculations\n \n ### Security\n - Updated dependencies with security patches\n - Improved input validation and sanitization\n ```\n\n7. **Documentation Updates**\n - Update API documentation with new endpoints\n - Revise user documentation and guides\n - Update installation and deployment instructions\n - Review and update README.md\n - Update migration guides if needed\n\n8. **Dependency Management**\n ```bash\n # Update and audit dependencies\n npm audit fix\n npm update\n \n # Python\n pip-audit\n pip freeze > requirements.txt\n \n # Review security vulnerabilities\n npm audit\n snyk test\n ```\n\n9. **Build and Artifact Generation**\n ```bash\n # Clean build environment\n npm run clean\n rm -rf dist/ build/\n \n # Build production artifacts\n npm run build\n \n # Verify build artifacts\n ls -la dist/\n \n # Test built artifacts\n npm run test:build\n ```\n\n10. **Testing and Quality Assurance**\n - Run comprehensive test suite\n - Perform manual testing of critical features\n - Execute regression testing\n - Conduct user acceptance testing\n - Validate in staging environment\n\n ```bash\n # Run all tests\n npm test\n npm run test:integration\n npm run test:e2e\n \n # Check code coverage\n npm run test:coverage\n \n # Performance testing\n npm run test:performance\n ```\n\n11. **Security and Compliance Verification**\n - Run security scans and penetration testing\n - Verify compliance with security standards\n - Check for exposed secrets or credentials\n - Validate data protection and privacy measures\n\n12. **Release Notes Preparation**\n ```markdown\n # Release Notes v1.2.3\n \n ## 🎉 What's New\n - **Dark Mode**: Users can now switch to dark mode in settings\n - **Enhanced Security**: Improved authentication with 2FA support\n - **Performance**: 40% faster page load times\n \n ## 🔧 Improvements\n - Better error messages for form validation\n - Improved mobile responsiveness\n - Enhanced accessibility features\n \n ## 🐛 Bug Fixes\n - Fixed issue with file downloads in Safari\n - Resolved memory leak in background tasks\n - Fixed timezone display issues\n \n ## 📚 Documentation\n - Updated API documentation\n - New user onboarding guide\n - Enhanced troubleshooting section\n \n ## 🔄 Migration Guide\n - No breaking changes in this release\n - Automatic database migrations included\n - See [Migration Guide](link) for details\n ```\n\n13. **Release Tagging and Versioning**\n ```bash\n # Create annotated tag\n git add .\n git commit -m \"chore: prepare release v1.2.3\"\n git tag -a v1.2.3 -m \"Release version 1.2.3\n \n Features:\n - Dark mode support\n - Enhanced authentication\n \n Bug fixes:\n - Fixed file upload issues\n - Resolved memory leaks\"\n \n # Push tag to remote\n git push origin v1.2.3\n git push origin release/v1.2.3\n ```\n\n14. **Deployment Preparation**\n - Prepare deployment scripts and configurations\n - Update environment variables and secrets\n - Plan deployment strategy (blue-green, rolling, canary)\n - Set up monitoring and alerting for release\n - Prepare rollback procedures\n\n15. **Staging Environment Validation**\n ```bash\n # Deploy to staging\n ./deploy-staging.sh v1.2.3\n \n # Run smoke tests\n npm run test:smoke:staging\n \n # Manual validation checklist\n # [ ] User login/logout\n # [ ] Core functionality\n # [ ] New features\n # [ ] Performance metrics\n # [ ] Security checks\n ```\n\n16. **Production Deployment Planning**\n - Schedule deployment window\n - Notify stakeholders and users\n - Prepare maintenance mode if needed\n - Set up deployment monitoring\n - Plan communication strategy\n\n17. **Release Automation Setup**\n ```yaml\n # GitHub Actions Release Workflow\n name: Release\n \n on:\n push:\n tags:\n - 'v*'\n \n jobs:\n release:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - name: Setup Node.js\n uses: actions/setup-node@v3\n with:\n node-version: '18'\n \n - name: Install dependencies\n run: npm ci\n \n - name: Run tests\n run: npm test\n \n - name: Build\n run: npm run build\n \n - name: Create Release\n uses: actions/create-release@v1\n env:\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n with:\n tag_name: ${{ github.ref }}\n release_name: Release ${{ github.ref }}\n draft: false\n prerelease: false\n ```\n\n18. **Communication and Announcements**\n - Prepare release announcement\n - Update status page and documentation\n - Notify customers and users\n - Share on relevant communication channels\n - Update social media and marketing materials\n\n19. **Post-Release Monitoring**\n - Monitor application performance and errors\n - Track user adoption of new features\n - Monitor system metrics and alerts\n - Collect user feedback and issues\n - Prepare hotfix procedures if needed\n\n20. **Release Retrospective**\n - Document lessons learned\n - Review release process effectiveness\n - Identify improvement opportunities\n - Update release procedures\n - Plan for next release cycle\n\n**Release Types and Considerations:**\n\n**Patch Release (1.2.3 → 1.2.4):**\n- Bug fixes only\n- No new features\n- Minimal testing required\n- Quick deployment\n\n**Minor Release (1.2.3 → 1.3.0):**\n- New features (backward compatible)\n- Enhanced functionality\n- Comprehensive testing\n- User communication needed\n\n**Major Release (1.2.3 → 2.0.0):**\n- Breaking changes\n- Significant new features\n- Migration guide required\n- Extended testing period\n- User training and support\n\n**Hotfix Release:**\n```bash\n# Emergency hotfix process\ngit checkout main\ngit pull origin main\ngit checkout -b hotfix/critical-bug-fix\n\n# Make minimal fix\ngit add .\ngit commit -m \"hotfix: fix critical security vulnerability\"\n\n# Fast-track testing and deployment\nnpm test\ngit tag -a v1.2.4-hotfix.1 -m \"Hotfix for critical security issue\"\ngit push origin hotfix/critical-bug-fix\ngit push origin v1.2.4-hotfix.1\n```\n\nRemember to:\n- Test everything thoroughly before release\n- Communicate clearly with all stakeholders\n- Have rollback procedures ready\n- Monitor the release closely after deployment\n- Document everything for future releases"}