|
| 1 | +# Release Procedures |
| 2 | + |
| 3 | +*These notes are meant for a maintainer to create official releases of MOLE.* |
| 4 | + |
| 5 | +In preparing a release, create a branch to hold pre-release commits. |
| 6 | +We ideally want all release mechanics to be in one commit, which will then be tagged. |
| 7 | + |
| 8 | +## Core Library Release |
| 9 | + |
| 10 | +Some minor bookkeeping updates are needed when releasing a new version of MOLE. |
| 11 | + |
| 12 | +The version number must be updated in: |
| 13 | + |
| 14 | +* `CITATION.cff` (update the `doi` field and `date-published` if needed) |
| 15 | +* `README.md` (if version-specific badges or information exist) |
| 16 | + |
| 17 | +Additionally, the release notes should be generated and reviewed. |
| 18 | +Use `git log --first-parent v1.0..` to get a sense of the pull requests that have been merged since the last release and thus might warrant emphasizing in the release notes. |
| 19 | + |
| 20 | +While doing this, gather a couple sentences for key features to highlight on [GitHub releases](https://github.com/csrc-sdsu/mole/releases). |
| 21 | + |
| 22 | +### Quality control and good citizenry |
| 23 | + |
| 24 | +1. **Testing**: Ensure all tests pass on supported platforms: |
| 25 | + - Run `make run_tests` for C++ tests |
| 26 | + - Run `make run_matlab_octave_tests` for MATLAB/Octave tests |
| 27 | + - Verify CI passes on all platforms (Ubuntu, macOS) |
| 28 | + |
| 29 | +2. **Documentation**: Ensure documentation builds successfully: |
| 30 | + - Check that the documentation workflow passes |
| 31 | + - Verify examples work correctly |
| 32 | + - Review any new documentation for accuracy |
| 33 | + |
| 34 | +3. **Dependencies**: Check that all dependencies are properly specified and up-to-date: |
| 35 | + - Verify CMake builds work on supported platforms |
| 36 | + - Check that installation instructions are current |
| 37 | + |
| 38 | +### Tagging and releasing on GitHub |
| 39 | + |
| 40 | +1. **Prepare the release commit**: |
| 41 | + ```bash |
| 42 | + git commit -am "MOLE v1.1.0" |
| 43 | + ``` |
| 44 | + More frequently, this is amending the commit message on an in-progress commit, after rebasing if applicable on latest `main`. |
| 45 | + |
| 46 | +2. **Push and review**: |
| 47 | + ```bash |
| 48 | + git push |
| 49 | + ``` |
| 50 | + This updates the PR holding release; opportunity for others to review. |
| 51 | + |
| 52 | +3. **Merge to main**: |
| 53 | + ```bash |
| 54 | + git switch main && git merge --ff-only HEAD@{1} |
| 55 | + ``` |
| 56 | + Fast-forward merge into `main`. |
| 57 | + |
| 58 | +4. **Tag the release**: |
| 59 | + ```bash |
| 60 | + git tag -a v1.1.0 -m "MOLE v1.1.0" |
| 61 | + ``` |
| 62 | + |
| 63 | +5. **Push tag**: |
| 64 | + ```bash |
| 65 | + git push origin main v1.1.0 |
| 66 | + ``` |
| 67 | + |
| 68 | +6. **Create GitHub Release**: |
| 69 | + - Go to [GitHub releases page](https://github.com/csrc-sdsu/mole/releases) |
| 70 | + - Click "Draft a new release" |
| 71 | + - Select the newly created tag |
| 72 | + - Use the tag name as the release title |
| 73 | + - Copy release notes from the automated generation (see below) |
| 74 | + - Add a few sentences highlighting key features |
| 75 | + - Publish the release |
| 76 | + |
| 77 | +### Archive Documentation on Zenodo |
| 78 | + |
| 79 | +For DOI-bearing releases: |
| 80 | + |
| 81 | +1. **Generate documentation PDF**: The documentation workflow automatically generates a PDF version |
| 82 | +2. **Update Zenodo record**: |
| 83 | + - Visit the [MOLE Zenodo record](https://zenodo.org/record/12752946) (update URL as needed) |
| 84 | + - Click "New version" |
| 85 | + - Upload the generated PDF documentation |
| 86 | + - Update author information if applicable |
| 87 | + - Publish the new version |
| 88 | + |
| 89 | +3. **Update repository with new DOI**: |
| 90 | + - Update `CITATION.cff` with the new DOI |
| 91 | + - Update `README.md` with the new DOI if referenced |
| 92 | + - Create a follow-up PR with these updates |
| 93 | + |
| 94 | +## Automated Release Notes |
| 95 | + |
| 96 | +MOLE uses GitHub Actions to automatically generate release notes when a new tag is pushed. |
| 97 | + |
| 98 | +### How it works |
| 99 | + |
| 100 | +The release notes generation workflow: |
| 101 | +1. Triggers automatically when a tag matching `v*` is pushed |
| 102 | +2. Analyzes commits since the last release |
| 103 | +3. Generates release notes based on commit messages and PR titles |
| 104 | +4. Creates or updates the GitHub release with the generated notes |
| 105 | + |
| 106 | +### Manual review and adjustment |
| 107 | + |
| 108 | +While automation helps, always review the generated release notes: |
| 109 | +1. Check for accuracy and completeness |
| 110 | +2. Add context for major changes |
| 111 | +3. Highlight breaking changes or important updates |
| 112 | +4. Ensure proper formatting and readability |
| 113 | + |
| 114 | +If manual adjustments are needed, you can use: |
| 115 | +```bash |
| 116 | +git log --first-parent v1.0.. |
| 117 | +``` |
| 118 | +to review changes since the last release. |
| 119 | + |
| 120 | +## Version Numbering |
| 121 | + |
| 122 | +MOLE follows [semantic versioning](https://semver.org/): |
| 123 | + |
| 124 | +- **MAJOR** version (X.y.z): Incompatible API changes |
| 125 | +- **MINOR** version (x.Y.z): New functionality in a backwards compatible manner |
| 126 | +- **PATCH** version (x.y.Z): Backwards compatible bug fixes |
| 127 | + |
| 128 | +Examples: |
| 129 | +- `v1.0.0` → `v1.1.0`: New features added (documentation system, test suites) |
| 130 | +- `v1.1.0` → `v1.1.1`: Bug fixes only |
| 131 | +- `v1.1.0` → `v2.0.0`: Breaking changes to API |
| 132 | + |
| 133 | +## Release Checklist |
| 134 | + |
| 135 | +Before creating a release: |
| 136 | + |
| 137 | +- [ ] All tests pass on supported platforms |
| 138 | +- [ ] Documentation builds successfully |
| 139 | +- [ ] Version numbers updated in relevant files |
| 140 | +- [ ] CHANGELOG or release notes prepared |
| 141 | +- [ ] Dependencies verified and up-to-date |
| 142 | +- [ ] Installation instructions tested |
| 143 | +- [ ] Examples work correctly |
| 144 | +- [ ] CI/CD workflows pass |
| 145 | + |
| 146 | +After creating a release: |
| 147 | + |
| 148 | +- [ ] GitHub release created with proper notes |
| 149 | +- [ ] Zenodo record updated (if applicable) |
| 150 | +- [ ] DOI updated in repository files |
| 151 | +- [ ] Community notified (if appropriate) |
| 152 | +- [ ] Package managers updated (if applicable) |
| 153 | + |
| 154 | +## Troubleshooting |
| 155 | + |
| 156 | +### Common Issues |
| 157 | + |
| 158 | +1. **Tag already exists**: If you need to retag, delete the tag locally and remotely: |
| 159 | + ```bash |
| 160 | + git tag -d v1.1.0 |
| 161 | + git push origin :refs/tags/v1.1.0 |
| 162 | + ``` |
| 163 | + |
| 164 | +2. **CI failures**: Ensure all workflows pass before tagging. Check: |
| 165 | + - Build and test workflows |
| 166 | + - Documentation generation |
| 167 | + - Linting and code quality |
| 168 | + |
| 169 | +3. **Documentation issues**: If documentation fails to build: |
| 170 | + - Check for missing dependencies |
| 171 | + - Verify all referenced files exist |
| 172 | + - Review recent changes to documentation source |
| 173 | + |
| 174 | +### Getting Help |
| 175 | + |
| 176 | +If you encounter issues during the release process: |
| 177 | +1. Check existing GitHub issues for similar problems |
| 178 | +2. Review the CI/CD workflow logs for detailed error messages |
| 179 | +3. Consult the project maintainers |
| 180 | +4. Refer to the [contributing guidelines](CONTRIBUTING.md) |
| 181 | + |
| 182 | +## Post-Release Tasks |
| 183 | + |
| 184 | +After a successful release: |
| 185 | + |
| 186 | +1. **Update development version**: Consider updating version numbers to indicate development status |
| 187 | +2. **Monitor for issues**: Watch for bug reports related to the new release |
| 188 | +3. **Update documentation**: Ensure all documentation reflects the latest release |
| 189 | +4. **Community engagement**: Announce the release through appropriate channels |
0 commit comments