|
| 1 | +# Semantic Release Setup |
| 2 | + |
| 3 | +This project uses [semantic-release](https://semantic-release.gitbook.io/) to automate version management and package publishing. |
| 4 | + |
| 5 | +## How it works |
| 6 | + |
| 7 | +1. **Commit messages** follow the [Conventional Commits](https://www.conventionalcommits.org/) specification |
| 8 | +2. **Semantic-release** analyzes commits and determines the next version number |
| 9 | +3. **GitHub Actions** automatically creates releases when changes are pushed to `main` |
| 10 | + |
| 11 | +## Commit Message Format |
| 12 | + |
| 13 | +``` |
| 14 | +<type>[optional scope]: <description> |
| 15 | +
|
| 16 | +[optional body] |
| 17 | +
|
| 18 | +[optional footer(s)] |
| 19 | +``` |
| 20 | + |
| 21 | +### Types |
| 22 | + |
| 23 | +- `feat`: A new feature (triggers minor version bump) |
| 24 | +- `fix`: A bug fix (triggers patch version bump) |
| 25 | +- `docs`: Documentation only changes |
| 26 | +- `style`: Changes that do not affect the meaning of the code |
| 27 | +- `refactor`: A code change that neither fixes a bug nor adds a feature |
| 28 | +- `perf`: A code change that improves performance |
| 29 | +- `test`: Adding missing tests or correcting existing tests |
| 30 | +- `chore`: Changes to the build process or auxiliary tools |
| 31 | + |
| 32 | +### Breaking Changes |
| 33 | + |
| 34 | +Add `BREAKING CHANGE:` in the footer or use `!` after the type to trigger a major version bump: |
| 35 | + |
| 36 | +``` |
| 37 | +feat!: remove deprecated API |
| 38 | +``` |
| 39 | + |
| 40 | +or |
| 41 | + |
| 42 | +``` |
| 43 | +feat: add new feature |
| 44 | +
|
| 45 | +BREAKING CHANGE: This removes the old API |
| 46 | +``` |
| 47 | + |
| 48 | +## Release Process |
| 49 | + |
| 50 | +### Regular Releases (main branch) |
| 51 | + |
| 52 | +1. Push commits to `main` branch |
| 53 | +2. GitHub Actions runs semantic-release |
| 54 | +3. If there are releasable changes: |
| 55 | + - Version is updated in `Sources/Helpers/Version.swift` |
| 56 | + - `CHANGELOG.md` is updated |
| 57 | + - Git tag is created |
| 58 | + - GitHub release is published |
| 59 | + |
| 60 | +### Release Candidates (rc branch) |
| 61 | + |
| 62 | +1. Push commits to `rc` branch |
| 63 | +2. GitHub Actions runs semantic-release |
| 64 | +3. If there are releasable changes: |
| 65 | + - Prerelease version is created (e.g., `2.31.0-rc.1`) |
| 66 | + - Version is updated in `Sources/Helpers/Version.swift` |
| 67 | + - `CHANGELOG.md` is updated |
| 68 | + - Git tag is created |
| 69 | + - GitHub prerelease is published |
| 70 | + |
| 71 | +## Manual Release |
| 72 | + |
| 73 | +To manually trigger a release: |
| 74 | + |
| 75 | +1. Go to Actions tab in GitHub |
| 76 | +2. Select "Semantic Release" workflow |
| 77 | +3. Click "Run workflow" |
| 78 | + |
| 79 | +## Configuration Files |
| 80 | + |
| 81 | +- `.releaserc.json`: Semantic-release configuration |
| 82 | +- `package.json`: Node.js dependencies |
| 83 | +- `.github/workflows/release.yml`: GitHub Actions workflow |
| 84 | +- `scripts/update-version.sh`: Version update script |
0 commit comments