|
| 1 | +# Quick Release Guide |
| 2 | + |
| 3 | +## TL;DR - Release Checklist |
| 4 | + |
| 5 | +For a quick release of version `X.Y.Z`: |
| 6 | + |
| 7 | +```bash |
| 8 | +# 1. Make sure everything is ready |
| 9 | +swift test # All tests must pass |
| 10 | +swift build -c release # Must build successfully |
| 11 | + |
| 12 | +# 2. Update CHANGELOG.md |
| 13 | +# - Add release date to version section |
| 14 | +# - Create new [Unreleased] section at top |
| 15 | + |
| 16 | +# 3. Commit and run release script |
| 17 | +git add . |
| 18 | +git commit -m "Prepare release vX.Y.Z" |
| 19 | +./scripts/release.sh X.Y.Z |
| 20 | +``` |
| 21 | + |
| 22 | +That's it! The GitHub Action will handle creating the release automatically. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Detailed Steps |
| 27 | + |
| 28 | +### 1. Pre-Release Checks |
| 29 | + |
| 30 | +```bash |
| 31 | +# Ensure you're on main branch |
| 32 | +git checkout main |
| 33 | +git pull origin main |
| 34 | + |
| 35 | +# Run all tests |
| 36 | +swift test |
| 37 | + |
| 38 | +# Build in release mode |
| 39 | +swift build -c release |
| 40 | + |
| 41 | +# Check for uncommitted changes |
| 42 | +git status |
| 43 | +``` |
| 44 | + |
| 45 | +### 2. Update CHANGELOG.md |
| 46 | + |
| 47 | +Edit `CHANGELOG.md`: |
| 48 | + |
| 49 | +```markdown |
| 50 | +# Changelog |
| 51 | + |
| 52 | +## [Unreleased] |
| 53 | +<!-- New section for future changes --> |
| 54 | + |
| 55 | +## [X.Y.Z] - 2025-10-04 |
| 56 | + |
| 57 | +### Added |
| 58 | +- New feature 1 |
| 59 | +- New feature 2 |
| 60 | + |
| 61 | +### Fixed |
| 62 | +- Bug fix 1 |
| 63 | + |
| 64 | +### Changed |
| 65 | +- Breaking change 1 (if any) |
| 66 | +``` |
| 67 | + |
| 68 | +### 3. Commit Changes |
| 69 | + |
| 70 | +```bash |
| 71 | +git add CHANGELOG.md |
| 72 | +git commit -m "Prepare release vX.Y.Z" |
| 73 | +git push origin main |
| 74 | +``` |
| 75 | + |
| 76 | +### 4. Create Release |
| 77 | + |
| 78 | +Option A - Use the script (recommended): |
| 79 | +```bash |
| 80 | +./scripts/release.sh X.Y.Z |
| 81 | +``` |
| 82 | + |
| 83 | +Option B - Manual: |
| 84 | +```bash |
| 85 | +git tag -a vX.Y.Z -m "Release version X.Y.Z" |
| 86 | +git push origin main |
| 87 | +git push origin vX.Y.Z |
| 88 | +``` |
| 89 | + |
| 90 | +### 5. Verify Release |
| 91 | + |
| 92 | +1. Go to https://github.com/PinkQween/Math/actions |
| 93 | +2. Watch the "Release" workflow complete |
| 94 | +3. Check https://github.com/PinkQween/Math/releases |
| 95 | +4. Edit release notes if needed |
| 96 | + |
| 97 | +### 6. Test Installation |
| 98 | + |
| 99 | +```bash |
| 100 | +# Create a test project |
| 101 | +mkdir test-math |
| 102 | +cd test-math |
| 103 | +swift package init --type executable |
| 104 | + |
| 105 | +# Add dependency |
| 106 | +cat > Package.swift << EOF |
| 107 | +// swift-tools-version: 6.1 |
| 108 | +import PackageDescription |
| 109 | +
|
| 110 | +let package = Package( |
| 111 | + name: "test-math", |
| 112 | + dependencies: [ |
| 113 | + .package(url: "https://github.com/PinkQween/Math.git", from: "X.Y.Z") |
| 114 | + ], |
| 115 | + targets: [ |
| 116 | + .executableTarget(name: "test-math", dependencies: ["Math"]) |
| 117 | + ] |
| 118 | +) |
| 119 | +EOF |
| 120 | + |
| 121 | +# Test it works |
| 122 | +swift package update |
| 123 | +swift build |
| 124 | +``` |
| 125 | + |
| 126 | +## Version Numbers |
| 127 | + |
| 128 | +- **Alpha** (0.x.x): Early development, expect breaking changes |
| 129 | +- **Beta** (1.0.0-beta.x): Feature-complete, minimal API changes |
| 130 | +- **RC** (1.0.0-rc.x): Release candidate, final testing |
| 131 | +- **Stable** (1.0.0+): Production-ready, semantic versioning |
| 132 | + |
| 133 | +### Current Version: 0.1.0 (Alpha) |
| 134 | + |
| 135 | +Next releases: |
| 136 | +- 0.1.1 - Bug fixes only |
| 137 | +- 0.2.0 - New features (backward compatible if possible) |
| 138 | +- 1.0.0-beta.1 - First beta (when API is stable) |
| 139 | +- 1.0.0 - First stable release |
| 140 | + |
| 141 | +## Troubleshooting |
| 142 | + |
| 143 | +**Q: Tag already exists** |
| 144 | +```bash |
| 145 | +# Delete local tag |
| 146 | +git tag -d vX.Y.Z |
| 147 | + |
| 148 | +# Delete remote tag |
| 149 | +git push origin :refs/tags/vX.Y.Z |
| 150 | +``` |
| 151 | + |
| 152 | +**Q: Need to fix something after tagging** |
| 153 | +```bash |
| 154 | +# Delete the tag and redo |
| 155 | +git tag -d vX.Y.Z |
| 156 | +git push origin :refs/tags/vX.Y.Z |
| 157 | + |
| 158 | +# Make fixes |
| 159 | +git add . |
| 160 | +git commit -m "Fix for release" |
| 161 | + |
| 162 | +# Re-run release |
| 163 | +./scripts/release.sh X.Y.Z |
| 164 | +``` |
| 165 | + |
| 166 | +**Q: GitHub Action failed** |
| 167 | +- Check https://github.com/PinkQween/Math/actions |
| 168 | +- Fix the issue |
| 169 | +- Re-run the workflow or delete/recreate the tag |
| 170 | + |
| 171 | +## Post-Release |
| 172 | + |
| 173 | +- [ ] Announce on relevant channels |
| 174 | +- [ ] Update any documentation sites |
| 175 | +- [ ] Monitor for issues |
| 176 | +- [ ] Respond to GitHub issues/discussions |
0 commit comments